Example #1
0
        public ActionResult Create(QualificationModel model, bool continueEditing)
        {
            if (!_permissionService.Authorize("ManageQualifications"))
            {
                return(AccessDeniedView());
            }

            // Check for duplicate classroom, if any
            var checkQualification = _smsService.CheckQualificationExists(model.Name, model.Id);

            if (checkQualification)
            {
                ModelState.AddModelError("Name", "A Qualification with the same name already exists. Please choose a different name.");
            }

            if (ModelState.IsValid)
            {
                var objQualification = model.ToEntity();
                objQualification.CreatedOn = objQualification.ModifiedOn = DateTime.Now;
                objQualification.UserId    = _userContext.CurrentUser.Id;
                _smsService.InsertQualification(objQualification);
                SuccessNotification("Qualification created successfully.");
                if (continueEditing)
                {
                    return(RedirectToAction("Edit", new { id = objQualification.Id }));
                }
            }
            else
            {
                return(View(model));
            }
            return(RedirectToAction("List"));
        }
Example #2
0
        /// <summary>
        /// InsertUserQualificationReln
        /// </summary>
        /// <param name="QM"></param>
        /// <returns></returns>
        public bool InsertUserQualificationReln(QualificationModel QM)
        {
            DynamicParameters parms = new DynamicParameters();

            parms.Add("@UserID", QM.UserID);
            parms.Add("@QualificationID", QM.QualificationID);
            return(new DapperRepository <QualificationModel>().Add("InsertUserQualificationReln", parms));
        }
Example #3
0
        public ActionResult DeleteQualification(int Teacherid, string Schoolid, int Qualificationid)
        {
            QualificationModel TModel = new QualificationModel();

            TModel.Teacher_Id      = Teacherid;
            TModel.SchoolId        = Schoolid;
            TModel.QualificationId = Qualificationid;
            return(PartialView("DeleteTeacherQalification", TModel));
        }
Example #4
0
        public ActionResult Create()
        {
            if (!_permissionService.Authorize("ManageQualifications"))
            {
                return(AccessDeniedView());
            }

            var model = new QualificationModel();

            return(View(model));
        }
Example #5
0
        public ActionResult AddJob(JobModel objMOdel)
        {
            QualificationModel QM  = new QualificationModel();
            JobModel           job = JobService.InsertJob(objMOdel);

            foreach (string s in objMOdel.Qualification)
            {
                QM.JobID           = job.JobID;
                QM.QualificationID = long.Parse(s);
                UserService.InsertUserQualificationReln(QM);
            }
            return(View());
        }
Example #6
0
        private async Task SaveQualification(WaterfallStepContext stepContext, string options)
        {
            var qualificationModel = new QualificationModel();

            qualificationModel.id            = Guid.NewGuid().ToString();
            qualificationModel.idUser        = stepContext.Context.Activity.From.Id;
            qualificationModel.qualification = options;
            qualificationModel.registerDate  = DateTime.Now.Date;

            await _databaseService.Qualification.AddAsync(qualificationModel);

            await _databaseService.SaveAsync();
        }
Example #7
0
        private async Task SaveQualification(WaterfallStepContext stepContext, string options)
        {
            var id       = stepContext.Context.Activity.From.Id;
            var userlast = await _databaseService.User.FirstOrDefaultAsync(x => x.idChannel == id);

            var qualifactionModel = new QualificationModel();

            qualifactionModel.idUser        = userlast.id;
            qualifactionModel.qualification = options;
            qualifactionModel.registerDate  = DateTime.Now;

            _databaseService.Qualification.Add(qualifactionModel);
            _databaseService.SaveChangesSQL();
        }
Example #8
0
 public ActionResult DeleteQualification(QualificationModel Model)
 {
     try
     {
         tblTeacherQualification Tble = Connection.tblTeacherQualifications.Find
                                            (Model.Teacher_Id,
                                            Model.SchoolId,
                                            Model.QualificationId);
         Connection.tblTeacherQualifications.Remove(Tble);
         Connection.SaveChanges();
         return(Json(Model.Teacher_Id, JsonRequestBehavior.AllowGet));
     }
     catch
     {
         return(Json("Error", JsonRequestBehavior.AllowGet));
     }
 }
Example #9
0
        public ActionResult Registration(UserModel objModel)
        {
            QualificationModel QM   = new QualificationModel();
            UserModel          User = UserService.InsertUser(objModel);

            foreach (string s in objModel.Qalification)
            {
                QM.UserID          = User.UserID;
                QM.QualificationID = long.Parse(s);
                UserService.InsertUserQualificationReln(QM);
            }

            List <QualificationModel> objModelQ = new List <QualificationModel>();

            objModelQ = UserService.GetAllQualification();
            return(View(@"~\Views\Login\Index.cshtml", objModelQ));
        }
Example #10
0
        public QualificationListViewModel(QualificationModel model,
                                          INotifyQualificationImageLoaded notifyQualificationImageLoaded,
                                          INotifyQualificationSelected notifyQualificationSelected)
        {
            this.code = model.Code;
            this.notifyQualificationImageLoaded = notifyQualificationImageLoaded;
            this.notifyQualificationSelected    = notifyQualificationSelected;

            picture = new BitmapImage();
            picture.DownloadCompleted += (s, e) =>
            {
                notifyQualificationImageLoaded.ImageLoaded();
            };

            picture.BeginInit();
            picture.UriSource = new Uri(model.PictureUrl);
            picture.EndInit();
        }
Example #11
0
        public ActionResult Edit(int id)
        {
            if (!_permissionService.Authorize("ManageQualifications"))
            {
                return(AccessDeniedView());
            }

            if (id == 0)
            {
                throw new ArgumentNullException("id");
            }

            var model            = new QualificationModel();
            var objQualification = _smsService.GetQualificationById(id);

            if (objQualification != null)
            {
                model = objQualification.ToModel();
            }
            return(View(model));
        }
Example #12
0
        public JsonResult AddQualification(QualificationModel Model)
        {
            try
            {
                var count = Connection.tblTeacherQualifications.Count(u => u.TeacherId == Model.Teacher_Id &&
                                                                      u.QualificationId == Model.QualificationId);
                if (count == 0)
                {
                    tblTeacherQualification NewQ = new tblTeacherQualification();
                    NewQ.CreatedBy       = _session.User_Id;
                    NewQ.CreatedDate     = DateTime.Now;
                    NewQ.IsActive        = "Y";
                    NewQ.QualificationId = Model.QualificationId;
                    NewQ.SchoolId        = _session.School_Id;
                    NewQ.TeacherId       = Model.Teacher_Id;

                    Connection.tblTeacherQualifications.Add(NewQ);
                    Connection.SaveChanges();

                    //result = Model.Teacher_Id.ToString();

                    ViewBag.TeacherId = Model.Teacher_Id.ToString();
                    var result = new { Teacher_Id = Model.Teacher_Id, msg = "Success" };
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    var result = new { Teacher_Id = Model.Teacher_Id, msg = "Exits" };
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception Ex)
            {
                Errorlog.ErrorManager.LogError("Teacher Controller - AddQualification(QualificationModel Model)", Ex);
                var result = new { Teacher_Id = Model.Teacher_Id, msg = "Exception" };
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }
Example #13
0
 /// <summary>
 /// Update Qualification
 /// </summary>
 /// <remarks>
 /// Updates the qualification with the specified ID.
 /// </remarks>
 public void UpdateQualification(int businessId, int id, QualificationModel qualification)
 {
     ApiRequest($"/business/{businessId}/qualification/{id}", qualification, Method.PUT);
 }
Example #14
0
 /// <summary>
 /// Create Qualification
 /// </summary>
 /// <remarks>
 /// Creates a new employee qualification for the business.
 /// </remarks>
 public Task CreateQualificationAsync(int businessId, QualificationModel qualification, CancellationToken cancellationToken = default)
 {
     return(ApiRequestAsync($"/business/{businessId}/qualification", qualification, Method.POST, cancellationToken));
 }
Example #15
0
 /// <summary>
 /// Create Qualification
 /// </summary>
 /// <remarks>
 /// Creates a new employee qualification for the business.
 /// </remarks>
 public void CreateQualification(int businessId, QualificationModel qualification)
 {
     ApiRequest($"/business/{businessId}/qualification", qualification, Method.POST);
 }
Example #16
0
 public static Qualification ToEntity(this QualificationModel model, Qualification destination)
 {
     return(model.MapTo(destination));
 }
 public StudentModel()
 {
     qualification = new QualificationModel();
 }
Example #18
0
 public static bool InsertUserQualificationReln(QualificationModel qualificationModel)
 {
     return(new PropertyDetails().InsertUserQualificationReln(qualificationModel));
 }
Example #19
0
 public static Qualification ToEntity(this QualificationModel model)
 {
     return(model.MapTo <QualificationModel, Qualification>());
 }