/// <summary> /// 增加一条数据 /// </summary> public void Add(MobileSoft.Model.Resources.Tb_Resources_Details model) { dal.Add(model); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.Resources.Tb_Resources_Details model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.Resources.Tb_Resources_Details> DataTableToList(DataTable dt) { List <MobileSoft.Model.Resources.Tb_Resources_Details> modelList = new List <MobileSoft.Model.Resources.Tb_Resources_Details>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.Resources.Tb_Resources_Details model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.Resources.Tb_Resources_Details(); //model.ResourcesID=dt.Rows[n]["ResourcesID"].ToString(); //model.BussId=dt.Rows[n]["BussId"].ToString(); //model.ResourcesTypeID=dt.Rows[n]["ResourcesTypeID"].ToString(); model.ResourcesName = dt.Rows[n]["ResourcesName"].ToString(); model.ResourcesSimple = dt.Rows[n]["ResourcesSimple"].ToString(); if (dt.Rows[n]["ResourcesIndex"].ToString() != "") { model.ResourcesIndex = int.Parse(dt.Rows[n]["ResourcesIndex"].ToString()); } model.ResourcesBarCode = dt.Rows[n]["ResourcesBarCode"].ToString(); model.ResourcesCode = dt.Rows[n]["ResourcesCode"].ToString(); model.ResourcesUnit = dt.Rows[n]["ResourcesUnit"].ToString(); if (dt.Rows[n]["ResourcesCount"].ToString() != "") { model.ResourcesCount = decimal.Parse(dt.Rows[n]["ResourcesCount"].ToString()); } model.ResourcesPriceUnit = dt.Rows[n]["ResourcesPriceUnit"].ToString(); if (dt.Rows[n]["ResourcesSalePrice"].ToString() != "") { model.ResourcesSalePrice = decimal.Parse(dt.Rows[n]["ResourcesSalePrice"].ToString()); } if (dt.Rows[n]["ResourcesDisCountPrice"].ToString() != "") { model.ResourcesDisCountPrice = decimal.Parse(dt.Rows[n]["ResourcesDisCountPrice"].ToString()); } if (dt.Rows[n]["IsRelease"].ToString() != "") { if ((dt.Rows[n]["IsRelease"].ToString() == "1") || (dt.Rows[n]["IsRelease"].ToString().ToLower() == "true")) { model.IsRelease = true; } else { model.IsRelease = false; } } model.ScheduleType = dt.Rows[n]["ScheduleType"].ToString(); if (dt.Rows[n]["IsStopRelease"].ToString() != "") { if ((dt.Rows[n]["IsStopRelease"].ToString() == "1") || (dt.Rows[n]["IsStopRelease"].ToString().ToLower() == "true")) { model.IsStopRelease = true; } else { model.IsStopRelease = false; } } model.Remark = dt.Rows[n]["Remark"].ToString(); if (dt.Rows[n]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString()); } modelList.Add(model); } } return(modelList); }