/// <summary> /// 获得数据列表 /// </summary> public List <HM.Model.Eq.Tb_EQ_Task> DataTableToList(DataTable dt) { List <HM.Model.Eq.Tb_EQ_Task> modelList = new List <HM.Model.Eq.Tb_EQ_Task>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { HM.Model.Eq.Tb_EQ_Task model; for (int n = 0; n < rowsCount; n++) { model = new HM.Model.Eq.Tb_EQ_Task(); model.TaskId = dt.Rows[n]["TaskId"].ToString(); if (dt.Rows[n]["CommId"].ToString() != "") { model.CommId = int.Parse(dt.Rows[n]["CommId"].ToString()); } model.PlanId = dt.Rows[n]["PlanId"].ToString(); model.TaskNO = dt.Rows[n]["TaskNO"].ToString(); model.EqId = dt.Rows[n]["EqId"].ToString(); model.SpaceId = dt.Rows[n]["SpaceId"].ToString(); model.Content = dt.Rows[n]["Content"].ToString(); if (dt.Rows[n]["BeginTime"].ToString() != "") { model.BeginTime = DateTime.Parse(dt.Rows[n]["BeginTime"].ToString()); } if (dt.Rows[n]["EndTime"].ToString() != "") { model.EndTime = DateTime.Parse(dt.Rows[n]["EndTime"].ToString()); } model.WorkDayBegin = dt.Rows[n]["WorkDayBegin"].ToString(); model.RoleCode = dt.Rows[n]["RoleCode"].ToString(); model.Statue = dt.Rows[n]["Statue"].ToString(); model.ClosePerson = dt.Rows[n]["ClosePerson"].ToString(); if (dt.Rows[n]["CloseTime"].ToString() != "") { model.CloseTime = DateTime.Parse(dt.Rows[n]["CloseTime"].ToString()); } model.CloseReason = dt.Rows[n]["CloseReason"].ToString(); model.PollingPerson = dt.Rows[n]["PollingPerson"].ToString(); if (dt.Rows[n]["PollingDate"].ToString() != "") { model.PollingDate = DateTime.Parse(dt.Rows[n]["PollingDate"].ToString()); } model.Remark = dt.Rows[n]["Remark"].ToString(); if (dt.Rows[n]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString()); } model.AddPId = dt.Rows[n]["AddPId"].ToString(); if (dt.Rows[n]["AddDate"].ToString() != "") { model.AddDate = DateTime.Parse(dt.Rows[n]["AddDate"].ToString()); } model.PerfNum = dt.Rows[n]["PerfNum"].ToString(); model.WorkTime = dt.Rows[n]["WorkTime"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(HM.Model.Eq.Tb_EQ_Task model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(HM.Model.Eq.Tb_EQ_Task model) { dal.Add(model); }