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

            if (rowsCount > 0)
            {
                Dianda.Model.Project_Apply_orderRoom model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Dianda.Model.Project_Apply_orderRoom();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["ApplyID"].ToString() != "")
                    {
                        model.ApplyID = int.Parse(dt.Rows[n]["ApplyID"].ToString());
                    }
                    if (dt.Rows[n]["RoomID"].ToString() != "")
                    {
                        model.RoomID = int.Parse(dt.Rows[n]["RoomID"].ToString());
                    }
                    if (dt.Rows[n]["StartTime"].ToString() != "")
                    {
                        model.StartTime = DateTime.Parse(dt.Rows[n]["StartTime"].ToString());
                    }
                    if (dt.Rows[n]["EndTime"].ToString() != "")
                    {
                        model.EndTime = DateTime.Parse(dt.Rows[n]["EndTime"].ToString());
                    }
                    if (dt.Rows[n]["PeopleNum"].ToString() != "")
                    {
                        model.PeopleNum = int.Parse(dt.Rows[n]["PeopleNum"].ToString());
                    }
                    model.MeetName = dt.Rows[n]["MeetName"].ToString();
                    model.Address  = dt.Rows[n]["Address"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Dianda.Model.Project_Apply_orderRoom model)
 {
     dal.Update(model);
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Dianda.Model.Project_Apply_orderRoom model)
 {
     return(dal.Add(model));
 }