Example #1
0
        public string GetList()
        {
            var parentList = OtherInfoBll.GetList(0, UserContext.CurrentUser.HotelId);

            parentList.ForEach(m =>
            {
                var kids   = OtherInfoBll.GetList(m.Id, UserContext.CurrentUser.HotelId);
                m.children = kids;
            });
            return(JsonConvert.SerializeObject(parentList));
        }
Example #2
0
        public ActionResult Edit(long id = 0)
        {
            if (id == 0)
            {
                return(View(new OtherInfo()
                {
                    HotelId = UserContext.CurrentUser.HotelId
                }));
            }
            var info = OtherInfoBll.GetById(id);

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

            try
            {
                OtherInfoBll.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));
        }
Example #4
0
        public JsonResult Edit(OtherInfo model)
        {
            var apiResult = new APIResult();

            try
            {
                OtherInfoBll.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));
        }