Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <DTcms.Model.Goods> DataTableToList(DataTable dt)
        {
            List <DTcms.Model.Goods> modelList = new List <DTcms.Model.Goods>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                DTcms.Model.Goods model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.Goods();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    if (dt.Rows[n]["UnitId"].ToString() != "")
                    {
                        model.UnitId = int.Parse(dt.Rows[n]["UnitId"].ToString());
                    }
                    if (dt.Rows[n]["CustomerId"].ToString() != "")
                    {
                        model.CustomerId = int.Parse(dt.Rows[n]["CustomerId"].ToString());
                    }
                    if (dt.Rows[n]["StoreModeId"].ToString() != "")
                    {
                        model.StoreModeId = int.Parse(dt.Rows[n]["StoreModeId"].ToString());
                    }
                    if (dt.Rows[n]["HandlingModeId"].ToString() != "")
                    {
                        model.HandlingModeId = int.Parse(dt.Rows[n]["HandlingModeId"].ToString());
                    }
                    model.Name = dt.Rows[n]["Name"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
Archivo: Goods.cs Proyecto: uwitec/MWMS
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<DTcms.Model.Goods> DataTableToList(DataTable dt)
        {
            List<DTcms.Model.Goods> modelList = new List<DTcms.Model.Goods>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                DTcms.Model.Goods model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.Goods();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    if (dt.Rows[n]["UnitId"].ToString() != "")
                    {
                        model.UnitId = int.Parse(dt.Rows[n]["UnitId"].ToString());
                    }
                    if (dt.Rows[n]["CustomerId"].ToString() != "")
                    {
                        model.CustomerId = int.Parse(dt.Rows[n]["CustomerId"].ToString());
                    }
                    if (dt.Rows[n]["StoreModeId"].ToString() != "")
                    {
                        model.StoreModeId = int.Parse(dt.Rows[n]["StoreModeId"].ToString());
                    }
                    if (dt.Rows[n]["HandlingModeId"].ToString() != "")
                    {
                        model.HandlingModeId = int.Parse(dt.Rows[n]["HandlingModeId"].ToString());
                    }
                    model.Name = dt.Rows[n]["Name"].ToString();

                    modelList.Add(model);
                }
            }
            return modelList;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DTcms.Model.Goods model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(DTcms.Model.Goods model)
 {
     return(dal.Add(model));
 }
Ejemplo n.º 5
0
Archivo: Goods.cs Proyecto: MYF0tX/MWMS
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(DTcms.Model.Goods model)
 {
     dal.Add(model);
 }