Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
        public ActionResult ExamCenterGridViewPartial()
        {
            var model = new BusinessLogicLayer.Components.PPM.ExamCenterLogic().GetAll();

            return(PartialView("_ExamCenterGridViewPartial", model));
        }