Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Employment_History employment_History = db.Employment_History.Find(id);

            db.Employment_History.Remove(employment_History);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "EmploymentID,PersonID,CompanyID,WorkingField,Position,StartDate,EndDate,JobExp")] Employment_History employment_History)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employment_History).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CompanyID = new SelectList(db.Companies, "CompanyID", "CompanyName", employment_History.CompanyID);
     ViewBag.PersonID  = new SelectList(db.Users, "PersonID", "EMail", employment_History.PersonID);
     return(View(employment_History));
 }
Esempio n. 3
0
        public string DeleteEmployment(int id)
        {
            EmploymentHistoryTableAdapter em         = new EmploymentHistoryTableAdapter();
            Employment_History            employment = new Employment_History();
            int row = em.DeleteQuery(id);

            if (row > 0)
            {
                return("success");
            }
            return("failed");
        }
Esempio n. 4
0
        public string UpdateEmployment(Employment_History eh, int id)
        {
            EmploymentHistoryTableAdapter em         = new EmploymentHistoryTableAdapter();
            Employment_History            employment = new Employment_History();
            int row = em.UpdateQuery(employment.CompanyName, employment.CompanyBusiness, employment.Designation, employment.Department, employment.AreaOfExperience, employment.Responsibilities, employment.CompanyLocation, employment.EmploymentPeriod, id);

            if (row > 0)
            {
                return("success");
            }
            return("failed");
        }
Esempio n. 5
0
        // GET: Employment_History/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Employment_History employment_History = db.Employment_History.Find(id);

            if (employment_History == null)
            {
                return(HttpNotFound());
            }
            return(View(employment_History));
        }
Esempio n. 6
0
        // GET: Employment_History/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Employment_History employment_History = db.Employment_History.Find(id);

            if (employment_History == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CompanyID = new SelectList(db.Companies, "CompanyID", "CompanyName", employment_History.CompanyID);
            ViewBag.PersonID  = new SelectList(db.Users, "PersonID", "EMail", employment_History.PersonID);
            return(View(employment_History));
        }
Esempio n. 7
0
        public void SearchEmployment()
        {
            EmploymentBLL      employmentBLL = new EmploymentBLL();
            Employment_History emp           = new Employment_History();
            int id = 1;

            emp = employmentBLL.SearchEmployment(id);
            companyname.Value      = emp.CompanyName;
            companybusiness.Value  = emp.CompanyBusiness;
            designation.Value      = emp.Designation;
            department.Value       = emp.Department;
            areaofexperiment.Value = emp.AreaOfExperience;
            responsibilities.Value = emp.Responsibilities;
            companylocation.Value  = emp.CompanyLocation;
            employmentperiod.Value = emp.EmploymentPeriod;
        }
Esempio n. 8
0
        protected void saveEducationButton_Click(object sender, EventArgs e)
        {
            EmploymentBLL      employmentBLL = new EmploymentBLL();
            Employment_History emp           = new Employment_History();

            emp.CompanyName      = companyname.Value;
            emp.CompanyBusiness  = companybusiness.Value;
            emp.Designation      = designation.Value;
            emp.Department       = department.Value;
            emp.AreaOfExperience = areaofexperiment.Value;
            emp.Responsibilities = responsibilities.Value;
            emp.CompanyLocation  = companylocation.Value;
            emp.EmploymentPeriod = employmentperiod.Value;
            int id = 1;

            employmentBLL.UpdateEmployment(emp, id);
        }
Esempio n. 9
0
        public Employment_History SearchEmployment(int id)
        {
            EmploymentHistoryTableAdapter       em      = new EmploymentHistoryTableAdapter();
            EmploymentHistorySearchTableAdapter adapter = new EmploymentHistorySearchTableAdapter();
            Employment_History employment = new Employment_History();

            int row = Convert.ToInt32(em.ScalarQuery());

            if (row > 0)
            {
                DataTable dt = adapter.SearchQuery(id);


                employment.CompanyName      = dt.Rows[0]["CompanyName"].ToString();
                employment.CompanyBusiness  = dt.Rows[0]["CompanyBusiness"].ToString();
                employment.Designation      = dt.Rows[0]["Designation"].ToString();
                employment.Department       = dt.Rows[0]["Department"].ToString();
                employment.AreaOfExperience = dt.Rows[0]["AreaofExperiences"].ToString();
                employment.Responsibilities = dt.Rows[0]["Responsibilities"].ToString();
                employment.CompanyLocation  = dt.Rows[0]["CompanyLocation"].ToString();
                employment.EmploymentPeriod = dt.Rows[0]["EmploymentPeriod"].ToString();

                return(employment);
            }
            else
            {
                Education_training edu = new Education_training();
                edu.LevelOfEducation = null;
                edu.DegreeTitle      = null;
                edu.Group            = null;
                edu.InstituteName    = null;
                edu.Achievement      = null;
                edu.Result           = null;
                edu.YearOfoPassing   = null;
                edu.Duration         = null;
                return(employment);
            }
        }