示例#1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <DTcms.Model.StoreInUnitPrice> DataTableToList(DataTable dt)
        {
            List <DTcms.Model.StoreInUnitPrice> modelList = new List <DTcms.Model.StoreInUnitPrice>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                DTcms.Model.StoreInUnitPrice model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.StoreInUnitPrice();
                    if (dt.Rows[n]["StoreInOrderId"].ToString() != "")
                    {
                        model.StoreInOrderId = int.Parse(dt.Rows[n]["StoreInOrderId"].ToString());
                    }
                    if (dt.Rows[n]["BeginTime"].ToString() != "")
                    {
                        model.BeginTime = DateTime.Parse(dt.Rows[n]["BeginTime"].ToString());
                    }
                    if (dt.Rows[n]["Price"].ToString() != "")
                    {
                        model.Price = decimal.Parse(dt.Rows[n]["Price"].ToString());
                    }
                    if (dt.Rows[n]["EndTime"].ToString() != "")
                    {
                        model.EndTime = DateTime.Parse(dt.Rows[n]["EndTime"].ToString());
                    }
                    model.Remark = dt.Rows[n]["Remark"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<DTcms.Model.StoreInUnitPrice> DataTableToList(DataTable dt)
        {
            List<DTcms.Model.StoreInUnitPrice> modelList = new List<DTcms.Model.StoreInUnitPrice>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                DTcms.Model.StoreInUnitPrice model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.StoreInUnitPrice();
                                                    if(dt.Rows[n]["StoreInOrderId"].ToString()!="")
                {
                    model.StoreInOrderId=int.Parse(dt.Rows[n]["StoreInOrderId"].ToString());
                }
                                                                                                                                if(dt.Rows[n]["BeginTime"].ToString()!="")
                {
                    model.BeginTime=DateTime.Parse(dt.Rows[n]["BeginTime"].ToString());
                }
                                                                                                                                if(dt.Rows[n]["Price"].ToString()!="")
                {
                    model.Price=decimal.Parse(dt.Rows[n]["Price"].ToString());
                }
                                                                                                                                if(dt.Rows[n]["EndTime"].ToString()!="")
                {
                    model.EndTime=DateTime.Parse(dt.Rows[n]["EndTime"].ToString());
                }
                                                                                                                                                model.Remark= dt.Rows[n]["Remark"].ToString();

                    modelList.Add(model);
                }
            }
            return modelList;
        }
示例#3
0
 public void AddUnitPrice(StoreInUnitPrice unitPrices)
 {
     _unitPrices.Add(unitPrices);
 }
示例#4
0
 public void AddUnitPrice(StoreInUnitPrice unitPrices)
 {
     _unitPrices.Add(unitPrices);
 }
示例#5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DTcms.Model.StoreInUnitPrice model)
 {
     return(dal.Update(model));
 }
示例#6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(DTcms.Model.StoreInUnitPrice model)
 {
     dal.Add(model);
 }