Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <CdHotelManage.Model.floor_manage> DataTableToList(DataTable dt)
        {
            List <CdHotelManage.Model.floor_manage> modelList = new List <CdHotelManage.Model.floor_manage>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                CdHotelManage.Model.floor_manage model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new CdHotelManage.Model.floor_manage();
                    if (dt.Rows[n]["floor_id"] != null && dt.Rows[n]["floor_id"].ToString() != "")
                    {
                        model.floor_id = int.Parse(dt.Rows[n]["floor_id"].ToString());
                    }
                    if (dt.Rows[n]["floor_number"] != null && dt.Rows[n]["floor_number"].ToString() != "")
                    {
                        model.floor_number = dt.Rows[n]["floor_number"].ToString();
                    }
                    if (dt.Rows[n]["floor_name"] != null && dt.Rows[n]["floor_name"].ToString() != "")
                    {
                        model.floor_name = dt.Rows[n]["floor_name"].ToString();
                    }
                    if (dt.Rows[n]["floor_sorting"] != null && dt.Rows[n]["floor_sorting"].ToString() != "")
                    {
                        model.floor_sorting = dt.Rows[n]["floor_sorting"].ToString();
                    }
                    if (dt.Rows[n]["floor_remaker"] != null && dt.Rows[n]["floor_remaker"].ToString() != "")
                    {
                        model.floor_remaker = dt.Rows[n]["floor_remaker"].ToString();
                    }
                    if (dt.Rows[n]["floor_shoping"] != null && dt.Rows[n]["floor_shoping"].ToString() != "")
                    {
                        model.floor_shoping = dt.Rows[n]["floor_shoping"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(CdHotelManage.Model.floor_manage model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(CdHotelManage.Model.floor_manage model)
 {
     return(dal.Add(model));
 }