Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<DTcms.Model.Attach> DataTableToList(DataTable dt)
        {
            List<DTcms.Model.Attach> modelList = new List<DTcms.Model.Attach>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                DTcms.Model.Attach model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.Attach();
                                                    if(dt.Rows[n]["StoreWaitingGoodsId"].ToString()!="")
                {
                    model.StoreWaitingGoodsId=int.Parse(dt.Rows[n]["StoreWaitingGoodsId"].ToString());
                }
                                                                                                                                                model.FilePath= dt.Rows[n]["FilePath"].ToString();
                                                                                                                if(dt.Rows[n]["CreateTime"].ToString()!="")
                {
                    model.CreateTime=DateTime.Parse(dt.Rows[n]["CreateTime"].ToString());
                }
                                                                                                                                                model.Admin= dt.Rows[n]["Admin"].ToString();
                                                                                                                                model.Remark= dt.Rows[n]["Remark"].ToString();

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

            if (rowsCount > 0)
            {
                DTcms.Model.Attach model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.Attach();
                    if (dt.Rows[n]["StoreInGoodsStoreInOrderId"].ToString() != "")
                    {
                        model.StoreInGoodsStoreInOrderId = int.Parse(dt.Rows[n]["StoreInGoodsStoreInOrderId"].ToString());
                    }
                    if (dt.Rows[n]["StoreInGoodsId"].ToString() != "")
                    {
                        model.StoreInGoodsId = int.Parse(dt.Rows[n]["StoreInGoodsId"].ToString());
                    }
                    model.FilePath = dt.Rows[n]["FilePath"].ToString();
                    if (dt.Rows[n]["CreateTime"].ToString() != "")
                    {
                        model.CreateTime = DateTime.Parse(dt.Rows[n]["CreateTime"].ToString());
                    }
                    model.Admin  = dt.Rows[n]["Admin"].ToString();
                    model.Remark = dt.Rows[n]["Remark"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 3
0
 public void AddAttach(Attach attach)
 {
     _attachs.Add(attach);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DTcms.Model.Attach model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(DTcms.Model.Attach model)
 {
     dal.Add(model);
 }
Ejemplo n.º 6
0
 public void AddAttach(Attach attach)
 {
     _attachs.Add(attach);
 }