public ActionResult Edit(long id = 0) { if (id == 0) { return(View(new Khzt())); } var info = KhztBll.GetById(id); return(View(info)); }
public ActionResult Delete(long id) { var apiResult = new APIResult(); try { KhztBll.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(Khzt model) { var apiResult = new APIResult(); try { KhztBll.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 string GetList() { var models = KhztBll.GetList(UserContext.CurrentUser.HotelId); return(JsonConvert.SerializeObject(models)); }