/// <summary> /// 获取一条记录 /// </summary> /// <param name="sw">参见条件模型T_IPSFR_ROUTERAIL_SW</param> /// <returns>参见模型T_IPSFR_ROUTERAIL_Model</returns> public static T_IPSFR_ROUTERAIL_Model getModel(T_IPSFR_ROUTERAIL_SW sw) { DataTable dt = BaseDT.T_IPSFR_ROUTERAIL.getDT(sw);//列表 T_IPSFR_ROUTERAIL_Model m = new T_IPSFR_ROUTERAIL_Model(); int i = 0; m.ROADID = dt.Rows[i]["ROADID"].ToString(); m.HID = dt.Rows[i]["HID"].ToString(); m.LONGITUDE = dt.Rows[i]["LONGITUDE"].ToString(); m.LATITUDE = dt.Rows[i]["LATITUDE"].ToString(); m.HEIGHT = dt.Rows[i]["HEIGHT"].ToString(); m.ORDERBY = dt.Rows[i]["ORDERBY"].ToString(); m.ROADTYPE = dt.Rows[i]["ROADTYPE"].ToString(); DataTable dtHRUser = BaseDT.T_IPSFR_USER.getDT(new T_IPSFR_USER_SW { HID = m.HID }); if (dtHRUser.Rows.Count > 0) { m.HName = dtHRUser.Rows[0]["HNAME"].ToString(); m.Phone = dtHRUser.Rows[0]["PHONE"].ToString(); } dtHRUser.Clear(); dtHRUser.Dispose(); dt.Clear(); dt.Dispose(); return(m); }
/// <summary> /// 获取数据列表 /// </summary> /// <param name="sw">参见条件模型T_IPSFR_ROUTERAIL_SW</param> /// <returns>参见模型</returns> public static IEnumerable <T_IPSFR_ROUTERAIL_Model> getModelList(T_IPSFR_ROUTERAIL_SW sw) { DataTable dt = BaseDT.T_IPSFR_ROUTERAIL.getDT(sw);//列表 var result = new List <T_IPSFR_ROUTERAIL_Model>(); for (int i = 0; i < dt.Rows.Count; i++) { T_IPSFR_ROUTERAIL_Model m = new T_IPSFR_ROUTERAIL_Model(); m.ROADID = dt.Rows[i]["ROADID"].ToString(); m.HID = dt.Rows[i]["HID"].ToString(); m.LONGITUDE = dt.Rows[i]["LONGITUDE"].ToString(); m.LATITUDE = dt.Rows[i]["LATITUDE"].ToString(); m.HEIGHT = dt.Rows[i]["HEIGHT"].ToString(); m.ORDERBY = dt.Rows[i]["ORDERBY"].ToString(); m.ROADTYPE = dt.Rows[i]["ROADTYPE"].ToString(); m.LINEARAEID = dt.Rows[i]["LINEARAEID"].ToString(); result.Add(m); } dt.Clear(); dt.Dispose(); return(result); }
/// <summary> /// 获取护林员的巡检路线路 /// </summary> /// <param name="sw">参见模型</param> /// <returns></returns> public static int GetRouteCount(T_IPSFR_ROUTERAIL_SW sw) { return(BaseDT.T_IPSFR_ROUTERAIL.GetRouteCount(sw)); }