Esempio n. 1
0
        public ActionResult Edit(long id = 0)
        {
            if (id == 0)
            {
                return(View(new Khlx()));
            }
            var info = KhlxBll.GetById(id);

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

            try
            {
                KhlxBll.DeleteById(id);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }
            return(Json(apiResult));
        }
Esempio n. 3
0
        public JsonResult Edit(Khlx model)
        {
            var apiResult = new APIResult();

            try
            {
                KhlxBll.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));
        }
Esempio n. 4
0
        public string GetList()
        {
            var models = KhlxBll.GetList(UserContext.CurrentUser.HotelId);

            return(JsonConvert.SerializeObject(models));
        }