//public void TripLockDisplay() //{ // var haveEditTripAfterPermission = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.EDIT_TRIP_AFTER); // if (!haveEditTripAfterPermission) // { // if (Booking.StartDate.AddHours(12) < DateTime.Now) // { // plhTripReadonly.Visible = true; // try // { // litTrip.Text = Booking.Trip.Name; // } // catch { } // ddlTrips.Visible = false; // } // } //} public void TotalLockedDisplay() { var isLocked = Booking.LockIncome; var haveEditAfterLockPermission = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.EDIT_AFTER_LOCK); var haveLockIncomePermission = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.LOCK_INCOME); if (isLocked) { if (!haveEditAfterLockPermission) { txtTotal.ReadOnly = true; txtTotal.CssClass = txtTotal.CssClass + " total-locked "; ddlCurrencies.Enabled = false; } } if (haveLockIncomePermission) { btnLockIncome.Visible = true; btnUnlockIncome.Visible = false; if (isLocked) { btnLockIncome.Visible = false; btnUnlockIncome.Visible = true; } } }
public void TotalDisplay() { var canViewTotal = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.VIEW_TOTAL_BY_DATE); if (!canViewTotal) { HideTotal(); } }
protected void Page_Load(object sender, EventArgs e) { if (!PermissionUtil.UserCheckPermission(UserIdentity.Id, (int)PermissionEnum.FORM_ADDBOOKING)) { ShowErrors("You don't have permission to perform this action"); return; } // Lấy tất cả các hành trình để lọc ra các hành trình có nhiều option, phục vụ cho việc ẩn/hiện hộp chọn option var trips = Module.TripGetAll(true); _trips = new List <SailsTrip>(); if (!string.IsNullOrWhiteSpace(Request["d"]) && Request["d"] == "3") { foreach (SailsTrip trip in trips) { if (trip.NumberOfDay == 3) { if (ActiveCruise.Trips.Contains(trip)) { _trips.Add(trip); } } } } else { foreach (SailsTrip trip in trips) { if (trip.NumberOfDay != 3) { if (ActiveCruise.Trips.Contains(trip)) { _trips.Add(trip); } } } } string visibleIds = string.Empty; foreach (SailsTrip trip in _trips) { if (trip.NumberOfOptions == 2) { visibleIds += "#" + trip.Id + "#"; } } if (!IsPostBack) { ddlStatusType.DataSource = Enum.GetNames(typeof(StatusType)); ddlStatusType.DataBind(); ddlStatusType.Items.RemoveAt(2); ddlStatusType.SelectedIndex = 1; BindTrips(); LoadInfo(); } }
protected void btnUnlockIncome_Click(object sender, EventArgs e) { if (!PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.LOCK_INCOME)) { ShowErrors("You don't have permission to perform this action"); return; } Booking.LockDate = null; Booking.LockBy = null; BookingViewBLL.BookingSaveOrUpdate(Booking); Response.Redirect(Request.RawUrl); }
protected void btnExportRevenueBySale_Click(object sender, EventArgs e) { if (!PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.ACTION_EXPORTREVENUEBYSALE) && !PermissionUtil.UserCheckRole(CurrentUser.Id, (int)Roles.Administrator)) { ShowError("You do not have permission to use this function!"); return; } var bookings = Bookings; RevenueExportBySales(bookings); }
protected void btnExport_Click(object sender, EventArgs e) { if (!PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.ACTION_EXPORTCONGNO) && !PermissionUtil.UserCheckRole(CurrentUser.Id, (int)Roles.Administrator)) { ShowError("You do not have permission to use this function!"); return; } var bookings = Bookings; ReceivableExportByAgency(bookings); }
protected void BookingLoadData() { var currentUserHaveRole = PermissionUtil.UserCheckRole(CurrentUser.Id, (int)Roles.Administrator); var currentUserHavePermisson = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.VIEW_ALLBOOKINGRECEIVABLE); var nvcQueryString = new NameValueCollection(Request.QueryString); if (!currentUserHaveRole && !currentUserHavePermisson) { var salesId = CurrentUser.Id.ToString(); nvcQueryString.Remove("si"); nvcQueryString.Add("si", salesId); } rptBookingList.DataSource = Bookings; rptBookingList.DataBind(); }
public void NavigateVisibleByPermission() { if (CurrentUser == null) { return; } if (PermissionUtil.UserCheckRole(CurrentUser.Id, (int)Roles.Administrator)) { return; } pAddBooking.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_ADDBOOKING); pAddSerialBookings.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_ADDBOOKING); pBookingList.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_BOOKINGLIST); pOrders.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_ORDERREPORT); pBookingDate.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_BOOKINGREPORT); pBookingReport.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_BOOKINGREPORTPERIOD); pIncomeReport.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_INCOMEREPORT); pReceivable.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_PAYMENTREPORT); pExpenseReport.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_EXPENSEREPORT); pPayable.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_PAYABLELIST); pBalance.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_BALANCEREPORT); pSummary.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_RECEIVABLETOTAL); pAgencyEdit.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_AGENCYEDIT); pAgencyList.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_AGENCYLIST); pAgencyPolicies.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_AGENTLIST); pTripEdit.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_SAILSTRIPEDIT); pTripList.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_SAILSTRIPLIST); pCruiseEdit.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_CRUISESEDIT); pCruiseList.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_CRUISESLIST); pRoomClass.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_ROOMCLASSEDIT); pRoomType.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_ROOMTYPEXEDIT); pRoomEdit.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_ROOMEDIT); pRoomList.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_ROOMLIST); pExtraService.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_EXTRAOPTIONEDIT); pCostingConfig.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_COSTING); pDailyManualCost.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_BOOKINGREPORT); pHaiPhong.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_CRUISECONFIG); pExpensePeriod.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_EXPENSEPERIOD); pCostTypes.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_COSTTYPES); pUSDRate.Visible = PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.FORM_EXCHANGERATE); if (pAddBooking.Visible || pAddSerialBookings.Visible || pBookingList.Visible || pOrders.Visible || pBookingDate.Visible || pBookingReport.Visible) { tabBooking.Visible = true; } else { tabBooking.Visible = false; } if (pIncomeReport.Visible || pReceivable.Visible || pExpenseReport.Visible || pHaiPhongExpenseReport.Visible || pPayable.Visible || pBalance.Visible || pSummary.Visible || pInspection.Visible) { tabReports.Visible = true; } else { tabReports.Visible = false; } if (pAgencyEdit.Visible || pVoucherEdit.Visible || pVoucherList.Visible || pVoucherTemplates.Visible || pAgencyList.Visible || pAgencyPolicies.Visible || pAgencyViewMeetings.Visible || pAgencyLocation.Visible) { tabConfiguration.Visible = true; } else { tabConfiguration.Visible = false; } if (pTripEdit.Visible || pTripList.Visible || pCruiseEdit.Visible || pCruiseList.Visible) { tabTrips.Visible = true; } else { tabTrips.Visible = false; } if (pRoomClass.Visible || pRoomType.Visible || pRoomEdit.Visible || pRoomList.Visible) { tabRoom.Visible = true; } else { tabRoom.Visible = false; } if (pExtraService.Visible || pCostingConfig.Visible || pDailyManualCost.Visible || pExpensePeriod.Visible || pHaiPhong.Visible || pCostTypes.Visible || pUSDRate.Visible) { tabCost.Visible = true; } else { tabCost.Visible = false; } }