Example #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Hch.iDisk.Model.Tag> DataTableToList(DataTable dt)
        {
            List <Hch.iDisk.Model.Tag> modelList = new List <Hch.iDisk.Model.Tag>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Hch.iDisk.Model.Tag model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model       = new Hch.iDisk.Model.Tag();
                    model.TName = dt.Rows[n]["TName"].ToString();
                    if (dt.Rows[n]["TUserId"].ToString() != "")
                    {
                        model.TUserId = int.Parse(dt.Rows[n]["TUserId"].ToString());
                    }
                    if (dt.Rows[n]["TFileId"].ToString() != "")
                    {
                        model.TFileId = int.Parse(dt.Rows[n]["TFileId"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Example #2
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<Hch.iDisk.Model.Tag> DataTableToList(DataTable dt)
 {
     List<Hch.iDisk.Model.Tag> modelList = new List<Hch.iDisk.Model.Tag>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         Hch.iDisk.Model.Tag model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new Hch.iDisk.Model.Tag();
             model.TName=dt.Rows[n]["TName"].ToString();
             if(dt.Rows[n]["TUserId"].ToString()!="")
             {
                 model.TUserId=int.Parse(dt.Rows[n]["TUserId"].ToString());
             }
             if(dt.Rows[n]["TFileId"].ToString()!="")
             {
                 model.TFileId=int.Parse(dt.Rows[n]["TFileId"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
Example #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hch.iDisk.Model.Tag model)
 {
     return(dal.Update(model));
 }
Example #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(Hch.iDisk.Model.Tag model)
 {
     dal.Add(model);
 }