public string change_main(string emp, string position) { emp_positionModel ps = new emp_positionModel(); //old id ps.pos_emp_id = emp; ps.check_position_main(); ps.selectPositionById(ps.pos_id); ps.insert_positionLOG(); //update old to N ps.pos_active = "N"; ps.update_position(); //new id ps.pos_id = position; ps.selectPositionById(position); ps.insert_positionLOG(); //update new to Y ps.pos_active = "Y"; ps.update_position(); return(ps.pos_id); }
public IActionResult insert_position_resign(string emp_id, string prs_type, string prs_detail, string prs_date_resign, string prs_ref_emp_position_id) { emp_positionModel ps = new emp_positionModel(); ps.selectPositionById(prs_ref_emp_position_id); ps.insert_positionLOG(); EmpPositionResignModel prs = new EmpPositionResignModel(); prs.prs_ref_emp_posit_id = prs_ref_emp_position_id; prs.prs_ref_emp_id = emp_id; prs.prs_position_id = ps.pos_position_id; prs.prs_comp_id = ps.pos_comp_id; prs.prs_section_id = ps.pos_sect_id; prs.prs_dept_id = ps.pos_dept_id; prs.prs_type = ps.pos_type; prs.prs_start_date = ps.pos_start_date; prs.prs_resign_date = prs_date_resign; prs.prs_resign_type = prs_type; prs.prs_resign_detail = prs_detail; prs.insert_resign_position(); ps.pos_id = prs_ref_emp_position_id; ps.pos_resign_date = prs_date_resign; ps.event_status = "U"; ps.pos_status = "N"; ps.update_position(); return(RedirectToAction("emp", "Employee", new { code = emp_id })); }
public IActionResult editPosition(string emp_id, string position_id, string position_edit, string section_edit, string type_edit, string start_edit, string company_edit, string end_edit, string deptEdit) { emp_positionModel pos = new emp_positionModel(); pos.pos_emp_id = emp_id; pos.pos_id = position_id; pos.selectPositionById(position_id); pos.insert_positionLOG(); pos.pos_position_id = position_edit; pos.pos_type = type_edit; pos.pos_comp_id = company_edit; pos.pos_sect_id = section_edit; pos.pos_dept_id = deptEdit; pos.pos_resign_date = end_edit; pos.pos_start_date = start_edit; pos.event_status = "U"; pos.update_position(); return(RedirectToAction("emp", "Employee", new { code = emp_id })); }
public void del_position(string id, string emp_id) { emp_positionModel pos = new emp_positionModel(); pos.pos_emp_id = emp_id; pos.pos_id = id; pos.selectPositionById(id); pos.insert_positionLOG(); pos.event_status = "D"; pos.update_position(); }
public IActionResult insert_position_change(string position_ch, string company_ch, string section_ch, string dept_ch, string type_ch, string start_ch, string position_id_ch, string emp_id) { DateTime dt = new DateTime(3000, 01, 01); emp_positionModel pos = new emp_positionModel(); pos.pos_emp_id = emp_id; pos.pos_id = position_id_ch; pos.selectPositionById(position_id_ch); pos.insert_positionLOG(); pos.event_status = "U"; pos.pos_resign_date = Convert.ToDateTime(start_ch).ToString("yyyy-MM-dd"); pos.pos_start_date = start_ch; pos.update_position(); /// pos.pos_emp_id = emp_id; pos.pos_position_id = position_ch; pos.pos_type = type_ch; pos.pos_comp_id = company_ch; pos.pos_sect_id = section_ch; pos.pos_dept_id = dept_ch; pos.pos_start_date = start_ch; pos.pos_resign_date = Convert.ToDateTime(dt).ToString("yyyy-MM-dd"); pos.insert_position(); empPositionChangeModel pc = new empPositionChangeModel(); pc.pc_emp_id = emp_id; pc.pc_comp_id = company_ch; pc.pc_sect_id = section_ch; pc.pc_dept_id = dept_ch; pc.pc_position_id = position_ch; pc.pc_type = type_ch; pc.pc_start_date = start_ch; pc.pc_admin_id = "1"; pc.pc_status = "Y"; pc.pc_active = "Y"; pc.event_status = "S"; pc.pc_position_id_old = pos.pos_position_id; pc.pc_company_old = pos.pos_comp_id; pc.pc_section_old = pos.pos_sect_id; pc.pc_dept_old = pos.pos_dept_id; pc.pc_type_old = pos.pos_type; pc.pc_start_old = pos.pos_start_date; pc.pc_end_old = pos.pos_resign_date; pc.pc_ref_emp_position_id = position_id_ch; pc.insert_position_chane(); return(RedirectToAction("emp", "Employee", new { code = emp_id })); }