/// <summary> /// 返回list对象 /// </summary> /// <param name="dt"></param> /// <returns></returns> public static List <lsDatJianXiuPlan> ListValue(DataTable dt) { List <lsDatJianXiuPlan> jxplanList = new List <lsDatJianXiuPlan>(); lsDatJianXiuPlan jxplan; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { jxplan = new lsDatJianXiuPlan(); jxplanList.Add(SetValue(jxplan, dt.Rows[i])); } } return(jxplanList); }
public static lsDatJianXiuPlan SetValue(lsDatJianXiuPlan jxplan, DataRow dr) { if (dr != null) { jxplan.CheXing = dr["CheXing"].ToString(); jxplan.CheXingDaiHao = dr["CheXingDaiHao"].ToString(); jxplan.CheHao = dr["CheHao"].ToString(); jxplan.XiuCheng = dr["XiuCheng"].ToString(); jxplan.XiuChengDaiHao = dr["XiuChengDaiHao"].ToString(); jxplan.JiHuaCheJian = dr["JiHuaCheJian"].ToString(); jxplan.ShiJiCheJian = dr["ShiJiCheJian"].ToString(); jxplan.ShuDi = dr["ShuDi"].ToString(); jxplan.ZhiDingRenID = dr["ZhiDingRenID"].ToString(); jxplan.ZhiDingRenName = dr["ZhiDingRenName"].ToString(); jxplan.KaiGongRenID = dr["KaiGongRenID"].ToString(); jxplan.KaiGongRenName = dr["KaiGongRenName"].ToString(); jxplan.QuXiaoRenID = dr["QuXiaoRenID"].ToString(); jxplan.QuXiaoRenName = dr["QuXiaoRenName"].ToString(); jxplan.QuXiaoYuanYin = dr["QuXiaoYuanYin"].ToString(); jxplan.JiaoCheRenID = dr["JiaoCheRenID"].ToString(); jxplan.JiaoCheRenName = dr["JiaoCheRenName"].ToString(); jxplan.PositionCreateName = dr["PositionCreateName"].ToString(); jxplan.BeiZhu = dr["BeiZhu"].ToString(); jxplan.RepairCycle = dr["RepairCycle"].ToString(); jxplan.ID = PageBase.static_ext_int(dr["ID"].ToString()); jxplan.PositionId = PageBase.static_ext_int(dr["PositionId"].ToString()); jxplan.PositionCreateId = PageBase.static_ext_int(dr["PositionCreateId"].ToString()); jxplan.ZhuangTai = PageBase.static_ext_int(dr["ZhuangTai"].ToString()); jxplan.JiHuaDate = PageBase.static_ext_date(dr["JiHuaDate"].ToString()); jxplan.ShiJiDate = PageBase.static_ext_date(dr["ShiJiDate"].ToString()); jxplan.ZhiDingDate = PageBase.static_ext_date(dr["ZhiDingDate"].ToString()); jxplan.KaiGongDate = PageBase.static_ext_date(dr["KaiGongDate"].ToString()); jxplan.QuXiaoDate = PageBase.static_ext_date(dr["QuXiaoDate"].ToString()); jxplan.JiaoCheDate = PageBase.static_ext_date(dr["JiaoCheDate"].ToString()); jxplan.PositionCreateDate = PageBase.static_ext_date(dr["PositionCreateDate"].ToString()); } return(jxplan); }