/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.Management.Tb_Management_Service> DataTableToList(DataTable dt) { List <MobileSoft.Model.Management.Tb_Management_Service> modelList = new List <MobileSoft.Model.Management.Tb_Management_Service>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.Management.Tb_Management_Service model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.Management.Tb_Management_Service(); model.ServiceCode = dt.Rows[n]["ServiceCode"].ToString(); model.OrganCode = dt.Rows[n]["OrganCode"].ToString(); model.CommID = dt.Rows[n]["CommID"].ToString(); if (dt.Rows[n]["Sort"].ToString() != "") { model.Sort = int.Parse(dt.Rows[n]["Sort"].ToString()); } model.TypeCode = dt.Rows[n]["TypeCode"].ToString(); model.ServiceName = dt.Rows[n]["ServiceName"].ToString(); model.Adv = dt.Rows[n]["Adv"].ToString(); model.Intro = dt.Rows[n]["Intro"].ToString(); if (dt.Rows[n]["ServiceStartDate"].ToString() != "") { model.ServiceStartDate = DateTime.Parse(dt.Rows[n]["ServiceStartDate"].ToString()); } if (dt.Rows[n]["ServiceEndDate"].ToString() != "") { model.ServiceEndDate = DateTime.Parse(dt.Rows[n]["ServiceEndDate"].ToString()); } //model.CorpStanID=dt.Rows[n]["CorpStanID"].ToString(); model.CostUnit = dt.Rows[n]["CostUnit"].ToString(); model.ServiceTel = dt.Rows[n]["ServiceTel"].ToString(); model.SupplierCode = dt.Rows[n]["SupplierCode"].ToString(); model.ServiceUrl = dt.Rows[n]["ServiceUrl"].ToString(); model.Memo = dt.Rows[n]["Memo"].ToString(); model.ServiceState = dt.Rows[n]["ServiceState"].ToString(); model.IsPublish = dt.Rows[n]["IsPublish"].ToString(); model.CommIDs = dt.Rows[n]["CommIDs"].ToString(); model.CommNames = dt.Rows[n]["CommNames"].ToString(); if (dt.Rows[n]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.Management.Tb_Management_Service model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(MobileSoft.Model.Management.Tb_Management_Service model) { dal.Add(model); }