/// <summary> /// 增加一条数据 /// </summary> public void Add(MobileSoft.Model.Resources.Tb_Resources_Release model) { dal.Add(model); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(MobileSoft.Model.Resources.Tb_Resources_Release model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <MobileSoft.Model.Resources.Tb_Resources_Release> DataTableToList(DataTable dt) { List <MobileSoft.Model.Resources.Tb_Resources_Release> modelList = new List <MobileSoft.Model.Resources.Tb_Resources_Release>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { MobileSoft.Model.Resources.Tb_Resources_Release model; for (int n = 0; n < rowsCount; n++) { model = new MobileSoft.Model.Resources.Tb_Resources_Release(); //model.ReleaseID=dt.Rows[n]["ReleaseID"].ToString(); //model.ResourcesID=dt.Rows[n]["ResourcesID"].ToString(); model.ReleaseAdContent = dt.Rows[n]["ReleaseAdContent"].ToString(); if (dt.Rows[n]["ReleaseCount"].ToString() != "") { model.ReleaseCount = decimal.Parse(dt.Rows[n]["ReleaseCount"].ToString()); } if (dt.Rows[n]["IsGroupBuy"].ToString() != "") { if ((dt.Rows[n]["IsGroupBuy"].ToString() == "1") || (dt.Rows[n]["IsGroupBuy"].ToString().ToLower() == "true")) { model.IsGroupBuy = true; } else { model.IsGroupBuy = false; } } if (dt.Rows[n]["GroupBuyPrice"].ToString() != "") { model.GroupBuyPrice = decimal.Parse(dt.Rows[n]["GroupBuyPrice"].ToString()); } if (dt.Rows[n]["GroupBuyStartData"].ToString() != "") { model.GroupBuyStartData = DateTime.Parse(dt.Rows[n]["GroupBuyStartData"].ToString()); } if (dt.Rows[n]["GroupBuyEndData"].ToString() != "") { model.GroupBuyEndData = DateTime.Parse(dt.Rows[n]["GroupBuyEndData"].ToString()); } model.PaymentType = dt.Rows[n]["PaymentType"].ToString(); //model.BussId=dt.Rows[n]["BussId"].ToString(); if (dt.Rows[n]["IsStop"].ToString() != "") { if ((dt.Rows[n]["IsStop"].ToString() == "1") || (dt.Rows[n]["IsStop"].ToString().ToLower() == "true")) { model.IsStop = true; } else { model.IsStop = false; } } if (dt.Rows[n]["IsDelete"].ToString() != "") { model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString()); } modelList.Add(model); } } return(modelList); }