private void xrTableCellPeriodName_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { XRTableCell cell = sender as XRTableCell; if (cell == null) { return; } int id = 0; if (string.IsNullOrEmpty(cell.Text)) { return; } Int32.TryParse(cell.Text, out id); if (id == 0) { return; } BusinessLogicLayer.Entity.PPM.ExamCenterRequiredExam exCenter = new BusinessLogicLayer.Entity.PPM.ExamCenterRequiredExam(id); if (exCenter == null) { return; } BusinessLogicLayer.Entity.PPM.ExamPeriod period = new BusinessLogicLayer.Entity.PPM.ExamPeriod(exCenter.ExamPeriodID.Value); if (period == null) { return; } cell.Text = period.Name; }
public ActionResult ExamPeriodGridViewPartialUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] Qiyas.BusinessLogicLayer.Entity.PPM.ExamPeriod item) { ViewBag.ExamYear = Convert.ToInt32(BusinessLogicLayer.Tools.GregToHijriYear(DateTime.Today)); if (ModelState.IsValid) { try { if (!ExamPeriodExists(item.Name, item.ExamPeriodID)) { if (item.EndDate > item.StartDate) { ViewData["EditError"] = "تاريخ البداية يجب ان يكون اقل من تاريخ النهاية"; } else { BusinessLogicLayer.Entity.PPM.ExamPeriod period = new BusinessLogicLayer.Entity.PPM.ExamPeriod(item.ExamPeriodID); period.Name = item.Name; period.ExamTypeID = item.ExamTypeID; period.IsActive = item.IsActive; period.StudentGenderID = item.StudentGenderID; period.ExamYear = item.ExamYear; period.StartDate = item.StartDate; period.EndDate = item.EndDate; period.ModifiedDate = DateTime.Now; period.CreatedDate = DateTime.Now; period.Save(); } } else { ViewData["EditError"] = Resources.MainResource.ExamSpecialityTitle; } } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = Resources.MainResource.PleaseCorrectErrors; } var model = new BusinessLogicLayer.Components.PPM.ExamPeriodLogic().GetAll(); return(PartialView("_ExamPeriodGridViewPartial", model)); }
private bool ExamPeriodExists(string name, int id) { var currentUser = new BusinessLogicLayer.Entity.PPM.ExamPeriod(id); var checkUser = new BusinessLogicLayer.Components.PPM.ExamPeriodLogic().GetByName(name); if (checkUser == null) { return(false); } if (!currentUser.HasObject && checkUser != null) { return(true); } else if (currentUser.HasObject && checkUser != null && currentUser.ExamPeriodID != checkUser.ExamPeriodID) { return(true); } return(false); }
private void xrLabelExamPeriodName_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { XRLabel cell = sender as XRLabel; if (cell == null || string.IsNullOrEmpty(cell.Text)) { return; } BusinessLogicLayer.Entity.PPM.ExamCenterRequiredExam exCenter = new BusinessLogicLayer.Entity.PPM.ExamCenterRequiredExam(Convert.ToInt32(cell.Text)); if (exCenter == null) { return; } BusinessLogicLayer.Entity.PPM.ExamPeriod ExamPeriod = new BusinessLogicLayer.Entity.PPM.ExamPeriod(exCenter.ExamPeriodID.Value); if (ExamPeriod == null) { return; } cell.Text = ExamPeriod.Name; }
public ActionResult ExamPeriodGridViewPartialDelete(System.Int32 ExamPeriodID) { ViewBag.ExamYear = Convert.ToInt32(BusinessLogicLayer.Tools.GregToHijriYear(DateTime.Today)); if (ExamPeriodID >= 0) { try { BusinessLogicLayer.Components.PPM.ExamPeriodLogic logic = new BusinessLogicLayer.Components.PPM.ExamPeriodLogic(); if (!logic.HasDependencies(ExamPeriodID)) { BusinessLogicLayer.Entity.PPM.ExamPeriod type = new BusinessLogicLayer.Entity.PPM.ExamPeriod(ExamPeriodID); type.Delete(); } } catch (Exception e) { ViewData["EditError"] = e.Message; } } var model = new BusinessLogicLayer.Components.PPM.ExamPeriodLogic().GetAll(); return(PartialView("_ExamPeriodGridViewPartial", model)); }