/// <summary> /// 获得数据列表 /// </summary> public List <HM.Model.Qm.Tb_Qm_TaskFiles> DataTableToList(DataTable dt) { List <HM.Model.Qm.Tb_Qm_TaskFiles> modelList = new List <HM.Model.Qm.Tb_Qm_TaskFiles>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { HM.Model.Qm.Tb_Qm_TaskFiles model; for (int n = 0; n < rowsCount; n++) { model = new HM.Model.Qm.Tb_Qm_TaskFiles(); model.Id = dt.Rows[n]["Id"].ToString(); model.TaskId = dt.Rows[n]["TaskId"].ToString(); model.FileName = dt.Rows[n]["FileName"].ToString(); model.Fix = dt.Rows[n]["Fix"].ToString(); if (dt.Rows[n]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString()); } model.FilePath = dt.Rows[n]["FilePath"].ToString(); model.PhoneName = dt.Rows[n]["PhoneName"].ToString(); if (dt.Rows[n]["PhotoTime"].ToString() != "") { model.PhotoTime = DateTime.Parse(dt.Rows[n]["PhotoTime"].ToString()); } model.PhotoPId = dt.Rows[n]["PhotoPId"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(HM.Model.Qm.Tb_Qm_TaskFiles model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(HM.Model.Qm.Tb_Qm_TaskFiles model) { dal.Add(model); }