コード例 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <CdHotelManage.Model.floor_ld> DataTableToList(DataTable dt)
        {
            List <CdHotelManage.Model.floor_ld> modelList = new List <CdHotelManage.Model.floor_ld>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                CdHotelManage.Model.floor_ld model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new CdHotelManage.Model.floor_ld();
                    if (dt.Rows[n]["id"] != null && dt.Rows[n]["id"].ToString() != "")
                    {
                        model.id = int.Parse(dt.Rows[n]["id"].ToString());
                    }
                    if (dt.Rows[n]["ld_Name"] != null && dt.Rows[n]["ld_Name"].ToString() != "")
                    {
                        model.ld_Name = dt.Rows[n]["ld_Name"].ToString();
                    }

                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(CdHotelManage.Model.floor_ld model)
 {
     return(dal.Update(model));
 }
コード例 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(CdHotelManage.Model.floor_ld model)
 {
     return(dal.Add(model));
 }