protected void rptListBooking_ItemCommand(object source, RepeaterCommandEventArgs e) { var bookingId = Convert.ToInt32(e.CommandArgument); var booking = SeriesViewBLL.BookingGetById(bookingId); if (e.CommandName == "approved") { booking.Status = StatusType.Approved; booking.ModifiedBy = UserBLL.UserGetCurrent(); booking.ModifiedDate = DateTime.Now; SeriesViewBLL.BookingSaveOrUpdate(booking); BookingHistorySave(booking); ShowSuccess("Đã approved booking này thành công."); } if (e.CommandName == "cancel") { booking.Status = StatusType.Cancelled; booking.ModifiedBy = UserBLL.UserGetCurrent(); booking.ModifiedDate = DateTime.Now; SeriesViewBLL.BookingSaveOrUpdate(booking); BookingHistorySave(booking); ShowSuccess("Đã cancel booking này thành công."); } Reload(); }
public void BookingLoadData() { var listBooking = SeriesViewBLL.BookingGetAllByQueryString(Request.QueryString).OrderBy(x => x.Status).ThenByDescending(x => x.StartDate); rptListBooking.DataSource = listBooking; rptListBooking.DataBind(); }
protected void Page_Unload(object sender, EventArgs e) { if (seriesViewBLL != null) { seriesViewBLL.Dispose(); seriesViewBLL = null; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var seriesId = -1; try { seriesId = Convert.ToInt32(Request.QueryString["si"]); } catch { } var series = SeriesViewBLL.SeriesGetById(seriesId); var haveViewAllSeriesPermission = PermissionBLL.UserCheckPermission(UserBLL.UserGetCurrent().Id, (int)PermissionEnum.VIEWALLSERIES); if (!haveViewAllSeriesPermission) { if (series.Agency.Sale.Id != userBLL.UserGetCurrent().Id) { ShowError("Không có quyền xem series do người khác quản lý. Liên hệ với manager để cấp quyền"); return; } } try { lblSeriesCode.Text = series.SeriesCode + " - " + series.Agency.Name; } catch { } try { lblCreatedBy.Text = "Create by " + series.CreatedBy.Name; } catch { } try { lblCreatedDate.Text = " at " + series.CreatedDate.Value.ToString("dd/MM/yyyy HH:mm"); } catch { } ControlLoadData(); BookingLoadData(); } }
public void BookingHistorySave(Booking booking) { var bookingHistory = new BookingHistory() { Booking = booking, Date = DateTime.Now, User = UserBLL.UserGetCurrent(), CabinNumber = booking.BookingRooms.Count, CustomerNumber = booking.Pax, StartDate = booking.StartDate, Status = booking.Status, Trip = booking.Trip, Agency = booking.Agency, Total = booking.Total, TotalCurrency = booking.IsTotalUsd ? "USD" : "VND", }; SeriesViewBLL.BookingHistorySaveOrUpdate(bookingHistory); }
protected void Page_Unload(object sender, EventArgs e) { if (seriesViewBLL != null) { seriesViewBLL.Dispose(); seriesViewBLL = null; } if (userBLL != null) { userBLL.Dispose(); userBLL = null; } if (permissionBLL != null) { permissionBLL.Dispose(); permissionBLL = null; } }