Пример #1
0
        /// <summary>
        /// 获取所有房间状态
        /// </summary>
        /// <returns></returns>
        public List <SexViewModel> GetStateTxt()
        {
            using (HotelManageDBEntities db = new HotelManageDBEntities())
            {
                var data = from r in db.Room_State
                           where r.RoomId == null
                           select new
                {
                    r.Id,
                    r.StateTxt
                };
                List <SexViewModel> list = new List <SexViewModel>();
                SexViewModel        sex  = new SexViewModel();
                sex.Id  = 0;
                sex.Sex = "全部类型";
                list.Add(sex);
                foreach (var item in data)
                {
                    SexViewModel s = new SexViewModel();
                    s.Id  = item.Id;
                    s.Sex = item.StateTxt;

                    list.Add(s);
                }
                return(list);
            }
        }
Пример #2
0
        /// <summary>
        /// 获取所有的楼层
        /// </summary>
        /// <returns></returns>
        public JsonResult GetFloorNum()
        {
            List <SexViewModel> listStaffId = new List <SexViewModel>();

            string[] list = { "全部楼层", "一 楼", "二 楼", "三 楼", "四 楼", "五 楼" };
            for (int i = 0; i < 6; i++)
            {
                SexViewModel sexViewModel = new SexViewModel();
                sexViewModel.Id  = i;
                sexViewModel.Sex = list[i];
                listStaffId.Add(sexViewModel);
            }
            return(Json(listStaffId, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// 获取性别列表
        /// </summary>
        /// <returns></returns>
        public ActionResult GetSex()
        {
            List <SexViewModel> list = new List <SexViewModel>();

            string[] st = { "女", "男" };
            for (int i = 0; i < 2; i++)
            {
                SexViewModel s = new SexViewModel();
                s.Id  = i;
                s.Sex = st[i];
                list.Add(s);
            }
            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        /// <summary>
        /// 获取所有商品名称
        /// </summary>
        /// <returns></returns>
        public List <SexViewModel> GetAllCommodityName()
        {
            using (HotelManageDBEntities db = new HotelManageDBEntities())
            {
                var data = from c in db.Commodity
                           select new
                {
                    c.Id,
                    c.Name
                };
                List <SexViewModel> list = new List <SexViewModel>();
                foreach (var item in data)
                {
                    SexViewModel s = new SexViewModel();
                    s.Id  = item.Id;
                    s.Sex = item.Name;

                    list.Add(s);
                }
                return(list);
            }
        }