コード例 #1
0
        public ActionResult DeleteExactSpecialization(ExactSpecializationsViewModel ExactSpecializationsVM)
        {
            ExactSpecializationsBLL ExactSpecializationBLL = new ExactSpecializationsBLL();

            ExactSpecializationBLL.ExactSpecializationID = ExactSpecializationsVM.ExactSpecializationID;
            ExactSpecializationBLL.LoginIdentity         = UserIdentity;
            Result result = ExactSpecializationBLL.Remove(ExactSpecializationBLL.ExactSpecializationID);

            if (result.EnumMember == ExactSpecializationsValidationEnum.Done.ToString())
            {
            }
            return(Json(new { ExactSpecializationID = ExactSpecializationBLL.ExactSpecializationID }, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ActionResult CreateExactSpecialization(ExactSpecializationsViewModel ExactSpecializationsViewModel)
        {
            ExactSpecializationsBLL ExactSpecializationBLL = new ExactSpecializationsBLL();

            ExactSpecializationBLL.ExactSpecializationName = ExactSpecializationsViewModel.ExactSpecializationName;
            ExactSpecializationBLL.GeneralSpecialization   = new GeneralSpecializationsBLL()
            {
                GeneralSpecializationID = ExactSpecializationsViewModel.GeneralSpecializationID
            };
            ExactSpecializationBLL.LoginIdentity = UserIdentity;
            Result result = ExactSpecializationBLL.Add();

            if (result.EnumMember == ExactSpecializationsValidationEnum.Done.ToString())
            {
            }
            return(Json(new { ExactSpecializationID = ExactSpecializationBLL.ExactSpecializationID }, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        private ExactSpecializationsViewModel GetByExactSpecializationID(int id)//ExactSpecializationsViewModel ExactSpecializationsViewModel
        {
            ExactSpecializationsBLL       ExactSpecializationBLL = new ExactSpecializationsBLL().GetByExactSpecializationID(id);
            ExactSpecializationsViewModel ExactSpecializationsVM = new ExactSpecializationsViewModel();

            if (ExactSpecializationBLL != null)
            {
                ExactSpecializationsVM.ExactSpecializationID     = ExactSpecializationBLL.ExactSpecializationID;
                ExactSpecializationsVM.ExactSpecializationName   = ExactSpecializationBLL.ExactSpecializationName;
                ExactSpecializationsVM.QualificationDegreeID     = ExactSpecializationBLL.GeneralSpecialization.Qualification.QualificationDegree.QualificationDegreeID;
                ExactSpecializationsVM.QualificationID           = ExactSpecializationBLL.GeneralSpecialization.Qualification.QualificationID;
                ExactSpecializationsVM.GeneralSpecializationID   = ExactSpecializationBLL.GeneralSpecialization.GeneralSpecializationID;
                ExactSpecializationsVM.QualificationDegreeName   = ExactSpecializationBLL.GeneralSpecialization.Qualification.QualificationDegree.QualificationDegreeName;
                ExactSpecializationsVM.QualificationName         = ExactSpecializationBLL.GeneralSpecialization.Qualification.QualificationName;
                ExactSpecializationsVM.GeneralSpecializationName = ExactSpecializationBLL.GeneralSpecialization.GeneralSpecializationName;
            }
            return(ExactSpecializationsVM);
        }
コード例 #4
0
        public ActionResult EditExactSpecialization(ExactSpecializationsViewModel ExactSpecializationsVM)
        {
            ExactSpecializationsBLL ExactSpecializationBLL = new ExactSpecializationsBLL();

            ExactSpecializationBLL.ExactSpecializationID   = ExactSpecializationsVM.ExactSpecializationID;
            ExactSpecializationBLL.ExactSpecializationName = ExactSpecializationsVM.ExactSpecializationName;
            ExactSpecializationBLL.GeneralSpecialization   = new GeneralSpecializationsBLL()
            {
                GeneralSpecializationID = ExactSpecializationsVM.GeneralSpecializationID
            };
            ExactSpecializationBLL.LoginIdentity = UserIdentity;
            Result result = ExactSpecializationBLL.Update();

            if (result.EnumMember == ExactSpecializationsValidationEnum.Done.ToString())
            {
            }
            else if (result.EnumMember == ExactSpecializationsValidationEnum.RejectedBecauseOfThisExactSpecializationExistsInEmployeesQualifications.ToString())
            {
                throw new CustomException(Resources.Globalization.ValidationThisExactSpecializationExistsInEmployeesQualificationsText);
            }
            return(Json(new { ExactSpecializationID = ExactSpecializationBLL.ExactSpecializationID }, JsonRequestBehavior.AllowGet));
        }