public ActionResult Delete(long id) { var apiResult = new APIResult(); try { PosDiscountBll.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)); }
public JsonResult Edit(PosDiscount model) { var apiResult = new APIResult(); try { PosDiscountBll.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)); }
public ActionResult Edit(long posId, long id = 0) { var now = DateTime.Now; ViewBag.CurrentTime = now.ToString("yyyy-MM-dd HH:mm:ss"); ViewBag.PosId = posId; if (id == 0) { return(View(new PosDiscount() { PosId = posId })); } var info = PosDiscountBll.GetById(id); if (info.PosId == 0) { info.PosId = posId; } return(View(info)); }
public string GetList(long posId) { var models = PosDiscountBll.GetListByPos(posId, UserContext.CurrentUser.HotelId); return(JsonConvert.SerializeObject(models)); }