//public List<InterviewCandidateEntity> GetInterviewCandidateDetails() //{ // List<InterviewCandidateEntity> result = new List<InterviewCandidateEntity>(); // using (var db = new EvolutyzCornerDataEntities()) // { // try // { // result = (from q in db.InterviewCandidates // select new InterviewCandidateEntity // { // ICID = q.ICID, // AssignmentDate = q.AssessmentDate, // Assessment_For_Positionid = q.Assessment_For_Positionid, // InterviewForPositionname = q.Assessment_For_Position.InterviewForPositionname, // Createdby = q.CreatedBy, // CreatedDate = q.CreatedDate, // Email = q.Emailid, // FirstName = q.FirstName, // LastName = q.LastName, // MobileNumber = q.MobileNo, // Modifiedby = q.ModifiedBy, // ModifiedDate = q.ModifiedDate, // Password = q.Password, // RecrutementUserid = q.RecrutementUserid, // status = q.status // }).ToList(); // } // catch (Exception ex) // { // } // } // return result; //} //public InterviewCandidateEntity AddInterviewCandidateDetailById(int ICID) //{ // InterviewCandidateEntity result = new InterviewCandidateEntity(); // using (var db = new EvolutyzCornerDataEntities()) // { // try // { // result = (from q in db.InterviewCandidates // select new InterviewCandidateEntity // { // ICID = q.ICID, // AssignmentDate = q.AssessmentDate, // Assessment_For_Positionid = q.Assessment_For_Positionid, // InterviewForPositionname = q.Assessment_For_Position.InterviewForPositionname, // Createdby = q.CreatedBy, // CreatedDate = q.CreatedDate, // Email = q.Emailid, // FirstName = q.FirstName, // LastName = q.LastName, // MobileNumber = q.MobileNo, // Modifiedby = q.ModifiedBy, // ModifiedDate = q.ModifiedDate, // Password = q.Password, // RecrutementUserid = q.RecrutementUserid, // status = q.status // }).FirstOrDefault(); // result.IsSuccessful = true; // } // catch (Exception ex) // { // result.IsSuccessful = false; // result.Message = "Error Occured in GetInterviewCandidateDetailById(ID)"; // result.Detail = ex.Message.ToString(); // } // } // return result; //} //public InterviewCandidateEntity UpdateInterviewCandidateDetailById(int ICID) //{ // InterviewCandidateEntity result = new InterviewCandidateEntity(); // using (var db = new EvolutyzCornerDataEntities()) // { // try // { // result = (from q in db.InterviewCandidates // select new InterviewCandidateEntity // { // ICID = q.ICID, // AssignmentDate = q.AssessmentDate, // Assessment_For_Positionid = q.Assessment_For_Positionid, // InterviewForPositionname = q.Assessment_For_Position.InterviewForPositionname, // Createdby = q.CreatedBy, // CreatedDate = q.CreatedDate, // Email = q.Emailid, // FirstName = q.FirstName, // LastName = q.LastName, // MobileNumber = q.MobileNo, // Modifiedby = q.ModifiedBy, // ModifiedDate = q.ModifiedDate, // Password = q.Password, // RecrutementUserid = q.RecrutementUserid, // status = q.status // }).FirstOrDefault(); // result.IsSuccessful = true; // } // catch (Exception ex) // { // result.IsSuccessful = false; // result.Message = "Error Occured in GetInterviewCandidateDetailById(ID)"; // result.Detail = ex.Message.ToString(); // } // } // return result; //} public int DeleteInterviewCandidateDetailById(int ICID) { int retVal = 0; InterviewCandidate _interviewDtl = null; using (var db = new DbContext(CONNECTION_NAME)) { try { _interviewDtl = db.Set <InterviewCandidate>().Where(s => s.ICID == ICID).FirstOrDefault <InterviewCandidate>(); if (_interviewDtl == null) { return(retVal); } _interviewDtl.status = false; db.Entry(_interviewDtl).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); retVal = 1; } catch (Exception ex) { retVal = -1; } } return(retVal); }
public string UpdateInterviewCandidates(string id, string FirstName, string LastName, string Email, string MobileNumber, string InterviewForPositionname, string AssignmentDate, string AssignmentTime) { InterviewCandidate Candidatedetails = null; UserSessionInfo info = new UserSessionInfo(); int ICID = Convert.ToInt32(id); //string date = AssignmentDate.ToString(); DateTime date = Convert.ToDateTime(AssignmentDate); int userid = info.UserId; int acid = info.AccountId; string strResponse = string.Empty; // bool Status = Convert.ToBoolean(status); //if (status == "True") //{ // statusid = 1; //} //else //{ // statusid = 0; //} using (var db = new DbContext(CONNECTION_NAME)) { try { Candidatedetails = db.Set <InterviewCandidate>().Where(s => s.ICID == ICID).FirstOrDefault <InterviewCandidate>(); //Department FirstName = db.Set<Department>().Where(s => (s.DepartmentName == DepartmentName && s.isDeleted == false)).FirstOrDefault<Department>(); // TicketsAuthority chckusrid = db.Set<TicketsAuthority>().Where(s => (s.UserId == UserId && s.Status == false)).FirstOrDefault<TicketsAuthority>(); if (Candidatedetails == null) { return(null); } //if (chckusrid != null) //{ // return "usrid Already Exists"; //} //holidayDetails.AccountID = holiday.AccountID; Candidatedetails.FirstName = FirstName; Candidatedetails.LastName = LastName; Candidatedetails.Emailid = Email; Candidatedetails.MobileNo = MobileNumber; Candidatedetails.Assessment_For_Positionid = Convert.ToInt32(InterviewForPositionname); Candidatedetails.AssessmentTime = AssignmentTime; Candidatedetails.AssessmentDate = date; Candidatedetails.ModifiedBy = userid; Candidatedetails.ModifiedDate = System.DateTime.Now; db.Entry(Candidatedetails).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); strResponse = "Candidatedetails successfully updated"; } catch (Exception ex) { strResponse = ex.Message.ToString(); } return(strResponse); } }