//Добавить пользователя private void add_Click(object sender, EventArgs e) { if (nameField.TextLength == 0) { ShowError(1); return; } if (personCheck.Checked) { retorn = new Person(nameField.Text, (byte)ageField.Value); } else if (workerCheck.Checked) { if (posField.TextLength == 0) { ShowError(2); return; } retorn = new Worker(nameField.Text, posField.Text, (byte)ageField.Value, (int)salaryField.Value, (int)expField.Value); } else if (empCheck.Checked) { education edu = (education)eduCombo.SelectedIndex; retorn = new Employee(nameField.Text, posField.Text, (byte)ageField.Value, (int)salaryField.Value, (int)expField.Value, edu); } else { education edu = (education)eduCombo.SelectedIndex; category cat = (category)(3 - categoryField.Value); retorn = new Engineer(nameField.Text, posField.Text, (byte)ageField.Value, (int)salaryField.Value, (int)expField.Value, edu, cat); } DialogResult = DialogResult.OK; }
public Engineer( string FIO, string pos, byte c, int salary, int experience, education edu, category rang ) : base(FIO, pos, c, salary, experience, edu) { //проверка требований к квалификации, необходимой для инженера, в зависимости от категории if ((edu < education.secondarySpecial) || (edu < education.higher) && (experience < 3)) { return; } if (rang == category.second && ((edu < education.higher) || (experience < 3))) { return; } if (rang == category.first && ((edu < education.higher) || (experience < 6))) { return; } this.rang = rang; }
protected void Page_Load(object sender, EventArgs e) { List <Experience> experiences = new List <Experience>(); var explist = BLL.ExperienceManager.GetAllExperience((Guid)Membership .GetUser().ProviderUserKey).ToList(); foreach (User_Com_Experience item in explist) { Experience experience = (Experience)Page.LoadControl("Controllers/Experience.ascx"); experiences.Add(experience); experience.DataBind(); this.Controls.Add(experience); experience.ComName.InnerHtml = item.Company.Name; experience.FromDate.InnerHtml = item.from.ToString(); experience.ToDate.InnerHtml = item.to.ToString(); experience.JobTitle.InnerHtml = item.title; } AppManager UOW = new AppManager(); var edlist = EducationManager.GetAllByUserId((Guid)Membership .GetUser().ProviderUserKey).ToList(); foreach (User_Education item in edlist) { education education = (education)Page.LoadControl("Controllers/education.ascx"); this.Controls.Add(education); education.eduName.InnerHtml = UOW.Education_Organization .GetById(item.FK_EduId)[0].Name; education.dateFrom.InnerHtml = item.Date_From.ToString(); education.dateTo.InnerHtml = item.Date_To.ToString(); education.grade.InnerHtml = item.Grade.ToString(); } }
public async Task <IActionResult> Edit(int id, [Bind("ID,degreeType,subject,institution,city,state,gradDate,applicantID")] education education) { if (id != education.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(education); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!educationExists(education.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(education)); }
private void GetEducationsListByResume(FullResume fullResume) { //fullResume.MyEducations = new List<education>(); try { var list = (from ed in db.education join re in db.resume on ed.resume_id equals re.resume_id where ed.resume_id == fullResume.Resume_id select new { ed.resume_id, ed.title, ed.description, ed.date, ed.education_id, ed.resume }).ToList(); foreach (var item in list) { education edu = new education(); edu.date = item.date; edu.description = item.description; edu.education_id = item.education_id; edu.resume = item.resume; edu.resume_id = item.resume_id; edu.title = item.title; fullResume.MyEducations.Add(edu); } } catch (SqlException ex) { //TODO: gör något med felmeddelandet throw; } }
public void GetEducation(FreelancerProfileVM fp) //Metod för att hämta utbildningar på inskickad freelancerVM och lagra dessa i dennes utbildnings-lista { try { var list = (from e in db.education join r in db.resume on e.resume_id equals r.resume_id where e.resume_id == fp.Resume_id select new { e.education_id, e.resume_id, e.title, e.description, e.date }).ToList(); foreach (var item in list) { education ed = new education(); ed.education_id = item.education_id; ed.resume_id = item.resume_id; ed.title = item.title; ed.description = item.description; ed.date = item.date; fp.EducationsList.Add(ed); } } catch (SqlException ex) { //TODO: gör något med felmeddelandet throw; } }
public ActionResult DeleteConfirmed(int id) { education education = db.educations.Find(id); db.educations.Remove(education); db.SaveChanges(); return(RedirectToAction("Index")); }
private void SaveNewPosition(object sender, RoutedEventArgs e) { try { if (selectedEducation != 0) { education uEducation = dbContext.education.SingleOrDefault(k => k.ID == selectedEducation); if (uEducation != null) { uEducation.educationType = cmbEducationType.SelectedValue == null ? (int?)null : Convert.ToInt32(cmbEducationType.SelectedValue); if (cmbEducationType.Text.ToLower().Contains("ali")) { uEducation.grade = cmbEducationGrade.SelectedValue == null ? (int?)null : Convert.ToInt32(cmbEducationGrade.SelectedValue); uEducation.faculty = faculty.Text; uEducation.speciality = speciality.Text; } else { uEducation.grade = null; uEducation.faculty = string.Empty; uEducation.speciality = string.Empty; } uEducation.educationCentreName = ceducationCentreName.Text; uEducation.diplomNumber = diplomNumber.Text; uEducation.endYear = Convert.ToInt32(endYear.Text); } } else { education edu = new education(); edu.grade = cmbEducationGrade.SelectedValue == null ? (int?)null : Convert.ToInt32(cmbEducationGrade.SelectedValue); edu.educationType = cmbEducationType.SelectedValue == null ? (int?)null : Convert.ToInt32(cmbEducationType.SelectedValue); edu.educationCentreName = ceducationCentreName.Text; edu.faculty = faculty.Text; edu.empID = selectedPersonID; edu.speciality = speciality.Text; edu.diplomNumber = diplomNumber.Text; edu.endYear = Convert.ToInt32(endYear.Text); dbContext.education.Add(edu); } dbContext.SaveChanges(); // txtStatus.Text = rOrganization.organizationName + " has being added!"; } catch (DbUpdateException ex) { MessageBox.Show("Problem yarandı" + ex.ToString()); } finally { FillEducationList(selectedPersonID); MessageBox.Show("Melumatlar saxlanıldı"); } }
public ActionResult Edit([Bind(Include = "id,year_education,description_education")] education education) { if (ModelState.IsValid) { db.Entry(education).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(education)); }
public ActionResult Edit([Bind(Include = "education_Id,school_name,education_date,subject,education_degree,freelancer_Id")] education education) { if (ModelState.IsValid) { db.Entry(education).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Edit")); } return(View(education)); }
public ActionResult EditEducation([Bind(Include = "education_id,education_name,university_name,study_years")] education ed) { if (ModelState.IsValid) { db.Entry(ed).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("EditWorkExperience")); } return(View(ed)); }
public Employee( string FIO, string pos, byte c, int salary, int experience, education edu ) : base(FIO, pos, c, salary, experience) { this.edu = edu; }
public ActionResult Create([Bind(Include = "id,year_education,description_education")] education education) { if (ModelState.IsValid) { db.educations.Add(education); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(education)); }
public async Task <IActionResult> Create([Bind("ID,degreeType,subject,institution,city,state,gradDate,applicantID")] education education) { if (ModelState.IsValid) { _context.Add(education); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(education)); }
public ActionResult Education_JobSeeker(employee employee1) { //var educationlogs = from edu in db.educations where // edu.id_employee == employee1.id_employee //// select edu; education education1 = new education(); education1.id_employee = employee1.id_employee; //educationlog1.id_employee = ; //educationlog1.id_employee = employeelog1.id_employee; return(View(education1));//educationlog1); }
public ActionResult Create([Bind(Include = "education_Id,school_name,education_date,subject,education_degree,freelancer_Id")] education education, int?id) { if (ModelState.IsValid) { education.freelancer_id = id; db.education.Add(education); db.SaveChanges(); return(RedirectToAction("Create")); } return(View(education)); }
// POST: odata/educations public IHttpActionResult Post(education education) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.educations.Add(education); db.SaveChanges(); return(Created(education)); }
public ActionResult Show_Education_JobSeeker2(education education1) { var employ = from emp in db.employees where emp.id_employee == education1.id_employee select emp; employee employee1 = employ.First(); var userlogs = from us in db.users where us.id_user == employee1.id_user select us; user user1 = userlogs.First(); return(RedirectToAction("Details_JobSeeker", user1)); }
// GET: educations/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } education education = db.educations.Find(id); if (education == null) { return(HttpNotFound()); } return(View(education)); }
// DELETE: odata/educations(5) public IHttpActionResult Delete([FromODataUri] int key) { education education = db.educations.Find(key); if (education == null) { return(NotFound()); } db.educations.Remove(education); db.SaveChanges(); return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Education_JobSeeker(education education1) { //System.Linq.IQueryable education1 = db.educations.Where(model => model.id_employee == educationJobseekerlog1.id_employee); //var education1 = db.educations.Any(model => model.id_employee == educationJobseekerlog1.id_employee); //if (db.users.Any(model => model.email == jobseeker1.userJobSeeker.email)) education1.degree_name = education1.degree_name.ToLower(); var educationlogs = from edu in db.educations where edu.id_employee == education1.id_employee select edu; foreach (education checkedu in educationlogs) { if (checkedu.degree_name == education1.degree_name) { ModelState.AddModelError("degree_name", "Ooops! you have given your this degree info. give ur new degree"); break; } } if (education1.score > education1.scale) { ModelState.AddModelError("score", "Ooops! score can't be greater than scale. plz give correct info!"); } if (ModelState.IsValid) { db.educations.Add(education1); db.SaveChanges(); var employ = from emp in db.employees where emp.id_employee == education1.id_employee select emp; employee employee1 = employ.First(); var userlogs = from us in db.users where us.id_user == employee1.id_user select us; user user1 = userlogs.First(); return(RedirectToAction("Details_JobSeeker", user1)); } return(View(education1)); }
public IHttpActionResult Patch([FromODataUri] int key, Delta <education> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } education education = db.educations.Find(key); if (education == null) { return(NotFound()); } patch.Patch(education); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!educationExists(key)) { return(NotFound()); } else { throw; } } return(Updated(education)); }
private void btn_login_Click(object sender, EventArgs e) { if (comboBox1.SelectedItem.ToString() == "استاد") { OleDbConnection con1 = new OleDbConnection("provider=Microsoft.ace.oledb.12.0;data source=university.accdb"); con1.Open(); OleDbCommand c1 = new OleDbCommand(); c1.CommandText = "select * from Teacher where Tno='" + txt_username.Text + "' and Tpass='******'"; c1.Connection = con1; OleDbDataReader data = c1.ExecuteReader(); if (data.Read()) { master f = new master(); f.Tno = data.GetValue(0).ToString(); f.Tname = data.GetValue(1).ToString() + " " + data.GetValue(2).ToString(); f.Tfield = data.GetValue(3).ToString(); f.Show(); } else { MessageBox.Show(" !نام کاربری یا کلمه ی عبور با نوع دسترسی اشتباه است", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } if (comboBox1.SelectedItem.ToString() == "دانشجو") { OleDbConnection con1 = new OleDbConnection("provider=Microsoft.ace.oledb.12.0;data source=university.accdb"); con1.Open(); OleDbCommand c1 = new OleDbCommand(); c1.CommandText = "select * from Student where Stno='" + txt_username.Text + "' and Stpass='******'"; c1.Connection = con1; OleDbDataReader data = c1.ExecuteReader(); if (data.Read()) { student s = new student(); s.stno = data.GetValue(0).ToString(); s.stname = data.GetValue(1).ToString() + " " + data.GetValue(2).ToString(); s.stfield = data.GetValue(3).ToString(); s.Show(); } else { MessageBox.Show(" !نام کاربری یا کلمه ی عبور با نوع دسترسی اشتباه است", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } if (comboBox1.SelectedItem.ToString() == "آموزش") { OleDbConnection con1 = new OleDbConnection("provider=Microsoft.ace.oledb.12.0;data source=university.accdb"); con1.Open(); OleDbCommand c1 = new OleDbCommand(); c1.CommandText = "select * from Users where Ucode='" + txt_username.Text + "' and Upass='******'"; c1.Connection = con1; OleDbDataReader data = c1.ExecuteReader(); if (data.Read()) { education ed = new education(); ed.ucode = data.GetValue(0).ToString(); ed.uname = data.GetValue(2).ToString(); ed.Show(); } else { MessageBox.Show(" !نام کاربری یا کلمه ی عبور با نوع دسترسی اشتباه است", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
public static void Initialize(ResumeContext context) { context.Database.EnsureCreated(); // Look for any applicants if (!context.applicant.Any()) { var applicants = new applicant[] { new applicant { FirstName = "Carson", LastName = "Alexander", City = "ABQ", State = "NM", Phone = "505-933-9799", Email = "*****@*****.**", WebAddress = "kellycockrell.net" } // new applicant {FirstName="Johnson",LastName="Joan",City="ABQ", State="NM", Phone="505-933-9799", Email="*****@*****.**", WebAddress="kellycockrell.net"}, // new applicant {FirstName="Raphael",LastName="Lobato",City="ABQ", State="NM", Phone="505-933-9799", Email="*****@*****.**", WebAddress="kellycockrell.net"}, // new applicant {FirstName="Elsa",LastName="Castillo",City="ABQ", State="NM", Phone="505-933-9799", Email="*****@*****.**", WebAddress="kellycockrell.net"}, // new applicant {FirstName="Cassiano",LastName="de Oliveira",City="ABQ", State="NM", Phone="505-933-9799", Email="*****@*****.**", WebAddress="kellycockrell.net"}, // new applicant {FirstName="Brendaleigh",LastName="Lobato",City="ABQ", State="NM", Phone="505-933-9799", Email="*****@*****.**", WebAddress="kellycockrell.net"}, }; foreach (applicant a in applicants) { context.applicant.Add(a); } context.SaveChanges(); } if (!context.education.Any()) { var education = new education[] { new education { degreeType = "Bachelors", subject = "Fine Arts", institution = "University of New Mexico", city = "Albuquerque", state = "NM", gradDate = "May 1994", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new education { degreeType = "Bachelors", subject = "Electrical Engineering", institution = "University of Texas", city = "Austin", state = "NM", gradDate = "May 1994", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new education { degreeType = "Masters", subject = "Physics", institution = "Boston College", city = "Boston", state = "MA", gradDate = "May 2016", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, //new education {degreeType = "PhD", subject = "Sociology", institution = "Harvard University", city = "Cambridge", state = "MA", gradDate = "December 2010",applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, //new education {degreeType = "PhD", subject = "Nuclear Engineering", institution = "Imperial College", city = "London", state = "UK", gradDate = "May 1989",applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, //new education {degreeType = "Associates", subject = "Business Administration", institution = "Santa Fe Community College", city = "Santa Fe", state = "NM", gradDate = "May 2018",applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, //new education {degreeType = "Bachelors", subject = "Biology", institution = "University of Colorado", city = "Boulder", state = "CO", gradDate = "December 1994",applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID } }; foreach (education e in education) { context.education.Add(e); } context.SaveChanges(); } if (!context.references.Any()) { var references = new references[] { new references { firstName = "Barack", lastName = "Obama", companyName = "Former President of the United States", mailingAddress = "P.O. Box 91000", city = "Washington DC", state = "", emailAddress = "*****@*****.**", phone = "212-444-5555", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new references { firstName = "Vladimir", lastName = "Putin", companyName = "President and DIctator of Russia", mailingAddress = "P.O. Box 666661", city = "Moscow", state = "Russia", emailAddress = "*****@*****.**", phone = "33-433-4424-09090", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new references { firstName = "Barack", lastName = "Obama", companyName = "Former President of the United States", mailingAddress = "P.O. Box 91000", city = "Washington DC", state = "", emailAddress = "*****@*****.**", phone = "212-444-5555", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, //new references {firstName= "Barack", lastName = "Obama", companyName = "Former President of the United States", mailingAddress = "P.O. Box 91000", city="Washington DC", state="", emailAddress= "*****@*****.**", phone = "212-444-5555" }, //new references {firstName= "Barack", lastName = "Obama", companyName = "Former President of the United States", mailingAddress = "P.O. Box 91000", city="Washington DC", state="", emailAddress= "*****@*****.**", phone = "212-444-5555" }, //new references {firstName= "Barack", lastName = "Obama", companyName = "Former President of the United States", mailingAddress = "P.O. Box 91000", city="Washington DC", state="", emailAddress= "*****@*****.**", phone = "212-444-5555" } }; foreach (references r in references) { context.references.Add(r); } context.SaveChanges(); } if (!context.skills.Any()) { var skills = new skills[] { new skills { skillName = "Javascript", experienceLevel = "Advanced", yearsUsed = "3", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new skills { skillName = "Adobe Photoshop", experienceLevel = "Expert", yearsUsed = "10", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new skills { skillName = "Adobe Illustrator", experienceLevel = "Advanced", yearsUsed = "8", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new skills { skillName = "C#", experienceLevel = "Novice", yearsUsed = "1", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new skills { skillName = "HTML/CSS", experienceLevel = "Expert", yearsUsed = "10", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new skills { skillName = "Microsoft Office", experienceLevel = "Advanced", yearsUsed = "20", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID } }; foreach (skills s in skills) { context.skills.Add(s); } context.SaveChanges(); } if (!context.experience.Any()) { var experience = new Experience[] { new Experience { jobName = "Internship Coordinator and Graphic Designer", placeWorked = "University of New Mexico", city = "Albuquerque", state = "NM", startDate = "June 2015", endDate = "present", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new Experience { jobName = "Teacher of Computer Science and Technology", placeWorked = "The Meadows School", city = "Las Vegas", state = "NV", startDate = "August 2013", endDate = "June 2015", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new Experience { jobName = "Director of Technology", placeWorked = "Steamboat Mountain School", city = "Steamboat Springs", state = "CO", startDate = "June 2012", endDate = "July 2013", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new Experience { jobName = "Technology Lab Coordinator", placeWorked = "Rowland Hall-St. Mark's School", city = "Salt Lake City", state = "UT", startDate = "August 2007", endDate = "June 2012", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new Experience { jobName = "Web and UX Designer", placeWorked = "University of Arkansas", city = "Fayetteville", state = "AR", startDate = "November 2006", endDate = "August 2007", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID }, new Experience { jobName = "Marketing Advertising Executive", placeWorked = "Lovely County Citizen", city = "Eureka Springs", state = "AR", startDate = "Jan 2005", endDate = "October 2006", applicantID = context.applicant.FirstOrDefault(y => y.FirstName == "Carson").ID } }; foreach (Experience e in experience) { context.experience.Add(e); } context.SaveChanges(); } if (!context.duties.Any()) { var duty = new duties[] { new duties { summary = "• Coordinates mentoring and internship program under a grant from the National Science Foundation.", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "University of New Mexico").ID }, new duties { summary = "• Organizes and expedites mentoring events and meetings with faculty and students.", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "University of New Mexico").ID }, new duties { summary = "• Advises and mentors students in meaningful development of careers. ", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "University of New Mexico").ID }, new duties { summary = "• Conceptualizes and designs advertising campaigns for School of Engineering.", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "The Meadows School").ID }, new duties { summary = "• Photographs students, faculty, and departmental events, to be used for publication", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "The Meadows School").ID }, new duties { summary = "• Conceptualized, designed, and taught computer science and technology curriculum to students in a project-based environment at rigorous private middle school.", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "The Meadows School").ID }, new duties { summary = "• Oversaw entire technology department for an independent boarding school,grades 9-12.", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "Steamboat Mountain School").ID }, new duties { summary = "• Configured and administered firewall, wireless network, and Active Directory Server.", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "Steamboat Mountain School").ID }, new duties { summary = "• Oversaw budget, recommended to and consulted with Head of School or purchases.", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "Steamboat Mountain School").ID }, new duties { summary = "• Taught graphic design; advised and supervised students in the creation of theschool yearbook.", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "Rowland Hall-St. Mark's School").ID }, new duties { summary = "• Managed the scheduling, maintenance, and security of computer labs.", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "Rowland Hall-St. Mark's School").ID }, new duties { summary = "• Recommended hardware, software and learning resources to teachers.", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "Rowland Hall-St. Mark's School").ID }, new duties { summary = "• First responder for end - user and technical support to faculty and students.", experienceID = context.experience.FirstOrDefault(y => y.placeWorked == "Rowland Hall-St. Mark's School").ID } }; foreach (duties d in duty) { context.duties.Add(d); } context.SaveChanges(); } }
public ActionResult EditEducation(int id = 2) { education ed = db.education.Find(id); return(View(ed)); }