/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.Sys.Tb_Sys_Department> DataTableToList(DataTable dt) { List <MobileSoft.Model.Sys.Tb_Sys_Department> modelList = new List <MobileSoft.Model.Sys.Tb_Sys_Department>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.Sys.Tb_Sys_Department model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.Sys.Tb_Sys_Department(); model.DepCode = dt.Rows[n]["DepCode"].ToString(); model.DepName = dt.Rows[n]["DepName"].ToString(); model.Principal = dt.Rows[n]["Principal"].ToString(); model.Memo = dt.Rows[n]["Memo"].ToString(); if (dt.Rows[n]["CommID"].ToString() != "") { model.CommID = int.Parse(dt.Rows[n]["CommID"].ToString()); } if (dt.Rows[n]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString()); } if (dt.Rows[n]["Sort"].ToString() != "") { model.Sort = int.Parse(dt.Rows[n]["Sort"].ToString()); } if (dt.Rows[n]["IsHide"].ToString() != "") { model.IsHide = int.Parse(dt.Rows[n]["IsHide"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.Sys.Tb_Sys_Department model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(MobileSoft.Model.Sys.Tb_Sys_Department model) { dal.Add(model); }