Пример #1
0
        public ActionResult ExamCenterGridViewPartialDelete(System.Int32 ExaminationCenterID)
        {
            if (ExaminationCenterID >= 0)
            {
                try
                {
                    BusinessLogicLayer.Components.Persons.StateProvinceLogic logic = new BusinessLogicLayer.Components.Persons.StateProvinceLogic();
                    if (!logic.HasDependencies(ExaminationCenterID))
                    {
                        Qiyas.BusinessLogicLayer.Entity.PPM.ExamCenter center = new BusinessLogicLayer.Entity.PPM.ExamCenter(ExaminationCenterID);
                        center.Delete();
                    }
                    else
                    {
                        ViewData["EditError"] = Resources.MainResource.ExamCenterHasAssociatedData;
                    }
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            var model = new BusinessLogicLayer.Components.PPM.ExamCenterLogic().GetAll();

            return(PartialView("_ExamCenterGridViewPartial", model));
        }
Пример #2
0
        public ActionResult ExamCenterGridViewPartialAddNew([ModelBinder(typeof(DevExpressEditorsBinder))] Qiyas.BusinessLogicLayer.Entity.PPM.ExamCenter item)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    try
                    {
                        if (!ExamCenterExists(item.CenterCode, item.ExaminationCenterID))
                        {
                            Qiyas.BusinessLogicLayer.Entity.PPM.ExamCenter center = new BusinessLogicLayer.Entity.PPM.ExamCenter();
                            center.CityID          = item.CityID;
                            center.Name            = item.Name;
                            center.StudentGenderID = item.StudentGenderID;
                            center.ModifiedDate    = DateTime.Now;
                            center.CreatedDate     = DateTime.Now;
                            center.CenterCode      = item.CenterCode;
                            center.IsActive        = item.IsActive;
                            center.Save();
                        }
                        else
                        {
                            ViewData["EditError"] = Resources.MainResource.ExamCenterExistsCheck;
                        }
                    }
                    catch (Exception e)
                    {
                        ViewData["EditError"] = e.Message;
                    }
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = Resources.MainResource.PleaseCorrectErrors;
            }
            var model = new BusinessLogicLayer.Components.PPM.ExamCenterLogic().GetAll();

            return(PartialView("_ExamCenterGridViewPartial", model));
        }
Пример #3
0
        private bool ExamCenterExists(string code, int id)
        {
            var currentUser = new BusinessLogicLayer.Entity.PPM.ExamCenter(id);
            var checkUser   = new BusinessLogicLayer.Components.PPM.ExamCenterLogic().GetByName(code);

            if (checkUser == null)
            {
                return(false);
            }
            if (!currentUser.HasObject && checkUser != null)
            {
                return(true);
            }
            else if (currentUser.HasObject && checkUser != null && currentUser.ExaminationCenterID != checkUser.ExaminationCenterID)
            {
                return(true);
            }

            return(false);
        }
Пример #4
0
        private void xrTableCellCityandCenter_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.ExamCenter center = new BusinessLogicLayer.Entity.PPM.ExamCenter(exCenter.ExamCenterID.Value);
            if (center == null)
            {
                return;
            }
            BusinessLogicLayer.Entity.Persons.City city = new BusinessLogicLayer.Entity.Persons.City(center.CityID.Value);
            if (city == null)
            {
                return;
            }

            cell.Text = city.Name + " - " + center.Name;
            //BusinessLogicLayer.Entity.PPM.ExamPeriod gender = new BusinessLogicLayer.Entity.PPM.ExamPeriod(exCenter.ExamPeriodID.Value);
            //if (gender == null)
            //    return;
        }
Пример #5
0
        private void xrLabelExamCenter_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.ExamCenter ExamCenter = new BusinessLogicLayer.Entity.PPM.ExamCenter(exCenter.ExamCenterID.Value);
            if (ExamCenter == null)
            {
                return;
            }

            cell.Text = ExamCenter.CenterCode;
        }