- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections.Generic;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- /// <summary>
- /// EnumGet 枚举获取控件参数公共类
- /// </summary>
- public class EnumGet
- {
- public EnumGet()
- {
- //
- // TODO: 在此处添加构造函数逻辑
- //
- }
- /// <summary>
- /// 基本URL地址
- /// </summary>
- public static string WWWRoot = "";
- #region 来自数据库
- #region 角色
- /// <summary>
- /// 获取角色
- /// </summary>
- /// <returns></returns>
- public static string GetRole(int i)
- {
- Model.User_Priv GetRoleq = new BLL.User_Priv().GetModel(i);
- return GetRoleq.PrivName;
- }
- #endregion
- #region 部门
- /// <summary>
- /// 获取部门枚举项
- /// </summary>
- public static List<Model.Department> DepartmentGetEnum()
- {
- BLL.Department BD = new BLL.Department();
- //清空
- List<Model.Department> BackDPMT = new List<Model.Department>();
- List<Model.Department> DPMT = BD.GetList();
- foreach (Model.Department MD in DPMT)
- {
- //缺省部门
- //离职人员/外部人员
- if (MD.DeptName != "缺省部门" && MD.DeptName != "离职人员/外部人员")
- {
- BackDPMT.Add(MD);
- }
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取部门
- /// </summary>
- /// <returns></returns>
- public static string GetDeptName(int i)
- {
- if (i == 0)
- {
- return "无部门";
- }
- else
- {
- Model.Department DPT = new BLL.Department().GetModel(i);
- return DPT.DeptName;
- }
- }
- #endregion
- #region 卷库
- /// <summary>
- /// 卷库枚举项
- /// </summary>
- public static List<Model.RollRooms> RollRoomsGetEnum()
- {
- BLL.RollRooms BD = new BLL.RollRooms();
- //清空
- List<Model.RollRooms> BackDPMT = new List<Model.RollRooms>();
- List<Model.RollRooms> DPMT = BD.GetList();
- foreach (Model.RollRooms MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取卷库
- /// </summary>
- /// <returns></returns>
- public static string GetRollRoomsName(int i)
- {
- try
- {
- if (i == 0)
- {
- return "无名称";
- }
- else
- {
- Model.RollRooms DPT = new BLL.RollRooms().GetModel(i);
- return DPT.JKMC;
- }
- }
- catch
- {
- return "无名称";
- }
- }
- #endregion
- #region 卷案
- /// <summary>
- /// 卷案枚举项
- /// </summary>
- public static List<Model.Rolls> RollGetEnum()
- {
- BLL.Rolls BD = new BLL.Rolls();
- //清空
- List<Model.Rolls> BackDPMT = new List<Model.Rolls>();
- List<Model.Rolls> DPMT = BD.GetList();
- foreach (Model.Rolls MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取卷案
- /// </summary>
- /// <returns></returns>
- public static string GetRollName(int i)
- {
- try
- {
- if (i == 0)
- {
- return "无名称";
- }
- else
- {
- Model.Rolls DPT = new BLL.Rolls().GetModel(i);
- return DPT.ANMC;
- }
- }
- catch
- {
- return "无名称";
- }
- }
- #endregion
- #region 用品类别
- /// <summary>
- /// 用品类别枚举项
- /// </summary>
- public static List<Model.UseThingsType> UseThingsTypeGetEnum()
- {
- BLL.UseThingsType BD = new BLL.UseThingsType();
- //清空
- List<Model.UseThingsType> BackDPMT = new List<Model.UseThingsType>();
- List<Model.UseThingsType> DPMT = BD.GetList();
- foreach (Model.UseThingsType MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取用品类别
- /// </summary>
- /// <returns></returns>
- public static string GetUseThingsTypeName(int i)
- {
- try
- {
- if (i == 0)
- {
- return "无名称";
- }
- else
- {
- Model.UseThingsType DPT = new BLL.UseThingsType().GetModel(i);
- return DPT.LBMC;
- }
- }
- catch
- {
- return "无名称";
- }
- }
- #endregion
- #region 流程分类
- /// <summary>
- /// 获取流程分类枚举项
- /// </summary>
- public static List<Model.FlowBaseType> FlowBaseTypeGetEnum()
- {
- BLL.FlowBaseType BD = new BLL.FlowBaseType();
- //清空
- List<Model.FlowBaseType> BackDPMT = new List<Model.FlowBaseType>();
- List<Model.FlowBaseType> DPMT = BD.GetList();
- foreach (Model.FlowBaseType MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取流程分类
- /// </summary>
- /// <returns></returns>
- public static string GetFlowBaseTypeName(int i)
- {
- if (i == 0)
- {
- return "分类";
- }
- else
- {
- Model.FlowBaseType DPT = new BLL.FlowBaseType().GetModel(i);
- return DPT.FLMC;
- }
- }
- #endregion
- #region 表单分类
- /// <summary>
- /// 获取表单分类枚举项
- /// </summary>
- public static List<Model.FlowBaseFormContent> FlowBaseFormGetEnum()
- {
- BLL.FlowBaseFormContent BD = new BLL.FlowBaseFormContent();
- //清空
- List<Model.FlowBaseFormContent> BackDPMT = new List<Model.FlowBaseFormContent>();
- List<Model.FlowBaseFormContent> DPMT = BD.GetList();
- foreach (Model.FlowBaseFormContent MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取表单分类
- /// </summary>
- /// <returns></returns>
- public static string GetFlowBaseFormName(int i)
- {
- if (i == 0)
- {
- return "分类";
- }
- else
- {
- Model.FlowBaseFormContent DPT = new BLL.FlowBaseFormContent().GetModel(i);
- return DPT.BDMC;
- }
- }
- #endregion
- #region 流程
- /// <summary>
- /// 获取流程枚举项
- /// </summary>
- public static List<Model.FlowBase> FlowBaseGetEnum()
- {
- BLL.FlowBase BD = new BLL.FlowBase();
- //清空
- List<Model.FlowBase> BackDPMT = new List<Model.FlowBase>();
- List<Model.FlowBase> DPMT = BD.GetList();
- foreach (Model.FlowBase MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取流程
- /// </summary>
- /// <returns></returns>
- public static string GetFlowBaseName(int i)
- {
- if (i == 0)
- {
- return "无流程";
- }
- else
- {
- Model.FlowBase DPT = new BLL.FlowBase().GetModel(i);
- return DPT.LCMC;
- }
- }
- #endregion
- #region 论坛小类别
- /// <summary>
- /// 获取论坛小类别枚举项
- /// </summary>
- public static List<Model.BBSSmailTYPE> BBSSmailTYPEGetEnum()
- {
- BLL.BBSSmailTYPE BD = new BLL.BBSSmailTYPE();
- //清空
- List<Model.BBSSmailTYPE> BackDPMT = new List<Model.BBSSmailTYPE>();
- List<Model.BBSSmailTYPE> DPMT = BD.GetList();
- foreach (Model.BBSSmailTYPE MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取论坛小类别
- /// </summary>
- /// <returns></returns>
- public static string GetBBSSmailTYPEName(int i)
- {
- if (i == 0)
- {
- return "无类别";
- }
- else
- {
- Model.BBSSmailTYPE DPT = new BLL.BBSSmailTYPE().GetModel(i);
- return DPT.MC;
- }
- }
- #endregion
- #region 论坛大类别
- /// <summary>
- /// 获取论坛大类别枚举项
- /// </summary>
- public static List<Model.BBSBigTYPE> BBSBigTYPEGetEnum()
- {
- BLL.BBSBigTYPE BD = new BLL.BBSBigTYPE();
- //清空
- List<Model.BBSBigTYPE> BackDPMT = new List<Model.BBSBigTYPE>();
- List<Model.BBSBigTYPE> DPMT = BD.GetList();
- foreach (Model.BBSBigTYPE MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取论坛大类别
- /// </summary>
- /// <returns></returns>
- public static string GetBBSBigTYPEName(int i)
- {
- if (i == 0)
- {
- return "无类别";
- }
- else
- {
- Model.BBSBigTYPE DPT = new BLL.BBSBigTYPE().GetModel(i);
- return DPT.FLMC;
- }
- }
- #endregion
- #region 值班类别(李)
- /// <summary>
- /// 值班类别枚举项
- /// </summary>
- public static List<Model.DutyTypes> ZhiBanTypeGetEnum()
- {
- BLL.DutyTypes BD = new BLL.DutyTypes();
- //清空
- List<Model.DutyTypes> BackDPMT = new List<Model.DutyTypes>();
- List<Model.DutyTypes> DPMT = BD.GetList();
- foreach (Model.DutyTypes MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取值班类别
- /// </summary>
- /// <returns></returns>
- public static string GetZhiBanTypeName(int i)
- {
- try
- {
- if (i == 0)
- {
- return "无名称";
- }
- else
- {
- Model.DutyTypes DPT = new BLL.DutyTypes().GetModel(i);
- return DPT.LBMC;
- }
- }
- catch
- {
- return "无名称";
- }
- }
- #endregion
- #region 用餐类别(李)
- /// <summary>
- /// 用餐类别枚举项
- /// </summary>
- public static List<Model.Foods> YongCanGetEnum()
- {
- BLL.Foods BF = new BLL.Foods();
- //清空
- List<Model.Foods> BackDPMT = new List<Model.Foods>();
- List<Model.Foods> DPMT = BF.GetList();
- foreach (Model.Foods MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取用餐类别
- /// </summary>
- /// <returns></returns>
- public static string GetYongCanName(int i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == 0)
- {
- RtStr = "无名称";
- }
- else
- {
- Model.Foods DPT = new BLL.Foods().GetModel(i);
- RtStr = DPT.YCLBMC;
- }
- }
- catch
- {
- return "无名称";
- }
- return RtStr;
- }
- #endregion
- #region 住宿类别(李)
- /// <summary>
- /// 住宿类别枚举项
- /// </summary>
- public static List<Model.Hotels> ZhuSuGetEnum()
- {
- BLL.Hotels BF = new BLL.Hotels();
- //清空
- List<Model.Hotels> BackDPMT = new List<Model.Hotels>();
- List<Model.Hotels> DPMT = BF.GetList();
- foreach (Model.Hotels MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取住宿类别
- /// </summary>
- /// <returns></returns>
- public static string GetZhuSuName(int i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == 0)
- {
- RtStr = "无名称";
- }
- else
- {
- Model.Hotels DPT = new BLL.Hotels().GetModel(i);
- RtStr = DPT.ZSLBM;
- }
- }
- catch
- {
- RtStr = "无名称";
- }
- return RtStr;
- }
- #endregion
- #region 获得详细类别--综合住宿类别和用餐类别(李)
- /// <summary>
- /// 获得详细类别
- /// </summary>
- /// <param name="i">接待类别</param>
- /// <param name="j">详细类别</param>
- /// <returns></returns>
- public static string GetXiangXiName(int i, int j)
- {
- string RtStr = "无名称";
- switch (i)
- {
- case 1:
- RtStr = GetYongCanName(j);
- break;
- case 2:
- RtStr = GetZhuSuName(j);
- break;
- default:
- RtStr = GetJieDaiName(i.ToString());
- break;
- }
- return RtStr;
- }
- #endregion
- #region 会议室管理员(李)
- /// <summary>
- /// 会议室管理员枚举项
- /// </summary>
- public static List<Model.MeetingManagers> MeetingManagersGetEnum()
- {
- BLL.MeetingManagers BD = new BLL.MeetingManagers();
- //清空
- List<Model.MeetingManagers> BackDPMT = new List<Model.MeetingManagers>();
- List<Model.MeetingManagers> DPMT = BD.GetList();
- foreach (Model.MeetingManagers MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取会议室管理员
- /// </summary>
- /// <returns></returns>
- public static string GetMeetingManagersName(int i)
- {
- try
- {
- if (i == 0)
- {
- return "无名称";
- }
- else
- {
- Model.MeetingManagers DPT = new BLL.MeetingManagers().GetModel(i);
- return DPT.GLY;
- }
- }
- catch
- {
- return "无名称";
- }
- }
- #endregion
- #region 会议室(李)
- /// <summary>
- /// 会议室枚举项
- /// </summary>
- public static List<Model.MeetingRooms> MeetingRoomsGetEnum()
- {
- BLL.MeetingRooms BD = new BLL.MeetingRooms();
- //清空
- List<Model.MeetingRooms> BackDPMT = new List<Model.MeetingRooms>();
- List<Model.MeetingRooms> DPMT = BD.GetList();
- foreach (Model.MeetingRooms MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取会议室
- /// </summary>
- /// <returns></returns>
- public static string GetMeetingRoomsName(int i)
- {
- try
- {
- if (i == 0)
- {
- return "无名称";
- }
- else
- {
- Model.MeetingRooms DPT = new BLL.MeetingRooms().GetModel(i);
- return DPT.MC;
- }
- }
- catch
- {
- return "无名称";
- }
- }
- #endregion
- #region 车牌号(李)
- /// <summary>
- /// 车牌号枚举项
- /// </summary>
- public static List<Model.Cars> CarNumberGetEnum()
- {
- BLL.Cars BF = new BLL.Cars();
- //清空
- List<Model.Cars> BackDPMT = new List<Model.Cars>();
- List<Model.Cars> DPMT = BF.GetList();
- foreach (Model.Cars MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取车牌号
- /// </summary>
- /// <returns></returns>
- public static string GetCarNumberName(int i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == 0)
- {
- RtStr = "无名称";
- }
- else
- {
- Model.Cars DPT = new BLL.Cars().GetModel(i);
- RtStr = DPT.CPH;
- }
- }
- catch
- {
- return "无名称";
- }
- return RtStr;
- }
- #endregion
- #region 调度员(李)
- /// <summary>
- /// 调度员枚举项
- /// </summary>
- public static List<Model.Controlloer> DiaoDuYuanGetEnum()
- {
- BLL.Controlloer BF = new BLL.Controlloer();
- //清空
- List<Model.Controlloer> BackDPMT = new List<Model.Controlloer>();
- List<Model.Controlloer> DPMT = BF.GetList();
- foreach (Model.Controlloer MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取调度员
- /// </summary>
- /// <returns></returns>
- public static string GetDiaoDuYuanName(int i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == 0)
- {
- RtStr = "无名称";
- }
- else
- {
- Model.Controlloer DPT = new BLL.Controlloer().GetModel(i);
- RtStr = DPT.DDY;
- }
- }
- catch
- {
- return "无名称";
- }
- return RtStr;
- }
- #endregion
- #region 备选人员(李)
- /// <summary>
- /// 备选人员枚举项
- /// </summary>
- public static List<Model.Users> BeiXuanRenYuanGetEnum()
- {
- BLL.Users BF = new BLL.Users();
- //清空
- List<Model.Users> BackDPMT = new List<Model.Users>();
- List<Model.Users> DPMT = BF.GetList();
- foreach (Model.Users MD in DPMT)
- {
- BackDPMT.Add(MD);
- }
- return BackDPMT;
- }
- /// <summary>
- /// 获取备选人员
- /// </summary>
- /// <returns></returns>
- public static string GetBeiXuanRenYuanName(int i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == 0)
- {
- RtStr = "无名称";
- }
- else
- {
- Model.Users DPT = new BLL.Users().GetModel(i);
- RtStr = DPT.UserId;
- }
- }
- catch
- {
- return "无名称";
- }
- return RtStr;
- }
- #endregion
- #endregion
- #region 固定分类
- #region 密级
- /// <summary>
- /// 密级枚举
- /// </summary>
- /// <returns></returns>
- public static List<EnumList> MiJiGetEnum()
- {
- List<EnumList> RtList = new List<EnumList>();
- EnumList EL = new EnumList();
- EL.Text = "公开";
- EL.Value = "0";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "普密";
- EL.Value = "1";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "绝密";
- EL.Value = "2";
- RtList.Add(EL);
- return RtList;
- }
- /// <summary>
- /// 获取密级名称
- /// </summary>
- /// <returns></returns>
- public static string GetMiJiName(string i)
- {
- string RtStr = "无名称";
- if (i == "0")
- {
- return RtStr;
- }
- else
- {
- List<EnumList> DPT = MiJiGetEnum();
- foreach (EnumList DP in DPT)
- {
- if (DP.Value == i)
- {
- RtStr = DP.Text;
- break;
- }
- }
- return RtStr;
- }
- }
- #endregion
- #region 凭证
- /// <summary>
- /// 凭证枚举
- /// </summary>
- /// <returns></returns>
- public static List<EnumList> PingZhengGetEnum()
- {
- List<EnumList> RtList = new List<EnumList>();
- EnumList EL = new EnumList();
- EL.Text = "XXX1";
- EL.Value = "0";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "XXX2";
- EL.Value = "1";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "XXX3";
- EL.Value = "2";
- RtList.Add(EL);
- return RtList;
- }
- /// <summary>
- /// 获取密级名称
- /// </summary>
- /// <returns></returns>
- public static string GetPingZhengName(string i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == "0")
- {
- return RtStr;
- }
- else
- {
- List<EnumList> DPT = PingZhengGetEnum();
- foreach (EnumList DP in DPT)
- {
- if (DP.Value == i)
- {
- RtStr = DP.Text;
- break;
- }
- }
- return RtStr;
- }
- }
- catch
- {
- return RtStr;
- }
- }
- #endregion
- #region 紧急
- /// <summary>
- /// 紧急枚举
- /// </summary>
- /// <returns></returns>
- public static List<EnumList> JinJiGetEnum()
- {
- List<EnumList> RtList = new List<EnumList>();
- EnumList EL = new EnumList();
- EL.Text = "普级";
- EL.Value = "0";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "特级";
- EL.Value = "1";
- RtList.Add(EL);
- return RtList;
- }
- /// <summary>
- /// 获取紧急名称
- /// </summary>
- /// <returns></returns>
- public static string GetJinJiName(string i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == "0")
- {
- return RtStr;
- }
- else
- {
- List<EnumList> DPT = JinJiGetEnum();
- foreach (EnumList DP in DPT)
- {
- if (DP.Value == i)
- {
- RtStr = DP.Text;
- break;
- }
- }
- return RtStr;
- }
- }
- catch
- {
- return RtStr;
- }
- }
- #endregion
- #region 公文
- /// <summary>
- /// 公文枚举
- /// </summary>
- /// <returns></returns>
- public static List<EnumList> GongWenGetEnum()
- {
- List<EnumList> RtList = new List<EnumList>();
- EnumList EL = new EnumList();
- EL.Text = "公文";
- EL.Value = "0";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "资料";
- EL.Value = "1";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "合同";
- EL.Value = "2";
- RtList.Add(EL);
- return RtList;
- }
- /// <summary>
- /// 获取公文名称
- /// </summary>
- /// <returns></returns>
- public static string GetGongWenName(string i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == "0")
- {
- return RtStr;
- }
- else
- {
- List<EnumList> DPT = GongWenGetEnum();
- foreach (EnumList DP in DPT)
- {
- if (DP.Value == i)
- {
- RtStr = DP.Text;
- break;
- }
- }
- return RtStr;
- }
- }
- catch
- {
- return RtStr;
- }
- }
- #endregion
- #region 文件
- /// <summary>
- /// 文件枚举
- /// </summary>
- /// <returns></returns>
- public static List<EnumList> WenJianGetEnum()
- {
- List<EnumList> RtList = new List<EnumList>();
- EnumList EL = new EnumList();
- EL.Text = "A";
- EL.Value = "0";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "B";
- EL.Value = "1";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "C";
- EL.Value = "2";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "D";
- EL.Value = "3";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "E";
- EL.Value = "4";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "F";
- EL.Value = "5";
- RtList.Add(EL);
- return RtList;
- }
- /// <summary>
- /// 获取文件名称
- /// </summary>
- /// <returns></returns>
- public static string GetWenJianName(string i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == "0")
- {
- return RtStr;
- }
- else
- {
- List<EnumList> DPT = GongWenGetEnum();
- foreach (EnumList DP in DPT)
- {
- if (DP.Value == i)
- {
- RtStr = DP.Text;
- break;
- }
- }
- return RtStr;
- }
- }
- catch
- {
- return RtStr;
- }
- }
- #endregion
- #region 登记标示(李)
- /// <summary>
- /// 登记标示枚举
- /// </summary>
- /// <returns></returns>
- public static List<EnumList> DengJiGetEnum()
- {
- List<EnumList> RtList = new List<EnumList>();
- EnumList EL = new EnumList();
- EL.Text = "领用";
- EL.Value = "1";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "借用";
- EL.Value = "2";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "归还";
- EL.Value = "3";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "报废";
- EL.Value = "4";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "采购入库";
- EL.Value = "5";
- RtList.Add(EL);
- return RtList;
- }
- /// <summary>
- /// 获得登记表示的索引
- /// </summary>
- /// <param name="djbs">登记表示(内容)</param>
- /// <returns></returns>
- public static int GetDengJiIndex(string djbs)
- {
- int index = 0;
- switch (djbs)
- {
- case "领用":
- index = 1;
- break;
- case "借用":
- index = 2;
- break;
- case "归还":
- index = 3;
- break;
- case "报废":
- index = 4;
- break;
- case "采购入库":
- index = 5;
- break;
- }
- return index;
- }
- /// <summary>
- /// 获取登记标示名称
- /// </summary>
- /// <returns></returns>
- public static string GetDengJiName(string i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == "0")
- {
- return RtStr;
- }
- else
- {
- List<EnumList> DPT = DengJiGetEnum();
- foreach (EnumList DP in DPT)
- {
- if (DP.Value == i)
- {
- RtStr = DP.Text;
- break;
- }
- }
- return RtStr;
- }
- }
- catch
- {
- return RtStr;
- }
- }
- #endregion
- #region 车辆(李)
- #region 车辆类型
- /// <summary>
- /// 车辆类型枚举
- /// </summary>
- /// <returns></returns>
- public static List<EnumList> CarTypeGetEnum()
- {
- List<EnumList> RtList = new List<EnumList>();
- EnumList EL = new EnumList();
- EL.Text = "轿车";
- EL.Value = "1";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "面包车";
- EL.Value = "2";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "越野车";
- EL.Value = "3";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "吉普车";
- EL.Value = "4";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "巴士";
- EL.Value = "5";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "工具车";
- EL.Value = "6";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "卡车";
- EL.Value = "7";
- RtList.Add(EL);
- return RtList;
- }
- /// <summary>
- /// 获得车辆类型的索引
- /// </summary>
- /// <param name="djbs">登记表示(内容)</param>
- /// <returns></returns>
- public static int GetCarTypeIndex(string cllx)
- {
- int index = 0;
- switch (cllx)
- {
- case "轿车":
- index = 1;
- break;
- case "面包车":
- index = 2;
- break;
- case "越野车":
- index = 3;
- break;
- case "吉普车":
- index = 4;
- break;
- case "巴士":
- index = 5;
- break;
- case "工具车":
- index = 6;
- break;
- case "卡车":
- index = 7;
- break;
- }
- return index;
- }
- /// <summary>
- /// 获取车辆类型名称
- /// </summary>
- /// <returns></returns>
- public static string GetCarTypeName(string i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == "0")
- {
- return RtStr;
- }
- else
- {
- List<EnumList> DPT = CarTypeGetEnum();
- foreach (EnumList DP in DPT)
- {
- if (DP.Value == i)
- {
- RtStr = DP.Text;
- break;
- }
- }
- return RtStr;
- }
- }
- catch
- {
- return RtStr;
- }
- }
- #endregion
- #region 当前状态
- /// <summary>
- /// 当前状态枚举
- /// </summary>
- /// <returns></returns>
- public static List<EnumList> CurrentStateGetEnum()
- {
- List<EnumList> RtList = new List<EnumList>();
- EnumList EL = new EnumList();
- EL.Text = "空闲";
- EL.Value = "1";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "损坏";
- EL.Value = "2";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "维修中";
- EL.Value = "3";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "报废";
- EL.Value = "4";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "正在使用";
- EL.Value = "5";
- RtList.Add(EL);
- return RtList;
- }
- /// <summary>
- /// 获得当前状态的索引
- /// </summary>
- /// <param name="djbs">登记表示(内容)</param>
- /// <returns></returns>
- public static int GetCurrentStateIndex(string dqzt)
- {
- int index = 0;
- switch (dqzt)
- {
- case "可用":
- index = 1;
- break;
- case "损坏":
- index = 2;
- break;
- case "维修中":
- index = 3;
- break;
- case "报废":
- index = 4;
- break;
- }
- return index;
- }
- /// <summary>
- /// 获取当前状态名称
- /// </summary>
- /// <returns></returns>
- public static string GetCurrentStateName(string i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == "0")
- {
- return RtStr;
- }
- else
- {
- List<EnumList> DPT = CurrentStateGetEnum();
- foreach (EnumList DP in DPT)
- {
- if (DP.Value == i)
- {
- RtStr = DP.Text;
- break;
- }
- }
- return RtStr;
- }
- }
- catch
- {
- return RtStr;
- }
- }
- #endregion
- #endregion
- #region 接待类别(李)
- /// <summary>
- /// 接待类别枚举
- /// </summary>
- /// <returns></returns>
- public static List<EnumList> JieDaiGetEnum()
- {
- List<EnumList> RtList = new List<EnumList>();
- EnumList EL = new EnumList();
- EL.Text = "用餐";
- EL.Value = "1";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "住宿";
- EL.Value = "2";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "来访";
- EL.Value = "3";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "审查";
- EL.Value = "4";
- RtList.Add(EL);
- return RtList;
- }
- /// <summary>
- /// 获取接待类别名称
- /// </summary>
- /// <returns></returns>
- public static string GetJieDaiName(string i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == "0")
- {
- return RtStr;
- }
- else
- {
- List<EnumList> DPT = JieDaiGetEnum();
- foreach (EnumList DP in DPT)
- {
- if (DP.Value == i)
- {
- RtStr = DP.Text;
- break;
- }
- }
- return RtStr;
- }
- }
- catch
- {
- return RtStr;
- }
- }
- #endregion
- #region 维护类型(李)
- /// <summary>
- /// 维护类型枚举
- /// </summary>
- /// <returns></returns>
- public static List<EnumList> WeiHuGetEnum()
- {
- List<EnumList> RtList = new List<EnumList>();
- EnumList EL = new EnumList();
- EL.Text = "维修";
- EL.Value = "1";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "加油";
- EL.Value = "2";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "洗车";
- EL.Value = "3";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "年检";
- EL.Value = "4";
- RtList.Add(EL);
- EL = new EnumList();
- EL.Text = "其它";
- EL.Value = "5";
- RtList.Add(EL);
- return RtList;
- }
- /// <summary>
- /// 获取维护类型名称
- /// </summary>
- /// <returns></returns>
- public static string GetWeiHuName(string i)
- {
- string RtStr = "无名称";
- try
- {
- if (i == "0")
- {
- return RtStr;
- }
- else
- {
- List<EnumList> DPT = WeiHuGetEnum();
- foreach (EnumList DP in DPT)
- {
- if (DP.Value == i)
- {
- RtStr = DP.Text;
- break;
- }
- }
- return RtStr;
- }
- }
- catch
- {
- return RtStr;
- }
- }
- #endregion
- #endregion
- }
- /// <summary>
- /// 枚举密级
- /// </summary>
- public class EnumList
- {
- private string _Text = "";
- public string Text
- {
- get { return _Text; }
- set { _Text = value; }
- }
- private string _Value = "";
- public string Value
- {
- get { return _Value; }
- set { _Value = value; }
- }
- }