/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.AttendanceSum model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Hownet.Model.AttendanceSum model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.AttendanceSum> DataTableToList(DataTable dt) { List <Hownet.Model.AttendanceSum> modelList = new List <Hownet.Model.AttendanceSum>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.AttendanceSum model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.AttendanceSum(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } else { model.ID = 0; } if (dt.Rows[n]["EmployeeID"].ToString() != "") { model.EmployeeID = int.Parse(dt.Rows[n]["EmployeeID"].ToString()); } else { model.EmployeeID = 0; } if (dt.Rows[n]["MainID"].ToString() != "") { model.MainID = int.Parse(dt.Rows[n]["MainID"].ToString()); } else { model.MainID = 0; } if (dt.Rows[n]["DayWorkMin"].ToString() != "") { model.DayWorkMin = int.Parse(dt.Rows[n]["DayWorkMin"].ToString()); } else { model.DayWorkMin = 0; } if (dt.Rows[n]["DayWorkTime"].ToString() != "") { model.DayWorkTime = DateTime.Parse(dt.Rows[n]["DayWorkTime"].ToString()); } else { model.DayWorkTime = DateTime.Parse("1900-1-1"); } if (dt.Rows[n]["BelateMin"].ToString() != "") { model.BelateMin = int.Parse(dt.Rows[n]["BelateMin"].ToString()); } else { model.BelateMin = 0; } if (dt.Rows[n]["LeaveEarlyMin"].ToString() != "") { model.LeaveEarlyMin = int.Parse(dt.Rows[n]["LeaveEarlyMin"].ToString()); } else { model.LeaveEarlyMin = 0; } if (dt.Rows[n]["AbsenteeismMin"].ToString() != "") { model.AbsenteeismMin = int.Parse(dt.Rows[n]["AbsenteeismMin"].ToString()); } else { model.AbsenteeismMin = 0; } if (dt.Rows[n]["Money"].ToString() != "") { model.Money = decimal.Parse(dt.Rows[n]["Money"].ToString()); } else { model.Money = 0; } if (dt.Rows[n]["OvertimeMin"].ToString() != "") { model.OvertimeMin = int.Parse(dt.Rows[n]["OvertimeMin"].ToString()); } else { model.OvertimeMin = 0; } if (dt.Rows[n]["OvertimeTime"].ToString() != "") { model.OvertimeTime = DateTime.Parse(dt.Rows[n]["OvertimeTime"].ToString()); } else { model.OvertimeTime = DateTime.Parse("1900-1-1"); } model.A = int.Parse(dt.Rows[n]["A"].ToString()); modelList.Add(model); } } return(modelList); }