public ActionResult Create([Bind(Include = "HRAssessmentID,TestId,StudentID,PresentationSkills,ProfessionalImpression,SelfManagement,CommunicationInterpersonalSkills,StressTolerance,DecisionMaking,Learnability,OrganizationalFit,Creative,Expert,Original,Candid,Intelligent,Driven,ValueTheIndividual,FocusOnCustomer,ActAsATeam,StriveForExcellence,ActWithIntegrity,Humble,Hungry,Smart,SignificantAchievements,PlansForFurtherStudies,CareerPlans,OverallRating,OverallComments,Recommendation,HighlyRecommended")] HRAssessment hRAssessment) { if (ModelState.IsValid) { AccountModel accountModel = new AccountModel(); accountModel = (AccountModel)Session["UserDetails"]; hRAssessment.CreatedBy = accountModel.Email; hRAssessment.CreatedDate = DateTime.Now; hRAssessment.LastEditedBy = accountModel.Email; hRAssessment.LastEditedDate = DateTime.Now; hRAssessment.IsSubmitted = true; if (hRAssessment.HRAssessmentID > 0) { db.Entry(hRAssessment).State = EntityState.Modified; } else { db.HRAssessments.Add(hRAssessment); } db.SaveChanges(); hRAssessment.SuccessMessage = "Feedback Recorded."; //return View(hRAssessment); return(RedirectToAction("Index", "CandidateDetails", new { successMessage = "true" })); } return(View(hRAssessment)); }
public ActionResult Create([Bind(Include = "GitRepositoryID,StudentID,RepositoryUrl,Status,ProjectName,CreatedBy,CreatedDate,LastEditedBy,LastEditedDate,TaskId,Comments")] Student_GitRepositories studentGitRepositories) { if (ModelState.IsValid) { studentGitRepositories.ProjectName = studentGitRepositories.RepositoryUrl.Split('/')[studentGitRepositories.RepositoryUrl.Split('/').Length - 1].Split('.').First(); studentGitRepositories.StudentID = UserDetailsSingleton.Instance.UserId; studentGitRepositories.Status = true; studentGitRepositories.CreatedBy = Session["Name"].ToString(); studentGitRepositories.CreatedDate = DateTime.Now; studentGitRepositories.LastEditedBy = Session["Name"].ToString(); studentGitRepositories.LastEditedDate = DateTime.Now; db.Student_GitRepositories.Add(studentGitRepositories); db.SaveChanges(); var model = new GitRepositoriesModel(); model.CloneRepository(studentGitRepositories.RepositoryUrl); model.RunJenkin(studentGitRepositories.RepositoryUrl); string taskSubmissionEmailTemplate = Server.MapPath("~/EmailTemplates/TaskSubmissionTemplate.html"); string logoPath = Server.MapPath("~/Content/Images/logo.png"); string epamTrainingCenterlogoPath = Server.MapPath("~/Content/Images/EpamTrainingCenterLogo.png"); string taskName = "Collections";//studentGitRepositories.TaskName; model.SendTaskSubmissionEmail(taskName, taskSubmissionEmailTemplate, logoPath, epamTrainingCenterlogoPath); Student_GitRepositories repoModel = new Student_GitRepositories { }; return(View("Index", repoModel)); } return(View(studentGitRepositories)); }
public ActionResult Create([Bind(Include = "TechnicalAssessmentID,TestId,StudentID,Section1Rating,Section1Remarks,Section2Rating,Section2Remarks,Section3Rating,Section3Remarks,Section4Rating,Section4Remarks,Section5Rating,Section5Remarks,EPAMFit,OverallRemarks,OverallRating,AdditionalRemarks,AdditionalRating,HighlyRecommended")] TechnicalAssessment technicalAssessment) { if (ModelState.IsValid) { AccountModel accountModel = new AccountModel(); accountModel = (AccountModel)Session["UserDetails"]; technicalAssessment.CreatedBy = accountModel.Email; technicalAssessment.CreatedDate = DateTime.Now; technicalAssessment.LastEditedBy = accountModel.FirstName; technicalAssessment.LastEditedDate = DateTime.Now; technicalAssessment.IsSubmitted = true; if (technicalAssessment.TechnicalAssessmentID > 0) { db.Entry(technicalAssessment).State = EntityState.Modified; } else { db.TechnicalAssessments.Add(technicalAssessment); } db.SaveChanges(); technicalAssessment.SuccessMessage = "Feedback Recorded."; //return View(technicalAssessment); return(RedirectToAction("Index", "CandidateDetails", new { successMessage = "true" })); } return(View(technicalAssessment)); }
public ActionResult Create([Bind(Include = "RecruitmentId,TestName,LocationId,TestKey,CutoffPercentage,CodingWeightageOnSelection1,TechnicalWeightageOnSelection,HRWeightageOnSelection")] TestsHosted testsHosted) { if (ModelState.IsValid) { db.TestsHosteds.Add(testsHosted); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(testsHosted)); }
public ActionResult Create([Bind(Include = "LocationID,Location")] Master_Locations master_Locations) { if (ModelState.IsValid) { db.Master_Locations.Add(master_Locations); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(master_Locations)); }
public ActionResult Create([Bind(Include = "GenderId,Gender")] Master_Gender master_Gender) { if (ModelState.IsValid) { db.Master_Gender.Add(master_Gender); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(master_Gender)); }
public ActionResult Create([Bind(Include = "RoundID,RoundName,RoundKey,IsActive")] Recruitment_Rounds recruitment_Rounds) { if (ModelState.IsValid) { db.Recruitment_Rounds.Add(recruitment_Rounds); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(recruitment_Rounds)); }
public ActionResult Create([Bind(Include = "RecruitmentID,Name,Comments")] Recruitment recruitment) { if (ModelState.IsValid) { db.Recruitments.Add(recruitment); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(recruitment)); }
public ActionResult Create([Bind(Include = "CandidateID,CandidateName,CandidateLocationID,CandidateEmail,ContactNumber,CandidateResume,StartedOn,StartingTime,PreviousAssessments,Duration,MarksScored,Result,Report,PublicReport,FirstName,LastName,EmailAddress,MobileNumber,GraduationCollegeName,Graduation,GraduationSpecialty,YearOfPassedOut,GraduationMarksCGPA,C12MarksCGPA,C10MarksCGPA,Gender,PermanentAddress,PermanentStateOfResidence,CurrentAddress,GovernmentIssuedIDProof,PreferredJobLocation,RecruitmentId,TestId,SecondRoundPublicReport,IsPEPStudent,IsCodathonWinner,IsGDCleared,GDComments,PreferredLocationForSecondRound")] Candidate_Details candidate_Details) { if (ModelState.IsValid) { db.Entry(candidate_Details).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(candidate_Details)); }
public ActionResult Create([Bind(Include = "CollegeID,CollegeName,IsActive")] College college) { if (ModelState.IsValid) { db.Colleges.Add(college); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(college)); }
public ActionResult Create([Bind(Include = "RoleId,RoleName,RoleKey")] Master_Roles master_Roles) { if (ModelState.IsValid) { db.Master_Roles.Add(master_Roles); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(master_Roles)); }
public ActionResult Create([Bind(Include = "MarksID,CandidateID,TestID,MCQs,CodingChallenge1,CodingChallenge2,CodingChallenge3,IsActive,CreatedBy,CreatedDate,LastEditedBy,LastEditedDate,MarksScored,Result,RoundType")] Candidate_Marks candidate_Marks) { if (ModelState.IsValid) { db.Candidate_Marks.Add(candidate_Marks); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(candidate_Marks)); }
public ActionResult Create([Bind(Include = "EmailRecipientID,FirstName,LastName,Email,CollegeId,Active")] EmailRecipient emailRecipient) { if (ModelState.IsValid) { db.EmailRecipients.Add(emailRecipient); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(emailRecipient)); }
public ActionResult Create([Bind(Include = "TaskId,TaskName,TaskDescription,CreatedBy,CreatedDate,LastEditedBy,LastEditedDate,EstimatedCompletionDate")] Task task) { if (ModelState.IsValid) { db.Tasks.Add(task); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(task)); }
public ActionResult Create([Bind(Include = "CandidateID,IsGDCleared,GDComments,PreferredLocationForSecondRound")] Candidate_Details candidateDetails) { if (ModelState.IsValid) { var result = db.Candidate_Details.SingleOrDefault(b => b.CandidateID == candidateDetails.CandidateID); //db.Candidate_Details.Add(candidate_Details); result.GDComments = candidateDetails.GDComments; result.IsGDCleared = candidateDetails.IsGDCleared; //db.Entry(candidate_Details).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "CandidateDetails", new { successMessage = "true" })); //return RedirectToAction("Index"); } return(View(candidateDetails)); }
public ActionResult Create([Bind(Include = "UserId,UserName,Password,RoleId,FirstName,MiddleName,LastName,GenderId,Email,ContactNumber,Address,CollegeId,MarksScored,GraduationSpecialty,EmailAddressToSendNotifications,Active,CreatedBy,CreatedDate,LastEditedBy,LastEditedDate")] User user) { user.UserName = user.Email; if (ModelState.IsValid) { user.Password = Guid.NewGuid().ToString("n").Substring(0, 8); db.Users.Add(user); db.SaveChanges(); var htmlTemplateUrl = Server.MapPath("~/EmailTemplates/NewUser.html"); var logoPath = Server.MapPath("~/Content/Images/logo.png"); var epamTrainingCenterlogoPath = Server.MapPath("~/Content/Images/EpamTrainingCenterLogo.png"); NewUserEmail(user.Email, user.Password, user.FirstName, htmlTemplateUrl, logoPath, epamTrainingCenterlogoPath); ModelState.Clear(); var model = new User { SuccessMessage = "User Created Successfully." }; return(View("Create", model)); } return(View("Create")); }
public ActionResult Create([Bind(Include = "CandidateID,CandidateName,CandidateLocationID,CandidateEmail,ContactNumber,CandidateResume,StartedOn,StartingTime,PreviousAssessments,Duration,MarksScored,Result,Report,PublicReport,FirstName,LastName,EmailAddress,MobileNumber,GraduationCollegeName,Graduation,GraduationSpecialty,YearOfPassedOut,GraduationMarksCGPA,C12MarksCGPA,C10MarksCGPA,Gender,PermanentAddress,PermanentStateOfResidence,CurrentAddress,GovernmentIssuedIDProof,PreferredJobLocation")] Candidate_Details candidate_Details) { if (ModelState.IsValid) { db.Candidate_Details.Add(candidate_Details); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(candidate_Details)); }
public void SendEmailToAbsentees(string webinarDate, string htmlTemplateURL, string logoPath, string epamTrainingCenterlogoPath) { string webinarDate1 = Convert.ToDateTime(webinarDate).ToString("MMMM") + " " + Convert.ToDateTime(webinarDate).Day + "," + Convert.ToDateTime(webinarDate).Year; var parameters = new SqlParameter[1]; parameters[0] = new SqlParameter("@WebinarDate", Convert.ToDateTime(webinarDate)); DataSet ds = SqlHelper.FillDataSet(ConfigurationManager.RdConnectionString, "Get_WebinarAbsentees", parameters); int i = 1; foreach (DataRow dr in ds.Tables[0].Rows) { Thread.Sleep(2000); string body = string.Empty; using (StreamReader reader = new StreamReader(htmlTemplateURL)) { body = reader.ReadToEnd(); } body = body.Replace("@@WebinarDate@@", webinarDate1); body = body.Replace("@@StudentName@@", dr["Name"].ToString()); using (MailMessage mailMessage = new MailMessage()) { mailMessage.From = new MailAddress(Environment.UserName + "@epam.com"); mailMessage.Subject = "EPAM__PEP(Pre-education program) - " + webinarDate1 + ""; mailMessage.Body = body; mailMessage.IsBodyHtml = true; AlternateView htmlView = AlternateView.CreateAlternateViewFromString(body, null, "text/html"); LinkedResource res = new LinkedResource(logoPath) { ContentId = "myImageID" }; htmlView.LinkedResources.Add(res); mailMessage.AlternateViews.Add(htmlView); LinkedResource res1 = new LinkedResource(epamTrainingCenterlogoPath) { ContentId = "epamTrainingCenterLogo" }; htmlView.LinkedResources.Add(res1); mailMessage.AlternateViews.Add(htmlView); mailMessage.To.Add(new MailAddress(dr["EmailAddressToSendNotifications"].ToString())); string epamAssociates = dr["EpamAssociates"].ToString(); foreach (var ccEmailAddress in epamAssociates.Split(',')) { mailMessage.CC.Add(new MailAddress(ccEmailAddress)); } var obj = new Email { ToEmail = dr["EmailAddressToSendNotifications"].ToString(), FromEmail = Environment.UserName + "@epam.com", CC = epamAssociates, Subject = "EPAM__PEP(Pre-education program) - " + webinarDate + "", EmailContent = body, WebinarDate = Convert.ToDateTime(webinarDate), CreatedDate = DateTime.Now, Status = true }; db.Emails.Add(obj); db.SaveChanges(); SmtpClient smtp = new SmtpClient(); smtp.Host = ConfigurationManager.SMTPHost; //ConfigurationManager.AppSettings["Host"]; //smtp.EnableSsl = true;//Convert.ToBoolean(Confi gurationManager.AppSettings["EnableSsl"]);ZHYSRFGFYWEEKBDUEDBEBCDJHNC. smtp.DeliveryMethod = SmtpDeliveryMethod.Network; //System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential(); //NetworkCred.UserName = ConfigurationManager.SMTPUserName;// ConfigurationManager.AppSettings["UserName"]; //reading from web.config //NetworkCred.Password = ConfigurationManager.SMTPPassword;//ConfigurationManager.AppSettings["Password"]; //reading from web.config //smtp.UseDefaultCredentials = true; smtp.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials; smtp.Port = Convert.ToInt32(ConfigurationManager.SMTPPort); //ConfigurationManager.AppSettings["Host"]; //Convert.ToBoolean(ConfigurationManager.AppSettings["EnableSsl"]); //System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential(); //NetworkCred.UserName = ConfigurationManager.SMTPUserName;// ConfigurationManager.AppSettings["UserName"]; //reading from web.config //NetworkCred.Password = ConfigurationManager.SMTPPassword;//ConfigurationManager.AppSettings["Password"]; //reading from web.config //smtp.UseDefaultCredentials = true; //smtp.Credentials = NetworkCred; //int.Parse(ConfigurationManager.AppSettings["Port"]); //reading from web.config //smtp.Timeout = 1200000; //smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory; smtp.Send(mailMessage); } #endregion } }