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

            if (rowsCount > 0)
            {
                Hch.iDisk.Model.ShareInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hch.iDisk.Model.ShareInfo();
                    if (dt.Rows[n]["SId"].ToString() != "")
                    {
                        model.SId = int.Parse(dt.Rows[n]["SId"].ToString());
                    }
                    if (dt.Rows[n]["SSender"].ToString() != "")
                    {
                        model.SSender = int.Parse(dt.Rows[n]["SSender"].ToString());
                    }
                    if (dt.Rows[n]["SReceive"].ToString() != "")
                    {
                        model.SReceive = int.Parse(dt.Rows[n]["SReceive"].ToString());
                    }
                    if (dt.Rows[n]["SDate"].ToString() != "")
                    {
                        model.SDate = DateTime.Parse(dt.Rows[n]["SDate"].ToString());
                    }
                    if (dt.Rows[n]["SFileId"].ToString() != "")
                    {
                        model.SFileId = int.Parse(dt.Rows[n]["SFileId"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hch.iDisk.Model.ShareInfo model)
 {
     return(dal.Update(model));
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Hch.iDisk.Model.ShareInfo model)
 {
     return(dal.Add(model));
 }