/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.DepartmentJobs> DataTableToList(DataTable dt) { List <Hownet.Model.DepartmentJobs> modelList = new List <Hownet.Model.DepartmentJobs>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.DepartmentJobs model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.DepartmentJobs(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } else { model.ID = 0; } model.JobsName = dt.Rows[n]["JobsName"].ToString(); if (dt.Rows[n]["DepartmentID"].ToString() != "") { model.DepartmentID = int.Parse(dt.Rows[n]["DepartmentID"].ToString()); } else { model.DepartmentID = 0; } model.Remark = dt.Rows[n]["Remark"].ToString(); if (dt.Rows[n]["EmployeeCount"].ToString() != "") { model.EmployeeCount = int.Parse(dt.Rows[n]["EmployeeCount"].ToString()); } else { model.EmployeeCount = 0; } if (dt.Rows[n]["IsEnd"].ToString() != "") { model.IsEnd = int.Parse(dt.Rows[n]["IsEnd"].ToString()); } else { model.IsEnd = 0; } model.A = int.Parse(dt.Rows[n]["A"].ToString()); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Hownet.Model.DepartmentJobs model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.DepartmentJobs model) { return(dal.Add(model)); }