/// <summary> /// 获得数据列表 /// </summary> public List <TSM.Model.pms_OutAssistance_WorkPlan> DataTableToList(DataTable dt) { List <TSM.Model.pms_OutAssistance_WorkPlan> modelList = new List <TSM.Model.pms_OutAssistance_WorkPlan>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { TSM.Model.pms_OutAssistance_WorkPlan model; for (int n = 0; n < rowsCount; n++) { model = new TSM.Model.pms_OutAssistance_WorkPlan(); if (dt.Rows[n]["WorkPlanID"].ToString() != "") { model.WorkPlanID = int.Parse(dt.Rows[n]["WorkPlanID"].ToString()); } model.PlanMonth = dt.Rows[n]["PlanMonth"].ToString(); if (dt.Rows[n]["WorkTypeID"].ToString() != "") { model.WorkTypeID = int.Parse(dt.Rows[n]["WorkTypeID"].ToString()); } if (dt.Rows[n]["WorkContentID"].ToString() != "") { model.WorkContentID = int.Parse(dt.Rows[n]["WorkContentID"].ToString()); } model.WorkPlan = dt.Rows[n]["WorkPlan"].ToString(); if (dt.Rows[n]["PlanTime"].ToString() != "") { model.PlanTime = DateTime.Parse(dt.Rows[n]["PlanTime"].ToString()); } if (dt.Rows[n]["PlannerID"].ToString() != "") { model.PlannerID = int.Parse(dt.Rows[n]["PlannerID"].ToString()); } model.Report = dt.Rows[n]["Report"].ToString(); if (dt.Rows[n]["ReportTime"].ToString() != "") { model.ReportTime = DateTime.Parse(dt.Rows[n]["ReportTime"].ToString()); } if (dt.Rows[n]["ReporterID"].ToString() != "") { model.ReporterID = int.Parse(dt.Rows[n]["ReporterID"].ToString()); } model.Completion = dt.Rows[n]["Completion"].ToString(); model.Result = dt.Rows[n]["Result"].ToString(); if (dt.Rows[n]["WorkHour"].ToString() != "") { model.WorkHour = int.Parse(dt.Rows[n]["WorkHour"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(TSM.Model.pms_OutAssistance_WorkPlan model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(TSM.Model.pms_OutAssistance_WorkPlan model) { return(dal.Add(model)); }