/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.DayWorking model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Hownet.Model.DayWorking model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.DayWorking> DataTableToList(DataTable dt) { List <Hownet.Model.DayWorking> modelList = new List <Hownet.Model.DayWorking>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.DayWorking model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.DayWorking(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } else { model.ID = 0; } if (dt.Rows[n]["DateTime"].ToString() != "") { model.DateTime = DateTime.Parse(dt.Rows[n]["DateTime"].ToString()); } else { model.DateTime = DateTime.Parse("1900-1-1"); } if (dt.Rows[n]["FillMan"].ToString() != "") { model.FillMan = int.Parse(dt.Rows[n]["FillMan"].ToString()); } else { model.FillMan = 0; } if (dt.Rows[n]["VerifyMan"].ToString() != "") { model.VerifyMan = int.Parse(dt.Rows[n]["VerifyMan"].ToString()); } else { model.VerifyMan = 0; } if (dt.Rows[n]["VerifyDate"].ToString() != "") { model.VerifyDate = DateTime.Parse(dt.Rows[n]["VerifyDate"].ToString()); } else { model.VerifyDate = DateTime.Parse("1900-1-1"); } if (dt.Rows[n]["UpData"].ToString() != "") { model.UpData = int.Parse(dt.Rows[n]["UpData"].ToString()); } else { model.UpData = 0; } if (dt.Rows[n]["Num"].ToString() != "") { model.Num = int.Parse(dt.Rows[n]["Num"].ToString()); } else { model.Num = 0; } model.Remark = dt.Rows[n]["Remark"].ToString(); if (dt.Rows[n]["FillDate"].ToString() != "") { model.FillDate = DateTime.Parse(dt.Rows[n]["FillDate"].ToString()); } else { model.FillDate = DateTime.Parse("1900-1-1"); } if (dt.Rows[n]["EmployeeID"].ToString() != "") { model.EmployeeID = int.Parse(dt.Rows[n]["EmployeeID"].ToString()); } else { model.EmployeeID = 0; } if (dt.Rows[n]["IsEnd"].ToString() != "") { model.IsEnd = int.Parse(dt.Rows[n]["IsEnd"].ToString()); } else { model.IsEnd = 0; } if (dt.Rows[n]["IsVerify"].ToString() != "") { model.IsVerify = int.Parse(dt.Rows[n]["IsVerify"].ToString()); } else { model.IsVerify = 0; } model.A = int.Parse(dt.Rows[n]["A"].ToString()); modelList.Add(model); } } return(modelList); }