示例#1
0
        public ActionResult CandidatePreselectionAdd(CandidateDTO DataNewCandidate, HttpPostedFileBase Pict, HttpPostedFileBase Cv)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    //process add will return list object, [0] is return from db.saveCahnge() and [1] return candidate_id (CA******)
                    var ProcessAdd = Manage_CandidateDTO.AddData(DataNewCandidate, Pict, Cv);

                    if (Convert.ToInt16(ProcessAdd[0]) > 0)
                    {
                        TempData.Add("message", "New Candidate added successfully");
                        TempData.Add("type", "success");

                        UserLogingUtils.SaveLoggingUserActivity("add new Candidate" + Convert.ToString(ProcessAdd[1]));
                    }
                    else
                    {
                        TempData.Add("message", "New Candidate failed to add");
                        TempData.Add("type", "warning");
                    }
                    return(Redirect("~/candidate/preselection"));
                }

                TempData.Add("message", "New Candidate failed to add, please complete form add");
                TempData.Add("type", "danger");

                return(Redirect("~/candidate/preselection"));
            }
            catch (Exception)
            {
                return(Redirect("~/auth/error"));
            }
        }
示例#2
0
        public ActionResult JobExpEdit(CandidateJobExperienceDTO NewJobExp)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    using (DBEntities db = new DBEntities())
                    {
                        var ProcessAdd = Manage_CandidateJobExperienceDTO.EditData(NewJobExp);

                        if (ProcessAdd > 0)
                        {
                            TempData.Add("message", "Candidate job experience edited successfully");
                            TempData.Add("type", "success");
                            UserLogingUtils.SaveLoggingUserActivity("edit job experience Candidate " + NewJobExp.CANDIDATE_ID + " Job Experience in " + NewJobExp.COMPANY_NAME);
                        }
                        else
                        {
                            TempData.Add("message", "Candidate job experience failed to edit");
                            TempData.Add("type", "warning");
                        }
                        return(Redirect("~/candidate/preselection/create/jobExp"));
                    }
                }

                TempData.Add("message", "Candidate job experience failed to edit please complete form edit");
                TempData.Add("type", "danger");
                return(Redirect("~/candidate/preselection/read/detailcandidate/" + NewJobExp.CANDIDATE_ID));
            }
            catch (Exception)
            {
                return(Redirect("~/auth/error"));
            }
        }
示例#3
0
        public ActionResult CandidateEdit(CandidateDTO Data, HttpPostedFileBase Pict, HttpPostedFileBase Cv)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var ProcessEdit = Manage_CandidateDTO.EditCandidate(Data, Pict, Cv);

                    if (ProcessEdit > 0)
                    {
                        TempData.Add("message", "Candidate Update successfully");
                        TempData.Add("type", "success");
                        UserLogingUtils.SaveLoggingUserActivity("Edit Candidate" + Manage_CandidateDTO.GetDataCandidate().FirstOrDefault(d => d.ID == Data.ID));
                    }
                    else
                    {
                        TempData.Add("message", "Candidate failed to Update");
                        TempData.Add("type", "warning");
                    }

                    return(Redirect("~/candidate/preselection/read/detailcandidate/" + Data.ID));
                }
                TempData.Add("message", "Candidate failed to Update, please complete form edit");
                TempData.Add("type", "danger");
                return(Redirect("~/candidate/preselection/read/detailcandidate/" + Data.ID));
            }
            catch
            {
                return(Redirect("~/auth/error"));
            }
        }