public ActionResult Delete(int id)
        {
            EmployeeExperience experience = _employeeExpService.GetExperienceById(id);

            _employeeExpService.Delete(experience);
            return(RedirectToAction("~/Employee/EmployeeDetail/" + experience.EmpID));
        }
Пример #2
0
 public static EmployeeExperienceModel AddEmployeeExperience(EmployeeExperienceModel model)
 {
     using (var context = new MakeMyJobsEntities())
     {
         EmployeeExperience employeeExperience = new EmployeeExperience();
         employeeExperience.EmployeeId  = model.employeeId;
         employeeExperience.CompanyName = model.companyName;
         employeeExperience.Position    = model.position;
         employeeExperience.JoinedOn    = model.joinedOn;
         employeeExperience.LeftOn      = model.leftOn;
         employeeExperience.IsActive    = 1;
         context.EmployeeExperiences.Add(employeeExperience);
         int added = context.SaveChanges();
         if (added > 0)
         {
             return(new EmployeeExperienceModel()
             {
                 empExperienceId = employeeExperience.EmpExperienceId,
                 employeeId = employeeExperience.EmployeeId,
                 companyName = employeeExperience.CompanyName,
                 position = employeeExperience.Position,
                 joinedOn = employeeExperience.JoinedOn,
                 leftOn = employeeExperience.LeftOn,
                 isActive = employeeExperience.IsActive
             });
         }
         else
         {
             return(null);
         }
     }
 }
Пример #3
0
 /// <summary>
 /// 员工履历表,姓名工号查询
 /// </summary>
 /// <param name="WindowsName"></param>
 /// <param name="DataTableColumn"></param>
 /// <param name="QueryList"></param>
 /// <param name="f"></param>
 public ConditionsQuery(string WindowsName, List <string> DataTableColumn, List <selectConditionsQueryPStaffResumeModel> QueryList, EmployeeExperience f)
 {
     InitializeComponent();
     this.WindowText   = WindowsName;
     this.strlist      = DataTableColumn;
     this.queryList    = QueryList;
     this.formemployee = f;
 }
Пример #4
0
        public int Update(EmpExperienceItem model)
        {
            Mapper.CreateMap <EmpExperienceItem, EmployeeExperience>();
            EmployeeExperience objExp = DBcontext.EmployeeExperiences.SingleOrDefault(m => m.ExpId == model.ExpId);

            objExp = Mapper.Map(model, objExp);
            return(DBcontext.SaveChanges());
        }
 public ActionResult Edit(EmployeeExperience experience)
 {
     if (ModelState.IsValid)
     {
         _employeeExpService.Update(experience);
         return(RedirectToAction("~/Employee/EmployeeDetail/" + experience.EmpID));
     }
     return(View(experience));
 }
        //--------Employee Experience
        public IActionResult CreateExperience(int Id)
        {
            if (Id <= 0)
            {
                return(NotFound());
            }
            var emp = db.Employee.FirstOrDefault(e => e.Id == Id);
            var obj = new EmployeeExperience(emp);

            return(View("EditExp", obj));
        }
Пример #7
0
        private void btn_StaffResume_Click(object sender, EventArgs e)
        {
            if (!(UsersHelp.systemAdimin || UsersHelp.StaffResume))
            {
                MessageBox.Show("抱歉,您没有访问此功能的权限");
                return;
            }

            EmployeeExperience eexper = new EmployeeExperience(this);

            eexper.MdiParent = this;
            SetMdiForm(eexper.Text, typeof(EmployeeExperience));
        }
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EmployeeExperience experience = _employeeExpService.GetExperienceById(id);

            if (experience == null)
            {
                return(HttpNotFound());
            }
            return(View(experience));
        }
Пример #9
0
 public EmpExperienceItem GetById(int id)
 {
     try
     {
         Mapper.CreateMap <EmployeeExperience, EmpExperienceItem>();
         EmployeeExperience objExp     = DBcontext.EmployeeExperiences.SingleOrDefault(m => m.ExpId == id);
         EmpExperienceItem  objExpItem = Mapper.Map <EmpExperienceItem>(objExp);
         return(objExpItem);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #10
0
 public int Insert(EmpExperienceItem model)
 {
     try
     {
         Mapper.CreateMap <EmpExperienceItem, EmployeeExperience>();
         EmployeeExperience objExper = Mapper.Map <EmployeeExperience>(model);
         DBcontext.EmployeeExperiences.Add(objExper);
         return(DBcontext.SaveChanges());
     }
     catch (Exception)
     {
         throw;
     }
 }
 public IActionResult SaveEmpExp(EmployeeExperience exp)
 {
     if (!ModelState.IsValid)
     {
         return(View("EditExp", exp));
     }
     if (exp.Id == 0)
     {
         db.EmployeeExperience.Add(exp);
     }
     else
     {
         db.EmployeeExperience.Update(exp);
     }
     db.SaveChanges();
     return(RedirectToAction(nameof(Edit), new { Id = exp.EmployeeId }));
 }
Пример #12
0
        private void SaveEmployeeExperience()
        {
            if (!SaveEmployee())
            {
                return;
            }

            var employeeExperience = new EmployeeExperience(SelectedEmployee);

            employeeExperience.ShowDialog();

            bool?dialogueResult = employeeExperience.DialogResult;

            if (dialogueResult != null && !(bool)dialogueResult)
            {
                return;
            }
            SaveEmployee();
        }
Пример #13
0
 public static EmployeeExperienceModel EditEmployeeExperience(EmployeeExperienceModel model)
 {
     using (var context = new MakeMyJobsEntities())
     {
         EmployeeExperience employeeExperience = context.EmployeeExperiences.FirstOrDefault(x => x.EmpExperienceId == model.empExperienceId);
         if (employeeExperience != null)
         {
             employeeExperience.EmployeeId  = model.employeeId;
             employeeExperience.CompanyName = model.companyName;
             employeeExperience.Position    = model.position;
             employeeExperience.JoinedOn    = model.joinedOn;
             employeeExperience.LeftOn      = model.leftOn;
             employeeExperience.IsActive    = 1;
             int updated = context.SaveChanges();
             if (updated > 0)
             {
                 return(new EmployeeExperienceModel()
                 {
                     empExperienceId = employeeExperience.EmpExperienceId,
                     employeeId = employeeExperience.EmployeeId,
                     companyName = employeeExperience.CompanyName,
                     position = employeeExperience.Position,
                     joinedOn = employeeExperience.JoinedOn,
                     leftOn = employeeExperience.LeftOn,
                     isActive = employeeExperience.IsActive
                 });
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             return(null);
         }
     }
 }
Пример #14
0
 public void Delete(EmployeeExperience entity)
 {
     _employeeExpDal.Delete(entity);
 }
Пример #15
0
 public void Update(EmployeeExperience entity)
 {
     _employeeExpDal.Update(entity);
 }
Пример #16
0
 public void Create(EmployeeExperience entity)
 {
     _employeeExpDal.Create(entity);
 }