/* INDEX **********************************************************************************************************************************************/ // GET: LessonSessions public ActionResult Index(int?rss, string FILTER_Keyword, string FILTER_InvoiceNo, int?FILTER_Cancelled, bool?FILTER_chkDateFrom, DateTime?FILTER_DateFrom, bool?FILTER_chkDateTo, DateTime?FILTER_DateTo) { if (!UserAccountsController.getUserAccess(Session).LessonSessions_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } if (UtilWebMVC.hasNoFilter(FILTER_Keyword, FILTER_InvoiceNo, FILTER_Cancelled, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo)) { FILTER_chkDateFrom = true; FILTER_DateFrom = Helper.getCurrentDateTime(); if (UserAccountsController.getUserAccount(Session).Roles_List.Contains(SettingsController.get().StudentRole.ToString())) { FILTER_Cancelled = 0; } } setViewBag(FILTER_Keyword, FILTER_InvoiceNo, FILTER_Cancelled, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo); if (rss != null) { ViewBag.RemoveDatatablesStateSave = rss; return(View()); } else { List <LessonSessionsModel> models = get(FILTER_Keyword, FILTER_InvoiceNo, FILTER_Cancelled, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo) .OrderByDescending(x => x.Timestamp).ToList(); return(View(models)); } }
/* INDEX **********************************************************************************************************************************************/ public ActionResult IncomeStatement(int?rss, int?FILTER_Approved, bool?FILTER_chkDateFrom, DateTime?FILTER_DateFrom, bool?FILTER_chkDateTo, DateTime?FILTER_DateTo) { if (!UserAccountsController.getUserAccess(Session).PayrollPayments_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo); if (rss != null) { ViewBag.RemoveDatatablesStateSave = rss; return(View()); } else { FILTER_chkDateFrom = true; FILTER_DateFrom = new DateTime(DateTime.Now.AddYears(-1).Year, 1, 1); FILTER_chkDateTo = false; setViewBag(FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo); List <IncomeStatementModel> models = get(Session, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo); ViewBag.Data = compileChartData(models); return(View(models)); } }
/* INDEX **********************************************************************************************************************************************/ // GET: UserAccounts public ActionResult Index(int?rss, string FILTER_Keyword, int?FILTER_Active, Guid?FILTER_Languages_Id) { if (!UserAccountsController.getUserAccess(Session).UserAccounts_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_Keyword, FILTER_Active, FILTER_Languages_Id); if (rss != null) { ViewBag.RemoveDatatablesStateSave = rss; return(View()); } else { if (UtilWebMVC.hasNoFilter(FILTER_Keyword, FILTER_Active, FILTER_Languages_Id)) { return(View()); } else { string roles = ""; if (!getUserAccess(Session).UserAccounts_EditRoles) { roles = SettingsController.get().StudentRole.ToString(); } return(View(get(null, null, FILTER_Keyword, FILTER_Active, FILTER_Languages_Id, roles, false))); } } }
public ActionResult Edit(SettingsModel modifiedModel, List <HttpPostedFileBase> uploadFiles) { if (!UserAccountsController.getUserAccess(Session).Settings_Edit) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } if (ModelState.IsValid) { //Prepare changes SettingsModel originalModel = get(); string log = string.Empty; log = addLog(log, SettingsModel.COL_AutoEntryForCashPayments.Id, SettingsModel.COL_AutoEntryForCashPayments.Display, db.PettyCashRecordsCategories.Where(x => x.Id == originalModel.AutoEntryForCashPayments).FirstOrDefault().Name, db.PettyCashRecordsCategories.Where(x => x.Id == modifiedModel.AutoEntryForCashPayments).FirstOrDefault().Name, "Update: '{1}'"); log = addLog(log, SettingsModel.COL_AutoEntryForCashPayments.Id, SettingsModel.COL_AutoEntryForCashPayments.Display, originalModel.AutoEntryForCashPayments_Notes, modifiedModel.AutoEntryForCashPayments_Notes, "Notes: '{1}'"); log = addLog(log, SettingsModel.COL_StudentRole.Id, SettingsModel.COL_StudentRole.Display, originalModel.StudentRole == null ? "" : db.UserAccountRoles.Where(x => x.Id == originalModel.StudentRole).FirstOrDefault().Name, modifiedModel.StudentRole == null ? "" : db.UserAccountRoles.Where(x => x.Id == modifiedModel.StudentRole).FirstOrDefault().Name, "Update: '{1}'"); log = addLog(log, SettingsModel.COL_StudentRole.Id, SettingsModel.COL_StudentRole.Display, originalModel.StudentRole_Notes, modifiedModel.StudentRole_Notes, "Notes: '{1}'"); log = addLog(log, SettingsModel.COL_TutorRole.Id, SettingsModel.COL_TutorRole.Display, originalModel.TutorRole == null ? "" : db.UserAccountRoles.Where(x => x.Id == originalModel.TutorRole).FirstOrDefault().Name, modifiedModel.TutorRole == null ? "" : db.UserAccountRoles.Where(x => x.Id == modifiedModel.TutorRole).FirstOrDefault().Name, "Update: '{1}'"); log = addLog(log, SettingsModel.COL_TutorRole.Id, SettingsModel.COL_TutorRole.Display, originalModel.TutorRole_Notes, modifiedModel.TutorRole_Notes, "Notes: '{1}'"); log = addLog(log, SettingsModel.COL_ResetPassword.Id, SettingsModel.COL_ResetPassword.Display, originalModel.ResetPassword, modifiedModel.ResetPassword, "UPDATE: '{1}'"); log = addLog(log, SettingsModel.COL_ResetPassword.Id, SettingsModel.COL_ResetPassword.Display, originalModel.ResetPassword_Notes, modifiedModel.ResetPassword_Notes, "Notes: '{1}'"); log = addLogForList <UserAccountRolesModel>(log, SettingsModel.COL_FullAccessForTutorSchedules.Id, SettingsModel.COL_FullAccessForTutorSchedules.Display, originalModel.FullAccessForTutorSchedules_List, modifiedModel.FullAccessForTutorSchedules_List); log = addLog(log, SettingsModel.COL_FullAccessForTutorSchedules.Id, SettingsModel.COL_FullAccessForTutorSchedules.Display, originalModel.FullAccessForTutorSchedules_Notes, modifiedModel.FullAccessForTutorSchedules_Notes, "Notes: '{1}'"); log = addLogForList <UserAccountRolesModel>(log, SettingsModel.COL_ShowOnlyOwnUserData.Id, SettingsModel.COL_ShowOnlyOwnUserData.Display, originalModel.ShowOnlyOwnUserData_List, modifiedModel.ShowOnlyOwnUserData_List); log = addLog(log, SettingsModel.COL_ShowOnlyOwnUserData.Id, SettingsModel.COL_ShowOnlyOwnUserData.Display, originalModel.ShowOnlyOwnUserData_Notes, modifiedModel.ShowOnlyOwnUserData_Notes, "Notes: '{1}'"); log = addLogForList <UserAccountRolesModel>(log, SettingsModel.COL_PayrollRatesRoles.Id, SettingsModel.COL_PayrollRatesRoles.Display, originalModel.PayrollRatesRoles_List, modifiedModel.PayrollRatesRoles_List); log = addLog(log, SettingsModel.COL_PayrollRatesRoles.Id, SettingsModel.COL_PayrollRatesRoles.Display, originalModel.PayrollRatesRoles_Notes, modifiedModel.PayrollRatesRoles_Notes, "Notes: '{1}'"); //Update Database if (string.IsNullOrEmpty(log)) { UtilWebMVC.setBootboxMessage(this, "No change to update"); } else { update(modifiedModel); //update setting values db.SaveChanges(); //insert activity logs UtilWebMVC.setBootboxMessage(this, log); return(RedirectToAction(nameof(Edit))); } } setViewBag(modifiedModel); return(View(modifiedModel)); }
/* CREATE *********************************************************************************************************************************************/ // GET: StudentSchedules/Create public ActionResult Create(string FILTER_Keyword, string FILTER_UserAccounts_Name, string FILTER_Custom, DayOfWeekEnum?DayOfWeek, string StartTime, Guid?Id, string Name) { if (!UserAccountsController.getUserAccess(Session).StudentSchedules_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_Keyword, FILTER_UserAccounts_Name, FILTER_Custom); StudentSchedulesModel model = new StudentSchedulesModel(); if (Id != null) { model.Tutor_UserAccounts_Id = (Guid)Id; model.Tutor_UserAccounts_Name = Name; } if (DayOfWeek != null) { model.DayOfWeek = (DayOfWeekEnum)DayOfWeek; } if (!string.IsNullOrEmpty(StartTime)) { model.StartTime = Util.standardizeTimeToIgnoreDate(StartTime); model.EndTime = model.StartTime.AddHours(1); } return(View(model)); }
/* INDEX **********************************************************************************************************************************************/ // GET: PettyCashRecords public ActionResult Index(int?rss, string FILTER_Keyword, int?FILTER_Approved, bool?FILTER_chkDateFrom, DateTime?FILTER_DateFrom, bool?FILTER_chkDateTo, DateTime?FILTER_DateTo) { if (!UserAccountsController.getUserAccess(Session).PettyCashRecords_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } if (rss != null && FILTER_DateFrom == null) { FILTER_chkDateFrom = true; FILTER_DateFrom = DateTime.Today.AddMonths(-1); } setViewBag(FILTER_Keyword, FILTER_Approved, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo); if (rss != null) { ViewBag.RemoveDatatablesStateSave = rss; return(View()); } else { return(View(get(FILTER_Keyword, FILTER_Approved, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo))); } }
/* INDEX **********************************************************************************************************************************************/ // GET: SaleInvoices public ActionResult Index(int?rss, string FILTER_Keyword, string FILTER_PaymentNo, int?FILTER_Cancelled, int?FILTER_Approved, int?FILTER_HasDueAmount, bool?FILTER_chkDateFrom, DateTime?FILTER_DateFrom, bool?FILTER_chkDateTo, DateTime?FILTER_DateTo) { if (!UserAccountsController.getUserAccess(Session).SaleInvoices_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } if (UtilWebMVC.hasNoFilter(FILTER_Keyword, FILTER_PaymentNo, FILTER_Cancelled, FILTER_Approved, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo)) { //FILTER_chkDateFrom = true; //FILTER_DateFrom = Helper.getCurrentDateTime(); FILTER_Cancelled = 0; if (UserAccountsController.getUserAccount(Session).Roles_List.Contains(SettingsController.get().StudentRole.ToString())) { FILTER_HasDueAmount = null; } else { FILTER_HasDueAmount = 1; } } setViewBag(FILTER_Keyword, FILTER_PaymentNo, FILTER_Cancelled, FILTER_Approved, FILTER_HasDueAmount, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo); ViewBag.RemoveDatatablesStateSave = rss; List <SaleInvoicesModel> models = get(FILTER_Keyword, FILTER_PaymentNo, FILTER_Cancelled, FILTER_Approved, FILTER_HasDueAmount, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo) .OrderByDescending(x => x.No).ToList(); return(View(models)); }
/* CREATE *********************************************************************************************************************************************/ // GET: Payments/Create public ActionResult Create(string id) { if (!UserAccountsController.getUserAccess(Session).Payments_Add) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } return(setCreateViewBagsAndReturn(id)); }
/* CREATE *********************************************************************************************************************************************/ public ActionResult Create() { if (!UserAccountsController.getUserAccess(Session).Reminders_Add) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } return(View(new RemindersModel())); }
/* CREATE *********************************************************************************************************************************************/ // GET: LessonPackages/Create public ActionResult Create(string FILTER_Keyword, int?FILTER_Active, Guid?FILTER_Languages_Id, Guid?FILTER_LessonTypes_Id) { if (!UserAccountsController.getUserAccess(Session).LessonPackages_Add) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_Keyword, FILTER_Active, FILTER_Languages_Id, FILTER_LessonTypes_Id); return(View(new LessonPackagesModel())); }
/* CREATE *********************************************************************************************************************************************/ // GET: TutorSchedules/Create public ActionResult Create(string FILTER_Keyword, int?FILTER_Active) { if (!UserAccountsController.getUserAccess(Session).TutorSchedules_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_Keyword, FILTER_Active); return(View(new TutorSchedulesModel())); }
/* CREATE *********************************************************************************************************************************************/ // GET: PettyCashRecordsCategories/Create public ActionResult Create(string FILTER_Keyword, int?FILTER_Active) { if (!UserAccountsController.getUserAccess(Session).PettyCashRecordsCategories_Add) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_Keyword, FILTER_Active); return(View(new PettyCashRecordsCategoriesModel())); }
/* CREATE *********************************************************************************************************************************************/ // GET: Consignments/Create public ActionResult Create(string FILTER_Keyword, int?FILTER_Active, Guid?FILTER_Branches_Id) { if (!UserAccountsController.getUserAccess(Session).Consignments_Add) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_Keyword, FILTER_Active, FILTER_Branches_Id); return(View(new ConsignmentsModel())); }
/* CREATE *********************************************************************************************************************************************/ // GET: HourlyRates/Create public ActionResult Create(string FILTER_Keyword) { if (!UserAccountsController.getUserAccess(Session).HourlyRates_Add) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_Keyword); return(View(new HourlyRatesModel())); }
/* INDEX **********************************************************************************************************************************************/ // GET: Payrolls public ActionResult Index(int?rss, DateTime?FILTER_DatePeriod) { if (!UserAccountsController.getUserAccess(Session).PayrollPayments_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_DatePeriod); ViewBag.RemoveDatatablesStateSave = rss; return(View()); }
/* INDEX **********************************************************************************************************************************************/ // GET: UserAccountRoles public ActionResult Index(int?rss) { if (!UserAccountsController.getUserAccess(Session).UserAccountRoles_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } ViewBag.RemoveDatatablesStateSave = rss; return(View(get())); }
/* CREATE *********************************************************************************************************************************************/ // GET: PettyCashRecords/Create public ActionResult Create(string FILTER_Keyword, int?FILTER_Approved, bool?FILTER_chkDateFrom, DateTime?FILTER_DateFrom, bool?FILTER_chkDateTo, DateTime?FILTER_DateTo) { if (!UserAccountsController.getUserAccess(Session).PettyCashRecords_Add) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_Keyword, FILTER_Approved, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo); return(View(new PettyCashRecordsModel())); }
/* CREATE *********************************************************************************************************************************************/ // GET: SaleInvoices/Create public ActionResult Create(string FILTER_Keyword, string FILTER_PaymentNo, int?FILTER_Cancelled, int?FILTER_Approved, int?FILTER_HasDueAmount, bool?FILTER_chkDateFrom, DateTime?FILTER_DateFrom, bool?FILTER_chkDateTo, DateTime?FILTER_DateTo) { if (!UserAccountsController.getUserAccess(Session).SaleInvoices_Add) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_Keyword, FILTER_PaymentNo, FILTER_Cancelled, FILTER_Approved, FILTER_HasDueAmount, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo); return(View(new SaleInvoicesModel())); }
public JsonResult Ajax_GetDetails(Guid id) { UserAccountRolesModel access = UserAccountsController.getUserAccess(Session); List <PaymentItemsModel> models = PaymentItemsController.get(null, id); string content = string.Format(@" <div class='table-responsive'> <table class='table table-striped table-bordered'> <thead> <tr> <th>Invoice</th> <th class='text-right'>Due before</th> <th class='text-right'>Payment</th> <th class='text-right'>Due now</th> </tr> </thead> <tbody> "); string saleInvoiceLink; foreach (PaymentItemsModel model in models) { saleInvoiceLink = !access.SaleInvoices_View ? model.SaleInvoices_No : string.Format("<a href='/SaleInvoices?FILTER_chkDateFrom=false&FILTER_chkDateTo=false&FILTER_Keyword={0}' target='_blank'>{0}</a>", model.SaleInvoices_No); content += string.Format(@" <tr> <td style='width:50px;'>{0}</td> <td class='text-right'>{1:N0}</td> <td class='text-right'><strong>{2:N0}</strong></td> <td class='text-right'>{3:N0}</td> </tr> ", saleInvoiceLink, model.DueBefore, model.Amount, model.DueAfter ); } PaymentsModel payment = get(id); content += string.Format(@" </tbody></table></div> <div class='mt-2'> <div class='h3 ml-2 float-right font-weight-bold'>TOTAL: {0:N0}</div> </div> ", payment.CashAmount + payment.DebitAmount + payment.ConsignmentAmount ); return(Json(new { content = content }, JsonRequestBehavior.AllowGet)); }
/* CREATE *********************************************************************************************************************************************/ // GET: LessonSessions/Create public ActionResult Create(string FILTER_Keyword, string FILTER_InvoiceNo, int?FILTER_Cancelled, bool?FILTER_chkDateFrom, DateTime?FILTER_DateFrom, bool?FILTER_chkDateTo, DateTime?FILTER_DateTo) { if (!UserAccountsController.getUserAccess(Session).LessonSessions_Add) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_Keyword, FILTER_InvoiceNo, FILTER_Cancelled, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo); return(View(new LessonSessionsModel())); }
public ActionResult Edit(LessonSessionsModel modifiedModel, string FILTER_Keyword, string FILTER_InvoiceNo, int?FILTER_Cancelled, bool?FILTER_chkDateFrom, DateTime?FILTER_DateFrom, bool?FILTER_chkDateTo, DateTime?FILTER_DateTo) { if (ModelState.IsValid) { LessonSessionsModel originalModel = get(modifiedModel.Id); //without the specified access, some fields are excluded in edit form resulting in no value. Copy values from original model if (!UserAccountsController.getUserAccess(Session).LessonSessions_Edit) { modifiedModel.HourlyRates_Rate = originalModel.HourlyRates_Rate; modifiedModel.TravelCost = originalModel.TravelCost; modifiedModel.TutorTravelCost = originalModel.TutorTravelCost; } string log = string.Empty; log = Helper.append(log, originalModel.HourlyRates_Rate, modifiedModel.HourlyRates_Rate, LessonSessionsModel.COL_HourlyRates_Rate.LogDisplay); log = Helper.append(log, originalModel.TravelCost, modifiedModel.TravelCost, LessonSessionsModel.COL_TravelCost.LogDisplay); log = Helper.append(log, originalModel.TutorTravelCost, modifiedModel.TutorTravelCost, LessonSessionsModel.COL_TutorTravelCost.LogDisplay); log = Helper.append(log, originalModel.Review, modifiedModel.Review, LessonSessionsModel.COL_Review.LogDisplay); log = Helper.append(log, originalModel.InternalNotes, modifiedModel.InternalNotes, LessonSessionsModel.COL_InternalNotes.LogDisplay); if (!string.IsNullOrEmpty(log)) { update(modifiedModel, log); //update payrollitem if rate or travel cost is changed //Tutor Travel Cost is not currently checked against total travel cost amount paid by customer. This edit may cause cost to exceed amount paid by customer. PayrollPaymentItemsModel payrollPaymentItem = PayrollPaymentItemsController.get(Session, originalModel.PayrollPaymentItems_Id); //this is necessary for payrollpaymentitems that has multiple lessonsessions (class) payrollPaymentItem.HourlyRate += (modifiedModel.HourlyRates_Rate - originalModel.HourlyRates_Rate); payrollPaymentItem.TutorTravelCost += (modifiedModel.TutorTravelCost - originalModel.TutorTravelCost); payrollPaymentItem.Amount = PayrollPaymentItemsController.calculateAmount(originalModel.IsWaiveTutorFee, payrollPaymentItem.Hour, payrollPaymentItem.HourlyRate, modifiedModel.TutorTravelCost); PayrollPaymentItemsController.update(db, Session, payrollPaymentItem); } return(RedirectToAction(nameof(Index), new { FILTER_Keyword = FILTER_Keyword, FILTER_InvoiceNo = FILTER_InvoiceNo, FILTER_Cancelled = FILTER_Cancelled, FILTER_chkDateFrom = FILTER_chkDateFrom, FILTER_DateFrom = FILTER_DateFrom, FILTER_chkDateTo = FILTER_chkDateTo, FILTER_DateTo = FILTER_DateTo })); } setViewBag(FILTER_Keyword, FILTER_InvoiceNo, FILTER_Cancelled, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo); return(View(modifiedModel)); }
/* EDIT ***********************************************************************************************************************************************/ // GET: Settings/Edit public ActionResult Edit() { if (!UserAccountsController.getUserAccess(Session).Settings_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } SettingsModel model = get(); setViewBag(model); return(View(model)); }
/* PRINT **********************************************************************************************************************************************/ // GET: Payments/Print public ActionResult Print(Guid?id) { if (id == null || !UserAccountsController.getUserAccess(Session).Payments_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } PayrollPaymentsModel model = get(Session, (Guid)id); ViewBag.InvoiceHeaderText = new BranchesController().get(Helper.getActiveBranchId(Session)).InvoiceHeaderText; ViewData["PayrollPaymentItems"] = PayrollPaymentItemsController.get(Session, null, model.Id, null, null, null); ViewBag.TotalAmount = model.Amount; return(View(model)); }
/* EDIT ***********************************************************************************************************************************************/ // GET: TutorSchedules/Edit/{id} public ActionResult Edit(Guid?id, string FILTER_Keyword, int?FILTER_Active) { if (!UserAccountsController.getUserAccess(Session).TutorSchedules_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } if (id == null) { return(RedirectToAction(nameof(Index))); } setViewBag(FILTER_Keyword, FILTER_Active); return(View(get((Guid)id))); }
/* EDIT ***********************************************************************************************************************************************/ // GET: HourlyRates/Edit/{id} public ActionResult Edit(Guid?id, string FILTER_Keyword) { if (!UserAccountsController.getUserAccess(Session).HourlyRates_Edit) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } if (id == null) { return(RedirectToAction(nameof(Index))); } setViewBag(FILTER_Keyword); return(View(get((Guid)id))); }
/* SEARCH *********************************************************************************************************************************************/ public ActionResult Search(string FILTER_Keyword, int?FILTER_Active) { if (!UserAccountsController.getUserAccess(Session).TutorSchedules_View) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } setViewBag(FILTER_Keyword, FILTER_Active); TutorSchedulesModel model = new TutorSchedulesModel(); model.StartTime = new DateTime(1970, 1, 1, 8, 0, 0); model.EndTime = new DateTime(1970, 1, 1, 20, 0, 0); LanguagesController.setDropDownListViewBag(this); return(View(model)); }
/* EDIT ***********************************************************************************************************************************************/ // GET: LessonPackages/Edit/{id} public ActionResult Edit(Guid?id, string FILTER_Keyword, int?FILTER_Active, Guid?FILTER_Languages_Id, Guid?FILTER_LessonTypes_Id) { if (!UserAccountsController.getUserAccess(Session).LessonPackages_Edit) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } if (id == null) { return(RedirectToAction(nameof(Index))); } setViewBag(FILTER_Keyword, FILTER_Active, FILTER_Languages_Id, FILTER_LessonTypes_Id); return(View(get((Guid)id))); }
/* EDIT ***********************************************************************************************************************************************/ // GET: UserAccountRoles/Edit/{id} public ActionResult Edit(Guid?id) { if (!UserAccountsController.getUserAccess(Session).UserAccountRoles_Edit) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } if (id == null) { return(RedirectToAction(nameof(Index))); } var model = get(id); return(View(model)); }
/* EDIT ***********************************************************************************************************************************************/ // GET: LessonSessions/Edit/{id} public ActionResult Edit(Guid?id, string FILTER_Keyword, string FILTER_InvoiceNo, int?FILTER_Cancelled, bool?FILTER_chkDateFrom, DateTime?FILTER_DateFrom, bool?FILTER_chkDateTo, DateTime?FILTER_DateTo) { if (!UserAccountsController.getUserAccess(Session).LessonSessions_Edit&& !UserAccountsController.getUserAccess(Session).LessonSessions_EditReviewAndInternalNotes) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } if (id == null) { return(RedirectToAction(nameof(Index))); } setViewBag(FILTER_Keyword, FILTER_InvoiceNo, FILTER_Cancelled, FILTER_chkDateFrom, FILTER_DateFrom, FILTER_chkDateTo, FILTER_DateTo); return(View(get(id.Value))); }
/* EDIT ***********************************************************************************************************************************************/ public ActionResult Edit(Guid?Id) { if (!UserAccountsController.getUserAccess(Session).Reminders_Edit) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } if (Id == null) { return(RedirectToAction(nameof(HomeController.Index), "Home")); } RemindersModel model = db.Reminders.Where(x => x.Id == Id).FirstOrDefault(); return(View(model)); }