public ActionResult Index2(long roomRegId = 0) { var RoomNO = ""; if (roomRegId != 0) { var room = RoomRegBll.GetById(roomRegId); RoomNO = room.RoomNO; } var model = new RoomRegQtfy() { RoomRegId = roomRegId, RoomNO = RoomNO, FsTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm") }; return(View(model)); }
// GET: RoomRegQtfy public ActionResult Index(long roomRegId, long itemId = 0) { if (itemId == 0) { return(View(new RoomRegQtfy() { RoomRegId = roomRegId, FsTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm") })); } else { var model = RoomRegQtfyBll.GetById(itemId); if (model == null) { model = new RoomRegQtfy(); } return(View(model)); } }
public JsonResult AddOrUpdate(RoomRegQtfy model) { var apiResult = new APIResult(); var user = UserContext.CurrentUser; try { RoomRegQtfyBll.AddOrUpdate(model, user.Id, user.Name, user.HotelId); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }