Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(CdHotelManage.Model.floor_ld model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(CdHotelManage.Model.floor_ld model)
 {
     return(dal.Add(model));
 }