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

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