Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Tunnel.Model.Date_Sys> DataTableToList(DataTable dt)
        {
            List <Tunnel.Model.Date_Sys> modelList = new List <Tunnel.Model.Date_Sys>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Tunnel.Model.Date_Sys model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Tunnel.Model.Date_Sys();
                    if (dt.Rows[n]["d_Id"].ToString() != "")
                    {
                        model.d_Id = int.Parse(dt.Rows[n]["d_Id"].ToString());
                    }
                    if (dt.Rows[n]["d_userId"].ToString() != "")
                    {
                        model.d_userId = int.Parse(dt.Rows[n]["d_userId"].ToString());
                    }
                    if (dt.Rows[n]["d_beginPoll_Date"].ToString() != "")
                    {
                        model.d_beginPoll_Date = DateTime.Parse(dt.Rows[n]["d_beginPoll_Date"].ToString());
                    }
                    if (dt.Rows[n]["d_endPoll_Date"].ToString() != "")
                    {
                        model.d_endPoll_Date = DateTime.Parse(dt.Rows[n]["d_endPoll_Date"].ToString());
                    }
                    if (dt.Rows[n]["d_proce_Date"].ToString() != "")
                    {
                        model.d_proce_Date = DateTime.Parse(dt.Rows[n]["d_proce_Date"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Tunnel.Model.Date_Sys model)
 {
     dal.Update(model);
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(Tunnel.Model.Date_Sys model)
 {
     dal.Add(model);
 }