示例#1
0
        public ActionResult Edit(long posId, long id = 0)
        {
            ViewBag.PosId = posId;
            if (id == 0)
            {
                return(View(new PosDesk()
                {
                    PosId = posId
                }));
            }
            var info = PosDeskBll.GetById(id);

            if (info.PosId == 0)
            {
                info.PosId = posId;
            }
            return(View(info));
        }
示例#2
0
        public ActionResult Delete(long id)
        {
            var apiResult = new APIResult();

            try
            {
                PosDeskBll.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));
        }
示例#3
0
        public JsonResult Edit(PosDesk model)
        {
            var apiResult = new APIResult();

            try
            {
                PosDeskBll.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));
        }
示例#4
0
        public string GetList(long posId)
        {
            var models = PosDeskBll.GetListByPos(posId);

            return(JsonConvert.SerializeObject(models));
        }