Esempio n. 1
0
        public JsonResult GetCandidateByICID(int ICID)
        {
            InterviewCandidateEntity CandidateDetails = null;

            try
            {
                var TktDtl = new InterviewCandidateComponent();
                CandidateDetails = TktDtl.GetCandidateByICID(ICID);
            }
            catch (Exception ex)
            {
                return(null);
            }
            return(Json(CandidateDetails, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        //[HttpPost]
        //public ActionResult CreateInterviewCandidate(string FirstName,string LastName, string Email, string MobileNumber,string Password, int InterviewForPositionname,string AssignmentDate,string AssignmentTime)
        //{
        //    using (var db = new EvolutyzCornerDataEntities())
        //    {

        //        try
        //        {

        //            InterviewCandidate nt = new InterviewCandidate();
        //            UserSessionInfo sessId = new UserSessionInfo();

        //            int IPID = Convert.ToInt32(InterviewForPositionname);
        //            int userID = sessId.UserId;
        //            int accid = sessId.AccountId;
        //            // DateTime date = Convert.ToDateTime(AssignmentDate);
        //           DateTime date = DateTime.ParseExact(AssignmentDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
        //            string pswd = GetMD5(Password);

        //            EvolutyzCornerDataEntities evolutyzData = new EvolutyzCornerDataEntities();

        //            InterviewCandidate Depart = new InterviewCandidate();
        //            InterviewCandidate Departs = new InterviewCandidate();
        //            InterviewCandidate user = new InterviewCandidate();

        //                Depart.Assessment_For_Positionid = IPID;
        //                Depart.FirstName = FirstName;
        //                Depart.LastName = LastName;
        //                Depart.Emailid = Email;
        //                Depart.MobileNo = MobileNumber;
        //                Depart.Password = pswd;
        //                Depart.RecrutementUserid = userID;
        //                Depart.AssessmentDate = date;
        //                Depart.AssessmentTime = AssignmentTime;
        //                Depart.CreatedDate = System.DateTime.Now;
        //                Depart.status = true;

        //                evolutyzData.InterviewCandidates.Add(Depart);
        //           // }

        //            int response = evolutyzData.SaveChanges();

        //            if (response > 0)
        //            {
        //                EvolutyzCornerDataEntities en = new EvolutyzCornerDataEntities();
        //                return Json("Data Added Successfully", JsonRequestBehavior.AllowGet);
        //                string FName = FirstName;
        //                string LName = LastName;
        //                string Pswd = Password;
        //                var Recuiteremail = (from a in en.Users where a.Usr_UserID == userID select a.Usr_LoginId).FirstOrDefault();
        //                SendEmailToresetpassword(FName, LName, Pswd, Recuiteremail);
        //            }
        //            else
        //            {
        //                return Json("Try Again!!", JsonRequestBehavior.AllowGet);
        //            }

        //        }
        //        catch (Exception EX)
        //        {

        //            throw;
        //        }
        //        //return null;
        //    }
        //}

        public string CreateInterviewCandidate(InterviewCandidateEntity InterviewDtl)
        {
            string          strResponse     = string.Empty;
            UserSessionInfo _objSessioninfo = Session["UserSessionInfo"] as UserSessionInfo;
            int             _userID         = _objSessioninfo.UserId;

            InterviewDtl.Createdby = _userID;
            var Org = new InterviewCandidateComponent();

            string Password = InterviewDtl.Password;

            InterviewDtl.Password = GetMD5(InterviewDtl.Password);

            int r = Org.AddIntCandidate(InterviewDtl);

            if (r == 0)
            {
                EvolutyzCornerDataEntities db = new EvolutyzCornerDataEntities();
                strResponse = "User created successfully";

                string FName         = InterviewDtl.FirstName;
                string LName         = InterviewDtl.LastName;
                int    RecUserid     = _userID;
                string password      = Password;
                var    RecuiterEmail = (from a in db.Users where a.Usr_UserID == RecUserid select a.Usr_LoginId).FirstOrDefault();

                SendEmailToresetpassword(FName, LName, RecUserid, password, RecuiterEmail);
            }
            else if (r == 1)
            {
                strResponse = "User already exists";
            }
            else if (r == -1)
            {
                strResponse = "Please Fill All Mandatory Fields";
            }
            else if (r == 2)
            {
                strResponse = "UserName already Exists";
            }
            else if (r == 3)
            {
                strResponse = "Loginid already Exists";
            }

            return(strResponse);
        }
Esempio n. 3
0
        public InterviewCandidateEntity GetCandidateByICID(int ICID)
        {
            InterviewCandidateEntity response = new InterviewCandidateEntity();

            using (var db = new EvolutyzCornerDataEntities())
            {
                try
                {
                    response = (from q in db.InterviewCandidates
                                join d in db.Assessment_For_Position on q.Assessment_For_Positionid equals d.APID
                                where q.ICID == ICID
                                select new InterviewCandidateEntity
                    {
                        ICID = q.ICID,
                        FirstName = q.FirstName,
                        LastName = q.LastName,
                        Email = q.Emailid,
                        MobileNumber = q.MobileNo,
                        Password = q.Password,
                        Assessment_For_Positionid = d.APID,
                        InterviewForPositionname = d.InterviewForPositionname,
                        RecrutementUserid = q.RecrutementUserid,
                        AssignmentDate = q.AssessmentDate.ToString(),
                        AssignmentTime = q.AssessmentTime,
                        APID = d.APID
                    }).FirstOrDefault();


                    response.IsSuccessful = true;
                    return(response);
                }
                catch (Exception ex)
                {
                    response.IsSuccessful = false;
                    response.Message      = "Error Occured in GetCandidateByICID(ICID)";
                    response.Detail       = ex.Message.ToString();
                    return(response);
                }
            }
        }
Esempio n. 4
0
        public int AddIntCandidate(InterviewCandidateEntity IntCandidateDetails)
        {
            int retVal = 0;
            //User User = new User();
            //User UserName = new User();
            //User UserName = new User();
            int             IPID   = Convert.ToInt32(IntCandidateDetails.InterviewForPositionname);
            DateTime        date   = DateTime.ParseExact(IntCandidateDetails.AssignmentDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            UserSessionInfo info   = new UserSessionInfo();
            int             Userid = info.UserId;

            using (var db = new DbContext(CONNECTION_NAME))
            {
                try
                {
                    db.Set <InterviewCandidate>().Add(new InterviewCandidate

                    {
                        FirstName = IntCandidateDetails.FirstName,
                        LastName  = IntCandidateDetails.LastName,
                        Emailid   = IntCandidateDetails.Email,
                        MobileNo  = IntCandidateDetails.MobileNumber,
                        Password  = IntCandidateDetails.Password,
                        Assessment_For_Positionid = IPID,
                        RecrutementUserid         = Userid,
                        AssessmentDate            = date,
                        AssessmentTime            = IntCandidateDetails.AssignmentTime,
                        CreatedDate = System.DateTime.Now,
                        CreatedBy   = Userid,
                    });
                    db.SaveChanges();
                }
                catch (Exception ex)
                {
                    retVal = -1;
                }
            }
            return(retVal);
        }
Esempio n. 5
0
        public int AddIntCandidate(InterviewCandidateEntity IntCandidateDetails)
        {
            var candidateDac = new InterviewCandidateDac();

            return(candidateDac.AddIntCandidate(IntCandidateDetails));
        }