/// <summary>
 /// 增加一条数据
 /// </summary>
 public long Add(MobileSoft.Model.Club.Tb_Club_MaterialDetail model)
 {
     return(dal.Add(model));
 }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.Club.Tb_Club_MaterialDetail model)
 {
     dal.Update(model);
 }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <MobileSoft.Model.Club.Tb_Club_MaterialDetail> DataTableToList(DataTable dt)
        {
            List <MobileSoft.Model.Club.Tb_Club_MaterialDetail> modelList = new List <MobileSoft.Model.Club.Tb_Club_MaterialDetail>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                MobileSoft.Model.Club.Tb_Club_MaterialDetail model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.Club.Tb_Club_MaterialDetail();
                    //model.InfoId=dt.Rows[n]["InfoId"].ToString();
                    //model.MerchID=dt.Rows[n]["MerchID"].ToString();
                    if (dt.Rows[n]["CommID"].ToString() != "")
                    {
                        model.CommID = int.Parse(dt.Rows[n]["CommID"].ToString());
                    }
                    if (dt.Rows[n]["MerchDefaultPrice"].ToString() != "")
                    {
                        model.MerchDefaultPrice = decimal.Parse(dt.Rows[n]["MerchDefaultPrice"].ToString());
                    }
                    if (dt.Rows[n]["MerchCostPrice"].ToString() != "")
                    {
                        model.MerchCostPrice = decimal.Parse(dt.Rows[n]["MerchCostPrice"].ToString());
                    }
                    model.MerchMemo = dt.Rows[n]["MerchMemo"].ToString();
                    if (dt.Rows[n]["IsPackage"].ToString() != "")
                    {
                        model.IsPackage = int.Parse(dt.Rows[n]["IsPackage"].ToString());
                    }
                    //model.MerchandiseID=dt.Rows[n]["MerchandiseID"].ToString();
                    if (dt.Rows[n]["Quantity"].ToString() != "")
                    {
                        model.Quantity = int.Parse(dt.Rows[n]["Quantity"].ToString());
                    }
                    //model.CostID=dt.Rows[n]["CostID"].ToString();
                    if (dt.Rows[n]["NoOutStore"].ToString() != "")
                    {
                        model.NoOutStore = int.Parse(dt.Rows[n]["NoOutStore"].ToString());
                    }
                    if (dt.Rows[n]["IsHelpSale"].ToString() != "")
                    {
                        model.IsHelpSale = int.Parse(dt.Rows[n]["IsHelpSale"].ToString());
                    }
                    if (dt.Rows[n]["GetMethod"].ToString() != "")
                    {
                        model.GetMethod = int.Parse(dt.Rows[n]["GetMethod"].ToString());
                    }
                    if (dt.Rows[n]["IsHelpSaleValue"].ToString() != "")
                    {
                        model.IsHelpSaleValue = decimal.Parse(dt.Rows[n]["IsHelpSaleValue"].ToString());
                    }
                    if (dt.Rows[n]["IsLease"].ToString() != "")
                    {
                        model.IsLease = int.Parse(dt.Rows[n]["IsLease"].ToString());
                    }
                    if (dt.Rows[n]["IsPay"].ToString() != "")
                    {
                        model.IsPay = int.Parse(dt.Rows[n]["IsPay"].ToString());
                    }
                    if (dt.Rows[n]["PayMoneyValue"].ToString() != "")
                    {
                        model.PayMoneyValue = decimal.Parse(dt.Rows[n]["PayMoneyValue"].ToString());
                    }
                    if (dt.Rows[n]["IsDeleteDetail"].ToString() != "")
                    {
                        model.IsDeleteDetail = int.Parse(dt.Rows[n]["IsDeleteDetail"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }