Beispiel #1
0
        public ActionResult Edit(long id = 0)
        {
            if (id == 0)
            {
                return(View(new Hotel.Model.Swpc()
                {
                    HotelId = UserContext.CurrentUser.HotelId
                }));
            }
            var info = SwpcBll.GetById(id);

            return(View(info));
        }
Beispiel #2
0
        public ActionResult Delete(long id)
        {
            var apiResult = new APIResult();

            try
            {
                SwpcBll.Delete(id);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }
            return(Json(apiResult));
        }
Beispiel #3
0
        public JsonResult Edit(Hotel.Model.Swpc model)
        {
            var apiResult = new APIResult();

            try
            {
                SwpcBll.AddOrUpdate(model, UserContext.CurrentUser.HotelId);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }

            return(Json(apiResult));
        }
Beispiel #4
0
        public string GetPager(int page, int rows, long swpcCatId = 0, string searchName = null)
        {
            var pager = SwpcBll.GetPager(page, rows, UserContext.CurrentUser.HotelId, swpcCatId, searchName);

            return(JsonConvert.SerializeObject(pager));
        }