/// <summary> /// 获得数据列表 /// </summary> public List <XHD.Model.CRM_product_category> DataTableToList(DataTable dt) { List <XHD.Model.CRM_product_category> modelList = new List <XHD.Model.CRM_product_category>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { XHD.Model.CRM_product_category model; for (int n = 0; n < rowsCount; n++) { model = new XHD.Model.CRM_product_category(); if (dt.Rows[n]["id"] != null && dt.Rows[n]["id"].ToString() != "") { model.id = int.Parse(dt.Rows[n]["id"].ToString()); } if (dt.Rows[n]["product_category"] != null && dt.Rows[n]["product_category"].ToString() != "") { model.product_category = dt.Rows[n]["product_category"].ToString(); } if (dt.Rows[n]["parentid"] != null && dt.Rows[n]["parentid"].ToString() != "") { model.parentid = int.Parse(dt.Rows[n]["parentid"].ToString()); } if (dt.Rows[n]["product_icon"] != null && dt.Rows[n]["product_icon"].ToString() != "") { model.product_icon = dt.Rows[n]["product_icon"].ToString(); } if (dt.Rows[n]["isDelete"] != null && dt.Rows[n]["isDelete"].ToString() != "") { model.isDelete = int.Parse(dt.Rows[n]["isDelete"].ToString()); } if (dt.Rows[n]["Delete_id"] != null && dt.Rows[n]["Delete_id"].ToString() != "") { model.Delete_id = int.Parse(dt.Rows[n]["Delete_id"].ToString()); } if (dt.Rows[n]["Delete_time"] != null && dt.Rows[n]["Delete_time"].ToString() != "") { model.Delete_time = DateTime.Parse(dt.Rows[n]["Delete_time"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// ��������б� /// </summary> public List<XHD.Model.CRM_product_category> DataTableToList(DataTable dt) { List<XHD.Model.CRM_product_category> modelList = new List<XHD.Model.CRM_product_category>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { XHD.Model.CRM_product_category model; for (int n = 0; n < rowsCount; n++) { model = new XHD.Model.CRM_product_category(); if(dt.Rows[n]["id"]!=null && dt.Rows[n]["id"].ToString()!="") { model.id=int.Parse(dt.Rows[n]["id"].ToString()); } if(dt.Rows[n]["product_category"]!=null && dt.Rows[n]["product_category"].ToString()!="") { model.product_category=dt.Rows[n]["product_category"].ToString(); } if(dt.Rows[n]["parentid"]!=null && dt.Rows[n]["parentid"].ToString()!="") { model.parentid=int.Parse(dt.Rows[n]["parentid"].ToString()); } if(dt.Rows[n]["product_icon"]!=null && dt.Rows[n]["product_icon"].ToString()!="") { model.product_icon=dt.Rows[n]["product_icon"].ToString(); } if(dt.Rows[n]["isDelete"]!=null && dt.Rows[n]["isDelete"].ToString()!="") { model.isDelete=int.Parse(dt.Rows[n]["isDelete"].ToString()); } if(dt.Rows[n]["Delete_id"]!=null && dt.Rows[n]["Delete_id"].ToString()!="") { model.Delete_id=int.Parse(dt.Rows[n]["Delete_id"].ToString()); } if(dt.Rows[n]["Delete_time"]!=null && dt.Rows[n]["Delete_time"].ToString()!="") { model.Delete_time=DateTime.Parse(dt.Rows[n]["Delete_time"].ToString()); } modelList.Add(model); } } return modelList; }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(XHD.Model.CRM_product_category model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(XHD.Model.CRM_product_category model) { return(dal.Add(model)); }