Ejemplo n.º 1
0
        public ActionResult Edit(long id = 0)
        {
            if (id == 0)
            {
                return(View(new Cat()));
            }
            var info = CatBll.GetById(id);

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

            try
            {
                CatBll.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));
        }
Ejemplo n.º 3
0
        public JsonResult Edit(Cat model)
        {
            var apiResult = new APIResult();

            try
            {
                CatBll.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);
                }
            }
            //MessageBox.Show(Json(apiResult).ToString());
            return(Json(apiResult));
        }
Ejemplo n.º 4
0
        public string GetList()
        {
            var models = CatBll.GetList(UserContext.CurrentUser.HotelId);

            return(JsonConvert.SerializeObject(models));
        }