public IList <EMPLOYEE_INFO> GetEmployeeList(EMPLOYEE_COND param) { try { string sql = Global.DBAgent.LoadSQL(sqlBasePath + "BizService\\Member\\T_MEMBER_EMPLOYEE.xml", "GetEmployeeList" , param.PAGE_COUNT.ToString("10") , param.PAGE.ToString("1") , param.SORT.ToString("A.UPDATE_DATE DESC") , param.COMPANY_CODE.ToString("") , param.STORE_CODE.ToString("") , param.DEPT_SEARCH.ToString("") , param.DEPT_CODE.ToString("") , param.PARENT_MEMBER_CODE.ToString("") , param.MEMBER_CODE.ToString("") , param.USER_NAME.ToString("") , param.MOBILE.ToString("") , param.COMP_POSITION.ToString("") , param.COMP_TITLE.ToString("") , param.STR_EMP_AUTH.ToString("") , param.FR_BIRTH.ToString("").RemoveDateString() , param.TO_BIRTH.ToString("").RemoveDateString() , (param.HIDE == null ? "" : (param.HIDE == true ? "1" : "0")) ); return(db.ExecuteQuery <EMPLOYEE_INFO>(sql).ToList()); } catch (Exception ex) { logger.Debug("EmployeeService >> GetEmployeeList : " + ex.Message); return(new List <EMPLOYEE_INFO> ()); } }
public ActionResult MemberExcelReport(EMPLOYEE_COND Cond) { List <string> headers = new List <string>() { "이름", "아이디", "전화번호", "생년월일", "상급자", "권한", "수정자", "수정시간" }; Cond.PAGE = 1; Cond.PAGE_COUNT = 100000; if (SessionHelper.LoginInfo.STORE_CODE != 1) { Cond.MEMBER_CODE = SessionHelper.LoginInfo.EMPLOYEE.MEMBER_CODE; } return(Service.employeeService.GetEmployeeList(Cond).Select(s => new { USER_NAME = s.USER_NAME , USER_ID = s.USER_ID , MOBILE = s.MOBILE , BIRTH = s.BIRTH.ToFormatDate() , PARENT_MEMBER_NAME = s.PARENT_MEMBER_NAME , EMP_AUTH_NAME = s.EMP_AUTH_NAME , UPDATE_MEMBER_NAME = s.UPDATE_NAME , UPDATE_DATE = s.UPDATE_DATE }).ToList().ToExcel(SessionHelper.LoginInfo.CURRENT_MENU_NAME + DateTime.Now.ToString("_yyyyMMddHHmmss"), headers)); }
/// <summary> /// 직원의 직책, 권한에 따른 직원조회 /// </summary> /// <param name="helper"></param> /// <param name="id"></param> /// <param name="Param"></param> /// <param name="selectedValue"></param> /// <param name="optionLabel"></param> /// <param name="htmlAttributes"></param> /// <returns></returns> public static MvcHtmlString MemberCombo2(this HtmlHelper helper, string id, EMPLOYEE_COND Param, string selectedValue = null, string optionLabel = "-선택-", object htmlAttributes = null) { //IList<T_MEMBER> list = new BaseService().GetMember(Param); IList <EMPLOYEE_INFO> list = Service.employeeService.GetEmployeeList(Param); if (list == null) { list = new List <EMPLOYEE_INFO>(); } var combo = list.Select(s => new SelectListItem { Value = s.MEMBER_CODE.ToString(), Text = s.USER_NAME, Selected = (selectedValue == s.MEMBER_CODE.ToString()) ? true : false }); var arrHtmlAtribute = SetDefaultSemanticSize(htmlAttributes); string shtml = helper.DropDownList(id, combo, optionLabel, arrHtmlAtribute).ToHtmlString(); return(new MvcHtmlString(shtml)); }
public PartialViewResult PV_MemberList(EMPLOYEE_COND Cond) { if (SessionHelper.LoginInfo.STORE_CODE != 1) { Cond.COMPANY_CODE = SessionHelper.LoginInfo.COMPANY_CODE; } if (!(SessionHelper.LoginInfo.STORE.STORE_TYPE == 1 || SessionHelper.LoginInfo.STORE.STORE_TYPE == 4)) { Cond.STORE_CODE = SessionHelper.LoginInfo.STORE_CODE; } if (SessionHelper.LoginInfo.EMPLOYEE.EMP_AUTH != null) { switch (SessionHelper.LoginInfo.EMPLOYEE.EMP_AUTH) { case 2: /*상위부서권한*/ Cond.STORE_CODE = SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE; Cond.DEPT_SEARCH = SessionHelper.LoginInfo.EMPLOYEE.DEPT_SEARCH.ToString(""); break; case 3: /*부서권한*/ Cond.STORE_CODE = SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE; Cond.DEPT_CODE = SessionHelper.LoginInfo.EMPLOYEE.DEPT_CODE; break; case 8: /*상급자권한*/ Cond.STORE_CODE = SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE; Cond.PARENT_MEMBER_CODE = SessionHelper.LoginInfo.EMPLOYEE.MEMBER_CODE; break; case 9: /*본인권한*/ Cond.STORE_CODE = SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE; Cond.MEMBER_CODE = SessionHelper.LoginInfo.EMPLOYEE.MEMBER_CODE; break; } } ViewBag.list = Service.employeeService.GetEmployeeList(Cond); return(PartialView2()); }
public PartialViewResult EmployeeCombo(string name, EMPLOYEE_COND Param, string selectedValue, string optionLabel, string htmlAttributes) { List <SelectListItem> combolist = new List <SelectListItem>(); IList <EMPLOYEE_INFO> list = new ALT.BizService.EmployeeService().GetEmployeeList(Param); if (list == null) { list = new List <EMPLOYEE_INFO>(); } DROPDOWN_COND data = new DROPDOWN_COND { name = name , selectList = list.Select(s => new SelectListItem { Value = s.MEMBER_CODE.ToString(), Text = s.USER_NAME, Selected = (selectedValue == s.MEMBER_CODE.ToString()) ? true : false }).ToList() , optionLabel = optionLabel , htmlAttributes = JsonConvert.DeserializeAnonymousType(htmlAttributes, new { @class = "", @style = "", @placeholder = "", @readonly = "" }) }; return(PartialCombo(data)); }
public ActionResult EmployeeExcelReport(EMPLOYEE_COND Cond) { List <string> headers = new List <string>() { "지점명", "직책", "직급", "이름", "아이디", "전화번호", "생년월일", "상급자", "권한", "수정자", "수정시간" }; Cond.PAGE = 1; Cond.PAGE_COUNT = 100000; if (SessionHelper.LoginInfo.EMPLOYEE.EMP_AUTH != null) { switch (SessionHelper.LoginInfo.EMPLOYEE.EMP_AUTH) { case 2: /*상위부서권한*/ Cond.STORE_CODE = SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE; Cond.DEPT_SEARCH = SessionHelper.LoginInfo.EMPLOYEE.DEPT_SEARCH.ToString(""); break; case 3: /*부서권한*/ Cond.STORE_CODE = SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE; Cond.DEPT_CODE = SessionHelper.LoginInfo.EMPLOYEE.DEPT_CODE; break; case 8: /*상급자권한*/ Cond.STORE_CODE = SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE; Cond.PARENT_MEMBER_CODE = SessionHelper.LoginInfo.EMPLOYEE.MEMBER_CODE; break; case 9: /*본인권한*/ Cond.STORE_CODE = SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE; Cond.MEMBER_CODE = SessionHelper.LoginInfo.EMPLOYEE.MEMBER_CODE; break; } } return(Service.employeeService.GetEmployeeList(Cond).Select(s => new { STORE_NAME = s.STORE_NAME , MEMBER_CODE = s.MEMBER_CODE , COMP_POSITION_NAME = s.COMP_POSITION_NAME , COMP_TITLE_NAME = s.COMP_TITLE_NAME , USER_NAME = s.USER_NAME , USER_ID = s.USER_ID , MOBILE = s.MOBILE , BIRTH = s.BIRTH.ToFormatDate() , PARENT_MEMBER_NAME = s.PARENT_MEMBER_NAME , EMP_AUTH_NAME = s.EMP_AUTH_NAME , UPDATE_MEMBER_NAME = s.UPDATE_NAME , UPDATE_DATE = s.UPDATE_DATE }).ToList().ToExcel(SessionHelper.LoginInfo.CURRENT_MENU_NAME + DateTime.Now.ToString("_yyyyMMddHHmmss"), headers)); }
public ActionResult EmployeeReg(EMPLOYEE_COND Cond, int?id = -1) { int? member_code = id; EMPLOYEE_INFO data = new EMPLOYEE_INFO(); if (SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE != 1) { Cond.STORE_CODE = SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE; } if (id >= 0) { data = Service.employeeService.GetEmployeeList(new EMPLOYEE_COND { MEMBER_CODE = id }).FirstOrDefault(); } if (data == null || data.MEMBER_CODE == null) { data = new EMPLOYEE_INFO() { COMPANY_CODE = Cond.COMPANY_CODE, STORE_CODE = Cond.STORE_CODE, DEPT_CODE = Cond.DEPT_CODE }; var storelist = new BasicService().GetStoreList(new T_STORE_COND { STORE_CODE = data.STORE_CODE }); if (storelist.Count() == 1) { data.COMPANY_CODE = storelist[0].COMPANY_CODE; data.COMPANY_NAME = storelist[0].COMPANY_NAME; data.STORE_CODE = storelist[0].STORE_CODE; data.STORE_NAME = storelist[0].STORE_NAME; } } if (SessionHelper.LoginInfo.STORE.STORE_CODE != 1) { Cond.COMPANY_CODE = SessionHelper.LoginInfo.STORE.COMPANY_CODE; } if (SessionHelper.LoginInfo.EMPLOYEE.STORE_CODE != 1 && !(SessionHelper.LoginInfo.STORE.STORE_TYPE == 1 || SessionHelper.LoginInfo.STORE.STORE_TYPE == 4)) { Cond.STORE_CODE = SessionHelper.LoginInfo.STORE.STORE_CODE; } ViewBag.data = data; data.STORE_CODE = (data.STORE_CODE == null ? 1 : data.STORE_CODE); List <SelectListItem> deptCombo = Service.employeeService.GetStoreDept(new T_STORE_DEPT() { STORE_CODE = data.STORE_CODE }).Select(x => new SelectListItem() { Text = x.DEPT_NAME, Value = x.DEPT_CODE.ToString() }).ToList(); ViewBag.deptCombo = (deptCombo == null) ? new List <SelectListItem>() : deptCombo; IList <T_STORE_POSITION> positionList = Service.employeeService.GetStorePosition(new T_STORE_POSITION() { STORE_CODE = data.STORE_CODE, HIDE = false }); if (positionList != null) { int positionSeq = positionList.Where(x => x.POSITION_TYPE == 1 && x.POSITION_CODE == SessionHelper.LoginInfo.EMPLOYEE.COMP_POSITION).First().SEQ; int titleSeq = positionList.Where(x => x.POSITION_TYPE == 2 && x.POSITION_CODE == SessionHelper.LoginInfo.EMPLOYEE.COMP_TITLE).First().SEQ; ViewBag.positionCombo1 = positionList.Where(x => x.POSITION_TYPE == 1 && x.SEQ >= positionSeq).Select(x => new SelectListItem() { Text = x.NAME, Value = x.POSITION_CODE.ToString() }).ToList(); //직급 ViewBag.positionCombo2 = positionList.Where(x => x.POSITION_TYPE == 2 && x.SEQ >= titleSeq).Select(x => new SelectListItem() { Text = x.NAME, Value = x.POSITION_CODE.ToString() }).ToList(); //직책 } IList <T_STORE_WEBMENU_GROUP> menuGroupList = Service.employeeService.GetMenuGroupList(new T_STORE_WEBMENU_GROUP() { STORE_CODE = data.STORE_CODE, HIDE = false }); var menuGroup = menuGroupList.Where(w => w.GROUP_CODE == SessionHelper.LoginInfo.EMPLOYEE.MENU_GROUP).FirstOrDefault(); var chkGroupCode = (menuGroup == null) ? 1 : menuGroup.ORDER_SEQ; ViewBag.menuGroupList = (menuGroupList == null) ? new List <SelectListItem>() : menuGroupList.Where(w => w.ORDER_SEQ >= chkGroupCode).Select(x => new SelectListItem() { Text = x.GROUP_NAME, Value = x.GROUP_CODE.ToString() }).ToList(); return(View()); }