/// <summary> /// 根据查询条件获取某一条信息记录 /// </summary> /// <param name="sw">参见模型</param> /// <returns>参见模型</returns> public static T_SYS_ADDREDDBOOK_Model getModel(T_SYS_ADDREDDBOOK_SW sw) { DataTable dt = BaseDT.T_SYS_ADDREDDBOOK.getDT(sw); T_SYS_ADDREDDBOOK_Model m = new T_SYS_ADDREDDBOOK_Model(); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 if (dt.Rows.Count > 0) { int i = 0; m.ADID = dt.Rows[i]["ADID"].ToString(); m.ATID = dt.Rows[i]["ATID"].ToString(); m.ORGNO = dt.Rows[i]["ORGNO"].ToString(); m.ADNAME = dt.Rows[i]["ADNAME"].ToString(); m.USERJOB = dt.Rows[i]["USERJOB"].ToString(); m.PHONE = dt.Rows[i]["PHONE"].ToString(); m.Tell = dt.Rows[i]["Tell"].ToString(); m.ORDERBY = dt.Rows[i]["ORDERBY"].ToString(); m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtORG, dt.Rows[i]["ORGNO"].ToString()); DataTable dtType = BaseDT.T_SYS_ADDREDDTYPE.getDT(new T_SYS_ADDREDDTYPE_SW { ATID = m.ATID }); m.ATName = BaseDT.T_SYS_ADDREDDTYPE.getName(dtType, m.ATID); dtType.Clear(); dtType.Dispose(); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); return(m); }
/// <summary> /// 根据查询条件获取某一条信息记录 /// </summary> /// <param name="sw">参见模型</param> /// <returns>参见模型</returns> public static JC_INFRAREDCAMERA_BASICINFO_Model getModel(JC_INFRAREDCAMERA_BASICINFO_SW sw) { DataTable dt = BaseDT.JC_INFRAREDCAMERA_BASICINFO.getDT(sw); JC_INFRAREDCAMERA_BASICINFO_Model m = new JC_INFRAREDCAMERA_BASICINFO_Model(); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 if (dt.Rows.Count > 0) { int i = 0; m.INFRAREDCAMERAID = dt.Rows[i]["INFRAREDCAMERAID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.PHONE = dt.Rows[i]["PHONE"].ToString(); m.INFRAREDCAMERANAME = dt.Rows[i]["INFRAREDCAMERANAME"].ToString(); m.PHONE = dt.Rows[i]["PHONE"].ToString(); m.JD = dt.Rows[i]["JD"].ToString(); m.WD = dt.Rows[i]["WD"].ToString(); m.GC = dt.Rows[i]["GC"].ToString(); m.ADDRESS = dt.Rows[i]["ADDRESS"].ToString(); m.PHONE = dt.Rows[i]["PHONE"].ToString(); m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtORG, dt.Rows[i]["BYORGNO"].ToString()); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); return(m); }
/// <summary> /// 获取数据列表 /// </summary> /// <param name="sw">参见模型</param> /// <returns>参见模型</returns> public static IEnumerable <PEST_LOCALTREESPECIES_Model> getListModel(PEST_LOCALTREESPECIES_SW sw) { var result = new List <PEST_LOCALTREESPECIES_Model>(); DataTable dt = BaseDT.PEST_LOCALTREESPECIES.getDT(sw); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 DataTable dtBiolo = BaseDT.T_SYS_BIOLOGICALTYPE.getDT(new T_SYS_BIOLOGICALTYPE_SW()); for (int i = 0; i < dt.Rows.Count; i++) { PEST_LOCALTREESPECIES_Model m = new PEST_LOCALTREESPECIES_Model(); m.PEST_LOCALTREESPECIESID = dt.Rows[i]["PEST_LOCALTREESPECIESID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.ORGNONAME = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.TSPCODE = dt.Rows[i]["TSPCODE"].ToString(); m.TSPNAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.TSPCODE); m.TSPKECODE = m.TSPCODE.Substring(0, 10) + "0000"; m.TSPKENAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.TSPKECODE); m.TSPSHUCODE = m.TSPCODE.Substring(0, 12) + "00"; m.TSPSHUNAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.TSPSHUCODE); m.TSPAREA = dt.Rows[i]["TSPAREA"].ToString(); result.Add(m); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); dtBiolo.Clear(); dtBiolo.Dispose(); return(result); }
/// <summary> /// 获取单条数据 /// </summary> /// <param name="sw">参见模型</param> /// <returns></returns> public static PEST_REPORT_DIEPINESURVEY_Model getModel(PEST_REPORT_DIEPINESURVEY_SW sw) { DataTable dt = BaseDT.PEST_REPORT_DIEPINESURVEY.getDT(sw); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 PEST_REPORT_DIEPINESURVEY_Model m = new PEST_REPORT_DIEPINESURVEY_Model(); if (dt.Rows.Count > 0) { int i = 0; //数据库表字段 m.PEST_REPORT_DIEPINESURVEYID = dt.Rows[i]["PEST_REPORT_DIEPINESURVEYID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.BYORGNONAME = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.FINDER = dt.Rows[i]["FINDER"].ToString(); m.FINDDATE = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["FINDDATE"].ToString()); m.LINKTELL = dt.Rows[i]["LINKTELL"].ToString(); m.DIEPINECOUNT = dt.Rows[i]["DIEPINECOUNT"].ToString(); m.REPORTDATE = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["REPORTDATE"].ToString()); m.SAMPLINGCOUNT = dt.Rows[i]["SAMPLINGCOUNT"].ToString(); m.AUTHENTICATERESULT = dt.Rows[i]["AUTHENTICATERESULT"].ToString(); //扩充字段 } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); return(m); }
/// <summary> /// 获取单条数据 /// </summary> /// <param name="sw">参见模型</param> /// <returns>参见模型</returns> public static FIRERECORD_FIREINFO_Model getModel(FIRERECORD_FIREINFO_SW sw) { DataTable dt = BaseDT.FIRERECORD_FIREINFO.getDT2(sw); FIRERECORD_FIREINFO_Model m = new FIRERECORD_FIREINFO_Model(); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 if (dt != null && dt.Rows.Count > 0) { int i = 0; m.FRFIID = dt.Rows[i]["FRFIID"].ToString(); m.JCFID = dt.Rows[i]["JCFID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.FIRECODE = dt.Rows[i]["FIRECODE"].ToString(); m.FIREADDRESSCOUNTY = dt.Rows[i]["FIREADDRESSCOUNTY"].ToString(); m.FIREADDRESSTOWNS = dt.Rows[i]["FIREADDRESSTOWNS"].ToString(); m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtORG, m.FIREADDRESSTOWNS); m.FIREADDRESSVILLAGES = dt.Rows[i]["FIREADDRESSVILLAGES"].ToString(); m.FIRETIME = ClsSwitch.SwitTM(dt.Rows[i]["FIRETIME"].ToString()); m.FIREENDTIME = ClsSwitch.SwitTM(dt.Rows[i]["FIREENDTIME"].ToString()); m.FIREADDRESS = dt.Rows[i]["FIREADDRESS"].ToString(); m.FIRERECINFO000 = dt.Rows[i]["FIRERECINFO000"].ToString(); m.FIRERECINFO001 = dt.Rows[i]["FIRERECINFO001"].ToString(); m.FIRERECINFO020 = dt.Rows[i]["FIRERECINFO020"].ToString(); m.FIRERECINFO021 = dt.Rows[i]["FIRERECINFO021"].ToString(); m.FIRERECINFO030 = dt.Rows[i]["FIRERECINFO030"].ToString(); m.FIRERECINFO031 = dt.Rows[i]["FIRERECINFO031"].ToString(); m.FIRERECINFO032 = dt.Rows[i]["FIRERECINFO032"].ToString(); m.FIRERECINFO040 = dt.Rows[i]["FIRERECINFO040"].ToString(); m.FIRERECINFO041 = dt.Rows[i]["FIRERECINFO041"].ToString(); m.FIRERECINFO050 = dt.Rows[i]["FIRERECINFO050"].ToString(); m.FIRERECINFO051 = dt.Rows[i]["FIRERECINFO051"].ToString(); m.FIRERECINFO060 = dt.Rows[i]["FIRERECINFO060"].ToString(); m.FIRERECINFO061 = dt.Rows[i]["FIRERECINFO061"].ToString(); m.FIRERECINFO070 = dt.Rows[i]["FIRERECINFO070"].ToString(); m.FIRERECINFO071 = dt.Rows[i]["FIRERECINFO071"].ToString(); m.FIRERECINFO072 = dt.Rows[i]["FIRERECINFO072"].ToString(); m.FIRERECINFO080 = dt.Rows[i]["FIRERECINFO080"].ToString(); m.FIRERECINFO081 = dt.Rows[i]["FIRERECINFO081"].ToString(); m.FIRERECINFO082 = dt.Rows[i]["FIRERECINFO082"].ToString(); m.FIRERECINFO090 = dt.Rows[i]["FIRERECINFO090"].ToString(); m.FIRERECINFO100 = dt.Rows[i]["FIRERECINFO100"].ToString(); m.FIRERECINFO110 = dt.Rows[i]["FIRERECINFO110"].ToString(); m.FIRERECINFO111 = dt.Rows[i]["FIRERECINFO111"].ToString(); m.FIRERECINFO120 = dt.Rows[i]["FIRERECINFO120"].ToString(); m.FIRERECINFO130 = dt.Rows[i]["FIRERECINFO130"].ToString(); m.FIRERECINFO140 = dt.Rows[i]["FIRERECINFO140"].ToString(); m.FIRERECINFO150 = dt.Rows[i]["FIRERECINFO150"].ToString(); m.FIRERECINFO160 = dt.Rows[i]["FIRERECINFO160"].ToString(); m.FIRELOSEAREA = dt.Rows[i]["FIRELOSEAREA"].ToString(); //m.JD = dt.Rows[i]["JD"].ToString(); //m.WD = dt.Rows[i]["WD"].ToString(); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); return(m); }
/// <summary> /// 获取数据列表 /// </summary> /// <param name="sw">参见模型</param> /// <param name="total">总记录数</param> /// <returns></returns> public static List <PEST_REPORT_DIEPINESURVEY_Model> getListModel(PEST_REPORT_DIEPINESURVEY_SW sw, out int total) { var result = new List <PEST_REPORT_DIEPINESURVEY_Model>(); DataTable dt = BaseDT.PEST_REPORT_DIEPINESURVEY.getDT(sw, out total); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 for (int i = 0; i < dt.Rows.Count; i++) { PEST_REPORT_DIEPINESURVEY_Model m = new PEST_REPORT_DIEPINESURVEY_Model(); m.PEST_REPORT_DIEPINESURVEYID = dt.Rows[i]["PEST_REPORT_DIEPINESURVEYID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.BYORGNONAME = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.FINDER = dt.Rows[i]["FINDER"].ToString(); m.FINDDATE = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["FINDDATE"].ToString()); m.LINKTELL = dt.Rows[i]["LINKTELL"].ToString(); m.DIEPINECOUNT = dt.Rows[i]["DIEPINECOUNT"].ToString(); m.REPORTDATE = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["REPORTDATE"].ToString()); m.SAMPLINGCOUNT = dt.Rows[i]["SAMPLINGCOUNT"].ToString(); m.AUTHENTICATERESULT = dt.Rows[i]["AUTHENTICATERESULT"].ToString(); result.Add(m); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); return(result); }
/// <summary> /// 获取分页 /// </summary> /// <param name="sw">参见模型</param> /// <param name="total">记录总数</param> /// <returns>参见模型</returns> public static IEnumerable <JC_UAV_Model> getModelList(JC_UAV_SW sw, out int total) { var result = new List <JC_UAV_Model>(); DataTable dt = BaseDT.JC_UAV.getDT(sw, out total);//列表 DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 for (int i = 0; i < dt.Rows.Count; i++) { JC_UAV_Model m = new JC_UAV_Model(); m.UAVID = dt.Rows[i]["UAVID"].ToString(); m.UAVNAME = dt.Rows[i]["UAVNAME"].ToString(); m.UAVEQUIPNAME = dt.Rows[i]["UAVEQUIPNAME"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.ORDERBY = dt.Rows[i]["ORDERBY"].ToString(); m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); result.Add(m); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); return(result); }
/// <summary> /// 获取监测火情信息——优化后 /// </summary> /// <param name="sw"></param> /// <returns></returns> public static IEnumerable <JC_FIRE_Model> GetListModelYH(JC_FIRE_SW sw) { DataTable dt = BaseDT.JC_FIRE.GetDTYH(sw);//列表 var result = new List <JC_FIRE_Model>(); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 for (int i = 0; i < dt.Rows.Count; i++) { JC_FIRE_Model m = new JC_FIRE_Model(); m.JCFID = dt.Rows[i]["JCFID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.FIRENAME = dt.Rows[i]["FIRENAME"].ToString(); m.JD = dt.Rows[i]["JD"].ToString(); m.WD = dt.Rows[i]["WD"].ToString(); m.ZQWZ = dt.Rows[i]["ZQWZ"].ToString(); m.FIRELEVEL = dt.Rows[i]["FIRELEVEL"].ToString(); m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); result.Add(m); } dt.Clear(); dt.Dispose(); return(result); }
/// <summary> /// 获取列表 /// </summary> /// <param name="sw"></param> /// <returns></returns> public static IEnumerable <JC_FIRE_REPORT_Model> getModelList(JC_FIRE_REPORT_SW sw) { var result = new List <JC_FIRE_REPORT_Model>(); DataTable dt = BaseDT.JC_FIRE_REPORT.getDT(sw);//列表 DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 for (int i = 0; i < dt.Rows.Count; i++) { JC_FIRE_REPORT_Model m = new JC_FIRE_REPORT_Model(); m.ID = dt.Rows[i]["ID"].ToString(); m.OWERJCFID = dt.Rows[i]["OWERJCFID"].ToString(); m.FILENAME = dt.Rows[i]["FILENAME"].ToString(); m.FILESIZE = dt.Rows[i]["FILESIZE"].ToString(); m.FILEURL = dt.Rows[i]["FILEURL"].ToString(); //m.UPLOADTIME = dt.Rows[i]["UPLOADTIME"].ToString(); m.UPLOADTIME = ClsSwitch.SwitTM(dt.Rows[i]["UPLOADTIME"].ToString()); m.UPLOADUSERID = dt.Rows[i]["UPLOADUSERID"].ToString(); m.UPLOADORGNO = dt.Rows[i]["UPLOADORGNO"].ToString(); m.UPLOANAME = T_SYSSEC_IPSUSERCls.getModel(new T_SYSSEC_IPSUSER_SW() { USERID = m.UPLOADUSERID }).USERNAME; m.UPLOADORGNAME = BaseDT.T_SYS_ORG.getName(dtORG, m.UPLOADORGNO); result.Add(m); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); return(result); }
/// <summary> /// 获取所有角色及该用户拥有的角色 /// </summary> /// <param name="sw">参见模型</param> /// <returns>参见模型</returns> public static IEnumerable <T_SYSSEC_ROLE_USER_Model> getRoleAndUidModel(T_SYSSEC_ROLE_SW sw) { var result = new List <T_SYSSEC_ROLE_USER_Model>(); DataTable dtRole = BaseDT.T_SYSSEC_ROLE.getDT(new T_SYSSEC_ROLE_SW { SYSFLAG = ConfigCls.getSystemFlag() }); DataTable dtUR = BaseDT.T_SYSSEC_USER_ROLE.getDT(new T_SYSSEC_USER_ROLE_SW { USERID = sw.USERID }); for (int i = 0; i < dtRole.Rows.Count; i++) { T_SYSSEC_ROLE_USER_Model m = new T_SYSSEC_ROLE_USER_Model(); m.isCheck = "0";//默认不拥有 if (dtUR != null) { DataRow[] dr = dtUR.Select("ROLEID=" + dtRole.Rows[i]["ROLEID"].ToString()); if (dr.Length == 1) { m.isCheck = "1";//拥有角色 } } m.ROLEID = dtRole.Rows[i]["ROLEID"].ToString(); m.ROLENAME = dtRole.Rows[i]["ROLENAME"].ToString(); result.Add(m); } dtRole.Clear(); dtRole.Dispose(); dtUR.Clear(); dtUR.Dispose(); return(result); }
/// <summary> /// 获取数据列表 /// </summary> /// <param name="sw">参见模型</param> /// <param name="total">总记录数</param> /// <returns>参见模型</returns> public static IEnumerable <WILD_LOCALBOTANY_Model> getListModel(WILD_LOCALBOTANY_SW sw, out int total) { var result = new List <WILD_LOCALBOTANY_Model>(); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 DataTable dtBiolo = BaseDT.T_SYS_BIOLOGICALTYPE.getDT(new T_SYS_BIOLOGICALTYPE_SW()); DataTable dt = BaseDT.WILD_LOCALBOTANY.getDT(sw, out total); for (int i = 0; i < dt.Rows.Count; i++) { WILD_LOCALBOTANY_Model m = new WILD_LOCALBOTANY_Model(); m.WILD_LOCALBOTANYID = dt.Rows[i]["WILD_LOCALBOTANYID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.ORGNONAME = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.BIOLOGICALTYPECODE = dt.Rows[i]["BIOLOGICALTYPECODE"].ToString(); m.BIOLOGICALTYPECODENAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.BIOLOGICALTYPECODE); m.PESTKECODE = m.BIOLOGICALTYPECODE.Substring(0, 10) + "0000"; m.PESTKENAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.PESTKECODE); m.PESTSHUCODE = m.BIOLOGICALTYPECODE.Substring(0, 12) + "00"; m.PESTSHUNAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.PESTSHUCODE); result.Add(m); } dtORG.Clear(); dtORG.Dispose(); dtBiolo.Clear(); dtBiolo.Dispose(); dt.Clear(); dt.Dispose(); return(result); }
/// <summary> /// 获取单条记录 /// </summary> /// <param name="sw">参见模型</param> /// <returns>参见模型</returns> public static WILD_LOCALBOTANY_Model getModel(WILD_LOCALBOTANY_SW sw) { DataTable dt = BaseDT.WILD_LOCALBOTANY.getDT(sw); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 DataTable dtBiolo = BaseDT.T_SYS_BIOLOGICALTYPE.getDT(new T_SYS_BIOLOGICALTYPE_SW()); WILD_LOCALBOTANY_Model m = new WILD_LOCALBOTANY_Model(); if (dt.Rows.Count > 0) { int i = 0; m.WILD_LOCALBOTANYID = dt.Rows[i]["WILD_LOCALBOTANYID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.ORGNONAME = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.BIOLOGICALTYPECODE = dt.Rows[i]["BIOLOGICALTYPECODE"].ToString(); m.BIOLOGICALTYPECODENAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.BIOLOGICALTYPECODE); m.PESTKECODE = m.BIOLOGICALTYPECODE.Substring(0, 10) + "0000"; m.PESTKENAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.PESTKECODE); m.PESTSHUCODE = m.BIOLOGICALTYPECODE.Substring(0, 12) + "00"; m.PESTSHUNAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.PESTSHUCODE); } dtORG.Clear(); dtORG.Dispose(); dtBiolo.Clear(); dtBiolo.Dispose(); dt.Clear(); dt.Dispose(); return(m); }
/// <summary> /// 单条记录 /// </summary> /// <param name="sw"></param> /// <returns></returns> public static DC_REPOSITORY_Model getModel(DC_REPOSITORY_SW sw) { DataTable dt = BaseDT.DC_REPOSITORY.getDT(sw);//列表 DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); DC_REPOSITORY_Model m = new DC_REPOSITORY_Model(); if (dt.Rows.Count > 0) { int i = 0; m.DCREPOSITORYID = dt.Rows[i]["DCREPOSITORYID"].ToString(); m.NAME = dt.Rows[i]["NAME"].ToString(); m.ADDRESS = dt.Rows[i]["ADDRESS"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.ORGName = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.RESPONSIBLEMAN = dt.Rows[i]["RESPONSIBLEMAN"].ToString(); m.LINKWAY = dt.Rows[i]["LINKWAY"].ToString(); m.REPTYPEID = dt.Rows[i]["REPTYPEID"].ToString(); m.JD = dt.Rows[i]["JD"].ToString(); m.WD = dt.Rows[i]["WD"].ToString(); } dt.Clear(); dt.Dispose(); return(m); }
/// <summary> /// 获取列表 /// </summary> /// <param name="sw"></param> /// <returns></returns> public static IEnumerable <DC_REPOSITORY_Model> getModelList(DC_REPOSITORY_SW sw) { var result = new List <DC_REPOSITORY_Model>(); DataTable dt = BaseDT.DC_REPOSITORY.getDT(sw);//列表 DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); for (int i = 0; i < dt.Rows.Count; i++) { DC_REPOSITORY_Model m = new DC_REPOSITORY_Model(); m.DCREPOSITORYID = dt.Rows[i]["DCREPOSITORYID"].ToString(); m.NAME = dt.Rows[i]["NAME"].ToString(); m.ADDRESS = dt.Rows[i]["ADDRESS"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.ORGName = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); //string orgname = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.COMNAME = "[" + m.ORGName + "]" + m.NAME + ""; //m.COMNAME = "[" + orgname + "]" + m.NAME + ""; m.RESPONSIBLEMAN = dt.Rows[i]["RESPONSIBLEMAN"].ToString(); m.LINKWAY = dt.Rows[i]["LINKWAY"].ToString(); m.REPTYPEID = dt.Rows[i]["REPTYPEID"].ToString(); m.JD = dt.Rows[i]["JD"].ToString(); m.WD = dt.Rows[i]["WD"].ToString(); result.Add(m); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); return(result); }
/// <summary> /// 获取列表 /// </summary> /// <param name="sw"></param> /// <returns></returns> public static IEnumerable <T_SYS_ORG_CWH_Model> getModelList(T_SYS_ORG_CWH_SW sw) { var result = new List <T_SYS_ORG_CWH_Model>(); DataTable dt = BaseDT.T_SYS_ORG_CWH.getDT(sw);//列表 DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 for (int i = 0; i < dt.Rows.Count; i++) { T_SYS_ORG_CWH_Model m = new T_SYS_ORG_CWH_Model(); m.CWHID = dt.Rows[i]["CWHID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.CWHNAME = dt.Rows[i]["CWHNAME"].ToString(); m.ORDERBY = dt.Rows[i]["ORDERBY"].ToString(); m.ORGName = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); result.Add(m); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); return(result); }
/// <summary> /// 先取出市级单位 /// </summary> /// <param name="dictvalue"></param> /// <returns></returns> public static JArray getARCHIVESTree(string dictvalue) { JArray jObjects = new JArray(); DataTable dtOrg = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); DataTable dtFire = BaseDT.JC_FIRE.GetDTFireProp(new JC_FIRE_SW { ISOUTFIRE = "1" }); DataRow[] drOrg = dtOrg.Select("", "ORGNO"); if (drOrg.Length > 0) { JObject root = new JObject { { "id", drOrg[0]["ORGNO"].ToString() }, //ORGNO { "text", drOrg[0]["ORGNAME"].ToString() + "[" + BaseDT.JC_FIRE.getFireCountByOrgLevel(dtFire, drOrg[0]["ORGNO"].ToString(), dictvalue) + "]" }, { "type", dictvalue }, { "flag", "1" } }; root.Add("children", getARCHIVESTreeChild(dtFire, dtOrg, drOrg[0]["ORGNO"].ToString(), dictvalue)); jObjects.Add(root); } dtOrg.Clear(); dtOrg.Dispose(); dtFire.Clear(); dtFire.Dispose(); return(jObjects); }
/// <summary> /// 获取列表 /// </summary> /// <param name="sw"></param> /// <param name="total"></param> /// <returns></returns> public static IEnumerable <JC_INFRAREDCAMERA_BASICINFO_Model> getListModel(JC_INFRAREDCAMERA_BASICINFO_SW sw, out int total) { DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 DataTable dt = BaseDT.JC_INFRAREDCAMERA_BASICINFO.getDT(sw, out total); //列表 var result = new List <JC_INFRAREDCAMERA_BASICINFO_Model>(); for (int i = 0; i < dt.Rows.Count; i++) { JC_INFRAREDCAMERA_BASICINFO_Model m = new JC_INFRAREDCAMERA_BASICINFO_Model(); m.INFRAREDCAMERAID = dt.Rows[i]["INFRAREDCAMERAID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.PHONE = dt.Rows[i]["PHONE"].ToString(); m.INFRAREDCAMERANAME = dt.Rows[i]["INFRAREDCAMERANAME"].ToString(); m.PHONE = dt.Rows[i]["PHONE"].ToString(); m.JD = dt.Rows[i]["JD"].ToString(); m.WD = dt.Rows[i]["WD"].ToString(); m.GC = dt.Rows[i]["GC"].ToString(); m.ADDRESS = dt.Rows[i]["ADDRESS"].ToString(); m.PHONE = dt.Rows[i]["PHONE"].ToString(); m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtORG, dt.Rows[i]["BYORGNO"].ToString()); result.Add(m); } dtORG.Clear(); dtORG.Dispose(); dt.Clear(); dt.Dispose(); return(result); }
/// <summary> /// 获取分页 /// </summary> /// <param name="sw">参见模型</param> /// <param name="total">记录总数</param> /// <returns>参见模型</returns> public static IEnumerable <JC_FIRE_Model> getModelList(JC_FIRE_SW sw, out int total) { var result = new List <JC_FIRE_Model>(); DataTable dtprop = BaseDT.JC_FIRE_PROP.getDT(new JC_FIRE_PROP_SW { }); DataTable dt = BaseDT.JC_FIRE.GetDCDT(sw, out total);//列表 DataTable dtUser = BaseDT.T_SYSSEC_USER.getDT(new T_SYSSEC_IPSUSER_SW { }); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 DataTable dt99 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "99" }); //火情来源 for (int i = 0; i < dt.Rows.Count; i++) { JC_FIRE_Model m = new JC_FIRE_Model(); m.JCFID = dt.Rows[i]["JCFID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.FIRENAME = dt.Rows[i]["FIRENAME"].ToString(); m.FIRELEVEL = BaseDT.JC_FIRE_PROP.getfirelevel(dtprop, dt.Rows[i]["JCFID"].ToString()); m.FIREFROM = dt.Rows[i]["FIREFROM"].ToString(); //火情来源 m.FIREFROMName = BaseDT.T_SYS_DICT.getName(dt99, m.FIREFROM); //火情来源名称 m.FIREFROMID = dt.Rows[i]["FIREFROMID"].ToString(); //原始记录序号 m.FIRETIME = ClsSwitch.SwitTM(dt.Rows[i]["FIRETIME"].ToString()); //起火时间 m.MARK = dt.Rows[i]["MARK"].ToString(); m.JD = dt.Rows[i]["JD"].ToString(); m.WD = dt.Rows[i]["WD"].ToString(); m.ZQWZ = dt.Rows[i]["ZQWZ"].ToString(); m.WXBH = dt.Rows[i]["WXBH"].ToString(); m.DQRDBH = dt.Rows[i]["DQRDBH"].ToString(); m.RSMJ = dt.Rows[i]["RSMJ"].ToString(); m.DL = dt.Rows[i]["DL"].ToString(); m.YY = dt.Rows[i]["YY"].ToString(); m.ISOUTFIRE = dt.Rows[i]["ISOUTFIRE"].ToString(); m.JXHQSJ = dt.Rows[i]["JXHQSJ"].ToString(); m.RECEIVETIME = ClsSwitch.SwitTM(dt.Rows[i]["RECEIVETIME"].ToString()); m.FIREENDTIME = ClsSwitch.SwitTM(dt.Rows[i]["FIREENDTIME"].ToString()); m.ISSUEDTIME = ClsSwitch.SwitTM(dt.Rows[i]["ISSUEDTIME"].ToString()); m.MANSTATE = dt.Rows[i]["MANSTATE"].ToString(); //m.ISSUEDTIME = ClsSwitch.SwitTM(dt.Rows[i]["LASTPROCESSTIME"].ToString()); //m.FIRELEVEL = dt.Rows[i]["FIRELEVEL"].ToString(); m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.PFUSERID = dt.Rows[i]["PFUSERID"].ToString(); m.PFNAME = BaseDT.T_SYSSEC_USER.getName(dtUser, m.PFUSERID); m.FirePropModel = null;//需要再扩充 m.HOTTYPE = dt.Rows[i]["HOTTYPE"].ToString(); result.Add(m); } dt.Clear(); dt.Dispose(); dtUser.Clear(); dtUser.Dispose(); dtORG.Clear(); dtORG.Dispose(); dt99.Clear(); dt99.Dispose(); return(result); }
/// <summary> /// 获取单条记录 /// </summary> /// <param name="sw">参见模型</param> /// <returns>参见模型</returns> public static PEST_LOCALTREESPECIES_Model getModel(PEST_LOCALTREESPECIES_SW sw) { DataTable dt = BaseDT.PEST_LOCALTREESPECIES.getDT(sw); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 DataTable dtBiolo = BaseDT.T_SYS_BIOLOGICALTYPE.getDT(new T_SYS_BIOLOGICALTYPE_SW()); PEST_LOCALTREESPECIES_Model m = new PEST_LOCALTREESPECIES_Model(); if (dt.Rows.Count > 0) { int i = 0; //数据库表字段 m.PEST_LOCALTREESPECIESID = dt.Rows[i]["PEST_LOCALTREESPECIESID"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.ORGNONAME = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.TSPCODE = dt.Rows[i]["TSPCODE"].ToString(); m.TSPNAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.TSPCODE); m.TSPKECODE = m.TSPCODE.Substring(0, 10) + "0000"; m.TSPKENAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.TSPKECODE); m.TSPSHUCODE = m.TSPCODE.Substring(0, 12) + "00"; m.TSPSHUNAME = BaseDT.T_SYS_BIOLOGICALTYPE.getName(dtBiolo, m.TSPSHUCODE); m.TSPAREA = dt.Rows[i]["TSPAREA"].ToString(); //扩充字段 } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); dtBiolo.Clear(); dtBiolo.Dispose(); return(m); }
/// <summary> /// 获取列表 /// </summary> /// <param name="sw"></param> /// <returns></returns> public static IEnumerable <DC_EQUIP_NEW_Model> getModelList(DC_EQUIP_NEW_SW sw) { var result = new List <DC_EQUIP_NEW_Model>(); DataTable dt = BaseDT.DC_EQUIP_NEW.getDT(sw);//列表 DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 DataTable dt32 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "32" }); //数据中心装备类型 DataTable dt36 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "36" }); //使用现状 for (int i = 0; i < dt.Rows.Count; i++) { DC_EQUIP_NEW_Model m = new DC_EQUIP_NEW_Model(); m.DC_EQUIP_NEW_ID = dt.Rows[i]["DC_EQUIP_NEW_ID"].ToString(); m.EQUIPTYPE = dt.Rows[i]["EQUIPTYPE"].ToString(); m.EQUIPTYPEName = BaseDT.T_SYS_DICT.getName(dt32, m.EQUIPTYPE); m.NUMBER = dt.Rows[i]["NUMBER"].ToString(); m.NAME = dt.Rows[i]["NAME"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.ORGName = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.MODEL = dt.Rows[i]["MODEL"].ToString(); m.BUYYEAR = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["BUYYEAR"].ToString()); m.USESTATE = dt.Rows[i]["USESTATE"].ToString(); m.USESTATEName = BaseDT.T_SYS_DICT.getName(dt36, m.USESTATE); m.STOREADDR = dt.Rows[i]["STOREADDR"].ToString(); m.MARK = dt.Rows[i]["MARK"].ToString(); m.JD = dt.Rows[i]["JD"].ToString(); m.WD = dt.Rows[i]["WD"].ToString(); m.WORTH = dt.Rows[i]["WORTH"].ToString(); m.EQUIPAMOUNT = dt.Rows[i]["EQUIPAMOUNT"].ToString(); m.REPID = dt.Rows[i]["REPID"].ToString(); m.DCSUPPROPUNIT = dt.Rows[i]["DCSUPPROPUNIT"].ToString(); m.PRICE = dt.Rows[i]["PRICE"].ToString(); if (string.IsNullOrEmpty(m.REPID) == false) { m.REPNAME = DC_REPOSITORYCls.getdepotname(m.REPID); } else { m.REPNAME = ""; } result.Add(m); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); dt32.Clear(); dt32.Dispose(); dt36.Clear(); dt36.Dispose(); return(result); }
/// <summary> /// 获取分页 /// </summary> /// <param name="sw">参见模型</param> /// <param name="total">记录总数</param> /// <returns>参见模型</returns> public static IEnumerable <TASK_INFO_Model> getModelList(TASK_INFO_SW sw, out int total) { var result = new List <TASK_INFO_Model>(); DataTable dt = BaseDT.TASK_INFO.getDT(sw, out total);//列表 DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 for (int i = 0; i < dt.Rows.Count; i++) { TASK_INFO_Model m = new TASK_INFO_Model(); m.TASK_INFOID = dt.Rows[i]["TASK_INFOID"].ToString(); m.TASKTITLE = dt.Rows[i]["TASKTITLE"].ToString(); m.TASKTYPE = dt.Rows[i]["TASKTYPE"].ToString(); m.TASKLEVEL = dt.Rows[i]["TASKLEVEL"].ToString(); m.TASKSTAUTS = dt.Rows[i]["TASKSTAUTS"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.TASKSTARTTIME = dt.Rows[i]["TASKSTARTTIME"].ToString(); m.TASKBEGINTIME = dt.Rows[i]["TASKBEGINTIME"].ToString(); m.TASKENDTIME = dt.Rows[i]["TASKENDTIME"].ToString(); m.TASKCONTENT = dt.Rows[i]["TASKCONTENT"].ToString(); result.Add(m); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); return(result); }
/// <summary> /// 获取类别子菜单 /// </summary> /// <param name="sw">sw</param> /// <param name="dt">dt</param> /// <param name="SubRightID">SubRightID</param> /// <returns></returns> private static JArray getTreeChild(T_SYSSEC_RIGHT_SW sw, DataTable dt, string SubRightID) { JArray childobjArray = new JArray(); DataRow[] dr = dt.Select("len(RIGHTID)=" + (SubRightID.Length + 3) + " and SUBSTRING(RIGHTID,1," + SubRightID.Length + ")='" + SubRightID + "'", "ORDERBY"); string flag = ConfigCls.getSystemFlag(); for (int i = 0; i < dr.Length; i++) { string text = dr[i]["RIGHTNAME"].ToString(); if (dr[i]["SYSFLAG"].ToString() != flag) { text = "<font color=red>" + text + "</font>"; } JObject root = new JObject { { "id", dr[i]["RIGHTID"].ToString() }, { "text", text }, { "state", "open" }, }; if (dr[i]["RIGHTID"].ToString().Length <= 3) { root.Add("children", getTreeChild(sw, dt, dr[i]["RIGHTID"].ToString())); } childobjArray.Add(root); } return(childobjArray); }
/// <summary> /// 根据查询条件获取某一条用户信息记录,用于修改、删除、用户登录验证 /// </summary> /// <param name="sw">参见模型</param> /// <returns>参见模型</returns> public static WILD_BOTANYDISTRIBUTE_Model getModel(WILD_BOTANYDISTRIBUTE_SW sw) { DataTable dt = BaseDT.WILD_BOTANYDISTRIBUTE.getDT(sw);//列表 DataTable dt55 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "55" }); //数据中心族群 DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 WILD_BOTANYDISTRIBUTE_Model m = new WILD_BOTANYDISTRIBUTE_Model(); if (dt.Rows.Count > 0) { int i = 0; m.WILD_BOTANYDISTRIBUTEID = dt.Rows[i]["WILD_BOTANYDISTRIBUTEID"].ToString(); m.BIOLOGICALTYPECODE = dt.Rows[i]["BIOLOGICALTYPECODE"].ToString(); m.BIOLOGICALTYPEName = T_SYS_BIOLOGICALTYPECls.getName(m.BIOLOGICALTYPECODE); m.POPULATIONTYPE = dt.Rows[i]["POPULATIONTYPE"].ToString(); m.POPULATIONTYPEName = BaseDT.T_SYS_DICT.getName(dt55, m.POPULATIONTYPE); m.WD = dt.Rows[i]["WD"].ToString(); m.JD = dt.Rows[i]["JD"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.BOTANYCOUNT = dt.Rows[i]["BOTANYCOUNT"].ToString(); m.BOTANYAREA = dt.Rows[i]["BOTANYAREA"].ToString(); m.BYORGNOName = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); m.MARK = dt.Rows[i]["MARK"].ToString(); } dt.Clear(); dt.Dispose(); dt55.Clear(); dt55.Dispose(); dtORG.Dispose(); dtORG.Dispose(); return(m); }
/// <summary> /// 获取分页 /// </summary> /// <param name="sw">参见模型</param> /// <param name="total">记录总数</param> /// <returns>参见模型</returns> public static IEnumerable <DC_UTILITY_RELAY_Model> getModelList(DC_UTILITY_RELAY_SW sw, out int total) { var result = new List <DC_UTILITY_RELAY_Model>(); DataTable dt = BaseDT.DC_UTILITY_RELAY.getDT(sw, out total);//列表 DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 DataTable dt36 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "36" }); //使用现状 DataTable dt37 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "37" }); //维护类型 DataTable dt41 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "41" }); //通讯方式 for (int i = 0; i < dt.Rows.Count; i++) { DC_UTILITY_RELAY_Model m = new DC_UTILITY_RELAY_Model(); m.DC_UTILITY_RELAY_ID = dt.Rows[i]["DC_UTILITY_RELAY_ID"].ToString(); m.NUMBER = dt.Rows[i]["NUMBER"].ToString(); m.NAME = dt.Rows[i]["NAME"].ToString(); m.ADDRESS = dt.Rows[i]["ADDRESS"].ToString(); m.MODEL = dt.Rows[i]["MODEL"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.COMMUNICATIONWAY = dt.Rows[i]["COMMUNICATIONWAY"].ToString(); m.COMMUNICATIONWAYName = BaseDT.T_SYS_DICT.getName(dt41, m.COMMUNICATIONWAY); m.BUILDDATE = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["BUILDDATE"].ToString()); m.BUILDDATEBEGIN = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["BUILDDATEBEGIN"].ToString()); m.BUILDDATEEND = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["BUILDDATEEND"].ToString()); m.USESTATE = dt.Rows[i]["USESTATE"].ToString(); m.USESTATEName = BaseDT.T_SYS_DICT.getName(dt36, m.USESTATE); m.MANAGERSTATE = dt.Rows[i]["MANAGERSTATE"].ToString(); m.MANAGERSTATEName = BaseDT.T_SYS_DICT.getName(dt37, m.MANAGERSTATE); m.MARK = dt.Rows[i]["MARK"].ToString(); m.JD = dt.Rows[i]["JD"].ToString(); m.WD = dt.Rows[i]["WD"].ToString(); m.WORTH = dt.Rows[i]["WORTH"].ToString(); if (m.BYORGNO.Substring(6, 3) != "000" && m.BYORGNO.Substring(9, 6) == "000000") { m.ORGName = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); } m.ORGXSName = BaseDT.T_SYS_ORG.getSXName(dtORG, m.BYORGNO); result.Add(m); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); dt36.Clear(); dt36.Dispose(); dt37.Clear(); dt37.Dispose(); dt41.Clear(); dt41.Dispose(); return(result); }
/// <summary> /// 获取分页 /// </summary> /// <param name="sw">参见模型</param> /// <param name="total">记录总数</param> /// <returns>参见模型</returns> public static IEnumerable <ART_DOCUMENT_Model> getModelList(ART_DOCUMENT_SW sw, out int total) { var result = new List <ART_DOCUMENT_Model>(); DataTable dt = BaseDT.ART_DOCUMENT.getDT(sw, out total);//列表 DataTable dtUser = BaseDT.T_SYSSEC_USER.getDT(new T_SYSSEC_IPSUSER_SW { }); DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 string typeid = ""; if (sw.ARTBigTYPEID == "013") { typeid = "47"; } if (sw.ARTBigTYPEID == "014") { typeid = "48"; } if (sw.ARTBigTYPEID == "015") { typeid = "49"; } DataTable dtType = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = typeid }); for (int i = 0; i < dt.Rows.Count; i++) { ART_DOCUMENT_Model m = new ART_DOCUMENT_Model(); m.ARTID = dt.Rows[i]["ARTID"].ToString(); m.ARTTYPEID = dt.Rows[i]["ARTTYPEID"].ToString(); m.ARTTITLE = dt.Rows[i]["ARTTITLE"].ToString(); m.ARTTAG = dt.Rows[i]["ARTTAG"].ToString(); m.ARTTIME = PublicClassLibrary.ClsSwitch.SwitTM(dt.Rows[i]["ARTTIME"].ToString()); m.ARTCHECKSTATUS = dt.Rows[i]["ARTCHECKSTATUS"].ToString(); m.ARTADDUSERID = dt.Rows[i]["ARTADDUSERID"].ToString(); m.ARTCHECKTIME = PublicClassLibrary.ClsSwitch.SwitTM(dt.Rows[i]["ARTCHECKTIME"].ToString()); m.ARTCHECKUSERID = dt.Rows[i]["ARTCHECKUSERID"].ToString(); m.PLANFILENAME = dt.Rows[i]["PLANFILENAME"].ToString(); m.ARTTYPENAME = BaseDT.T_SYS_DICT.getName(dtType, m.ARTTYPEID);// BaseDT.ART_TYPE.getName(dtType, dt.Rows[i]["ARTTYPEID"].ToString()); m.ARTADDUSERName = BaseDT.T_SYSSEC_USER.getNameByUserList(dtUser, m.ARTADDUSERID); m.ARTCHECKUSERIDName = BaseDT.T_SYSSEC_USER.getNameByUserList(dtUser, m.ARTCHECKUSERID); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.orgName = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); result.Add(m); //ARTID, ARTTYPEID, ARTTITLE, ARTTAG, ARTTIME, ARTCHECKSTATUS, ARTADDUSERID,ARTCHECKTIME, ARTCHECKUSERID } dtORG.Clear(); dtORG.Dispose(); dtType.Clear(); dtType.Dispose(); dt.Clear(); dt.Dispose(); dtUser.Clear(); dtUser.Dispose(); return(result); }
/// <summary> /// 护林员统计 /// </summary> /// <returns>参见HUReport_HUCount_Model</returns> public static IEnumerable <HUReport_HUCount_Model> getHUCountModel(T_IPSFR_USER_SW sw) { var result = new List <HUReport_HUCount_Model>(); T_SYS_ORGSW swOrg = new T_SYS_ORGSW(); swOrg.SYSFLAG = ConfigCls.getSystemFlag(); swOrg.TopORGNO = sw.TopORGNO; if (PublicCls.OrgIsShi(sw.TopORGNO)) { swOrg.GetContyORGNOByCity = sw.TopORGNO;//获取所有县 } if (PublicCls.OrgIsXian(sw.TopORGNO)) { swOrg.GetXZOrgNOByConty = sw.TopORGNO;//获取所有镇 } DataTable dtOrg = BaseDT.T_SYS_ORG.getDT(swOrg); //DataTable dtOrg = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); DataTable dtHU = BaseDT.T_IPSFR_USER.getDT(new T_IPSFR_USER_SW { ISENABLE = "1" }); DataRow[] drOrg = dtOrg.Select("", "ORGNO");//取所有 if (1 == 1) { HUReport_HUCount_Model m = new HUReport_HUCount_Model(); m.ORGName = BaseDT.T_SYS_ORG.getName(sw.TopORGNO) + "合计"; m.ORGNo = ""; m.HUCount = getHUCountBySex(dtHU, sw.TopORGNO, ""); m.Sex0Count = getHUCountBySex(dtHU, sw.TopORGNO, "1"); m.Sex1Count = getHUCountBySex(dtHU, sw.TopORGNO, "0"); m.Onstate0Count = getHUCountByOnstate(dtHU, sw.TopORGNO, "1"); m.Onstate1Count = getHUCountByOnstate(dtHU, sw.TopORGNO, "2"); result.Add(m); } for (int i = 0; i < drOrg.Length; i++) { HUReport_HUCount_Model m = new HUReport_HUCount_Model(); string orgName = drOrg[i]["ORGNAME"].ToString(); m.ORGName = orgName; m.ORGNo = drOrg[i]["ORGNO"].ToString(); m.HUCount = getHUCountBySex(dtHU, drOrg[i]["ORGNO"].ToString(), ""); m.Sex0Count = getHUCountBySex(dtHU, drOrg[i]["ORGNO"].ToString(), "1"); m.Sex1Count = getHUCountBySex(dtHU, drOrg[i]["ORGNO"].ToString(), "0"); m.Onstate0Count = getHUCountByOnstate(dtHU, drOrg[i]["ORGNO"].ToString(), "1"); m.Onstate1Count = getHUCountByOnstate(dtHU, drOrg[i]["ORGNO"].ToString(), "2"); result.Add(m); } dtHU.Clear(); dtHU.Dispose(); dtOrg.Clear(); dtOrg.Dispose(); return(result); }
/// <summary> /// 根据查询条件获取某一条用户信息记录,用于修改、删除、用户登录验证 /// </summary> /// <param name="sw">参见模型</param> /// <returns>参见模型</returns> public static DC_UTILITY_MONITORINGSTATION_Model getModel(DC_UTILITY_MONITORINGSTATION_SW sw) { var result = new List <DC_UTILITY_MONITORINGSTATION_Model>(); DataTable dt = BaseDT.DC_UTILITY_MONITORINGSTATION.getDT(sw);//列表 DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 DataTable dt36 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "36" }); //使用现状 DataTable dt37 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "37" }); //维护类型 DataTable dt42 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "42" }); //无线电传输方式 DC_UTILITY_MONITORINGSTATION_Model m = new DC_UTILITY_MONITORINGSTATION_Model(); if (dt.Rows.Count > 0) { int i = 0; m.DC_UTILITY_MONITORINGSTATION_ID = dt.Rows[i]["DC_UTILITY_MONITORINGSTATION_ID"].ToString(); m.NUMBER = dt.Rows[i]["NUMBER"].ToString(); m.NAME = dt.Rows[i]["NAME"].ToString(); m.ADDRESS = dt.Rows[i]["ADDRESS"].ToString(); m.MODEL = dt.Rows[i]["MODEL"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); m.TRANSFERMODETYPE = dt.Rows[i]["TRANSFERMODETYPE"].ToString(); m.TRANSFERMODETYPEName = BaseDT.T_SYS_DICT.getName(dt42, m.TRANSFERMODETYPE); m.MONICONTENT = dt.Rows[i]["MONICONTENT"].ToString(); m.BUILDDATE = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["BUILDDATE"].ToString()); m.BUILDDATEBEGIN = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["BUILDDATEBEGIN"].ToString()); m.BUILDDATEEND = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["BUILDDATEEND"].ToString()); m.USESTATE = dt.Rows[i]["USESTATE"].ToString(); m.USESTATEName = BaseDT.T_SYS_DICT.getName(dt36, m.USESTATE); m.MANAGERSTATE = dt.Rows[i]["MANAGERSTATE"].ToString(); m.MANAGERSTATEName = BaseDT.T_SYS_DICT.getName(dt37, m.MANAGERSTATE); m.MARK = dt.Rows[i]["MARK"].ToString(); m.JD = dt.Rows[i]["JD"].ToString(); m.WD = dt.Rows[i]["WD"].ToString(); m.WORTH = dt.Rows[i]["WORTH"].ToString(); m.ORGName = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); dt36.Clear(); dt36.Dispose(); dt37.Clear(); dt37.Dispose(); dt42.Clear(); dt42.Dispose(); return(m); }
/// <summary> /// 获取电量 /// </summary> /// <example> /// sw.SearchTime 查询日期,查询某日的电量信息 /// sw.USERID 护林员序号(多序号以逗号分隔) /// sw.DateBegin 开始日期 /// sw.DateEnd 结束日期 /// </example> /// <param name="sw">参见条件模型T_IPS_REALDATASW</param> /// <returns>参见模型T_IPS_REALDATAModel</returns> public static IEnumerable <T_IPS_REALDATAModel> getElectricModelList(T_IPS_REALDATASW sw) { var result = new List <T_IPS_REALDATAModel>(); //获取当前登录用户有权限查看的组织机构 DataTable dtOrg = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取所有有权限查看的护林员 DataTable dtFRUser = BaseDT.T_IPSFR_USER.getDT(new T_IPSFR_USER_SW { ISENABLE = "1", HID = sw.HID }); DataTable dt = BaseDT.T_IPS_REALDATA.getDT(sw); DataRow[] dr = dt.Select("", "SBTIME desc"); for (int i = 0; i < dr.Length; i++) { if (string.IsNullOrEmpty(dr[i]["ELECTRIC"].ToString()) == false) { T_IPS_REALDATAModel m = new T_IPS_REALDATAModel(); m.REALDATAID = dr[i]["REALDATAID"].ToString(); m.PHONE = dr[i]["PHONE"].ToString();//电话号码 m.LONGITUDE = dr[i]["LONGITUDE"].ToString(); m.LATITUDE = dr[i]["LATITUDE"].ToString(); m.HEIGHT = dr[i]["HEIGHT"].ToString(); m.ELECTRIC = dr[i]["ELECTRIC"].ToString(); m.SPEED = dr[i]["SPEED"].ToString(); m.DIRECTION = dr[i]["DIRECTION"].ToString(); m.SBTIME = dr[i]["SBTIME"].ToString(); if (string.IsNullOrEmpty(m.SBTIME) == false) { m.SBTIME = PublicClassLibrary.ClsSwitch.SwitTM(m.SBTIME); } m.NOTE = dr[i]["NOTE"].ToString(); DataRow[] drFRUser = dtFRUser.Select("PHONE='" + m.PHONE + "'"); if (drFRUser.Length > 0) { m.HID = drFRUser[0]["HID"].ToString(); //护林员编号 m.HNAME = drFRUser[0]["HNAME"].ToString(); //护林员名称 m.ORGNO = drFRUser[0]["BYORGNO"].ToString(); //组织机构编码 m.ORGNAME = BaseDT.T_SYS_ORG.getName(dtOrg, m.ORGNO); //组织机构名称 } result.Add(m); } } dtOrg.Clear(); dtOrg.Dispose(); dtFRUser.Clear(); dtFRUser.Dispose(); dt.Clear(); dt.Dispose(); return(result); }
/// <summary> /// 获取所有权限及对应角色是否具有该权限 /// </summary> /// <param name="sw">参见模型</param> /// <returns>参见模型</returns> public static IEnumerable <T_SYSSEC_RIGHT_ByRole_Model> getRightByRoleModel(T_SYSSEC_ROLE_RIGHT_SW sw) { DataTable dtRight = BaseDT.T_SYSSEC_RIGHT.getDT(new T_SYSSEC_RIGHT_SW { SYSFLAG = ConfigCls.getSystemFlag() }); DataTable dtRoleRight = BaseDT.T_SYSSEC_ROLE_RIGHT.getDT(new T_SYSSEC_ROLE_RIGHT_SW { ROLEID = sw.ROLEID }); return(getRightByRoleTmpModel(dtRight, dtRoleRight, "")); }
/// <summary> /// 获取分页 /// </summary> /// <param name="sw">参见模型</param> /// <param name="total">记录总数</param> /// <returns>参见模型</returns> public static IEnumerable <DC_CAR_Model> getModelList(DC_CAR_SW sw, out int total) { var result = new List <DC_CAR_Model>(); DataTable dt = BaseDT.DC_CAR.getDT(sw, out total);//列表 DataTable dtORG = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW { SYSFLAG = ConfigCls.getSystemFlag() }); //获取单位 DataTable dt33 = BaseDT.T_SYS_DICT.getDT(new T_SYS_DICTSW { DICTTYPEID = "33" }); //数据中心车辆类型 for (int i = 0; i < dt.Rows.Count; i++) { DC_CAR_Model m = new DC_CAR_Model(); m.DC_CAR_ID = dt.Rows[i]["DC_CAR_ID"].ToString(); m.CARTYPE = dt.Rows[i]["CARTYPE"].ToString(); m.CARTYPEName = BaseDT.T_SYS_DICT.getName(dt33, m.CARTYPE); m.NUMBER = dt.Rows[i]["NUMBER"].ToString(); m.NAME = dt.Rows[i]["NAME"].ToString(); m.BYORGNO = dt.Rows[i]["BYORGNO"].ToString(); //m.BUYYEAR =dt.Rows[i]["BUYYEAR"].ToString(); m.BUYPRICE = dt.Rows[i]["BUYPRICE"].ToString(); m.PLATENUM = dt.Rows[i]["PLATENUM"].ToString(); m.DRIVER = dt.Rows[i]["DRIVER"].ToString(); m.CONTACTS = dt.Rows[i]["CONTACTS"].ToString(); m.GPSEQUIP = dt.Rows[i]["GPSEQUIP"].ToString(); m.GPSTELL = dt.Rows[i]["GPSTELL"].ToString(); m.STOREADDR = dt.Rows[i]["STOREADDR"].ToString(); m.MARK = dt.Rows[i]["MARK"].ToString(); m.JD = dt.Rows[i]["JD"].ToString(); m.WD = dt.Rows[i]["WD"].ToString(); m.BUYYEAR = PublicClassLibrary.ClsSwitch.SwitDate(dt.Rows[i]["BUYYEAR"].ToString()); if (m.BYORGNO.Substring(6, 3) != "000") { m.ORGName = BaseDT.T_SYS_ORG.getName(dtORG, m.BYORGNO); } m.ORGXSName = BaseDT.T_SYS_ORG.getSXName(dtORG, m.BYORGNO); result.Add(m); } dt.Clear(); dt.Dispose(); dtORG.Clear(); dtORG.Dispose(); dt33.Clear(); dt33.Dispose(); return(result); }