public ApplicationPopupForm(EmployeeVO employeeVO, int app_id = 0)
        {
            try
            {
                InitializeComponent();
                this.employeeVO = employeeVO;
                this.app_id     = app_id;
                this.Text       = app_id > 0 ? "어플리케이션 수정" : "어플리케이션 등록";

                if (app_id > 0)
                {
                    ApplicationVO applicationVO = applicationService.GetApplication(app_id);

                    txtApp_name.Text = applicationVO.App_name;
                    nudApp_seq.Value = applicationVO.App_seq;

                    if (applicationVO.App_use == "Y")
                    {
                        rdoApp_useY.Checked = true;
                    }
                    else
                    {
                        rdoApp_useN.Checked = true;
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
        public WorkOrderPopupForm(EmployeeVO employeeVO, int work_order_no = 0)
        {
            try
            {
                InitializeComponent();
                this.employeeVO    = employeeVO;
                this.work_order_no = work_order_no;
                this.Text          = work_order_no > 0 ? "작업 지시 수정" : "작업 지시 등록";
                cboFactory.ComboBinding(new FactoryService().GetFactories(this.employeeVO.GetCorporationID()), "FACTORY_NAME", "FACTORY_ID", "선택", 0);
                cboLine.ComboBinding("선택", 0);
                cboProcess.ComboBinding("선택", 0);
                cboProduct.ComboBinding(new ProductService().GetProducts(), "PRODUCT_NAME", "PRODUCT_ID", "선택", 0);

                if (work_order_no > 0)
                {
                    DateTime    now         = DateTime.Now;
                    WorkOrderVO workOrderVO = workOrderService.GetWorkOrder(work_order_no);
                    cboFactory.SelectedValue = workOrderVO.Factory_id;
                    cboLine.SelectedValue    = workOrderVO.Line_id;
                    cboProcess.SelectedValue = workOrderVO.Process_id;
                    cboWorker.SelectedValue  = workOrderVO.Worker_id;
                    cboProduct.SelectedValue = workOrderVO.Product_id;
                    dtpWorkDate.Value        = workOrderVO.Work_order_date;
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Esempio n. 3
0
        public ProgramPopupForm(EmployeeVO employeeVO, int prog_id = 0)
        {
            try
            {
                InitializeComponent();
                this.employeeVO = employeeVO;
                this.prog_id    = prog_id;
                this.Text       = prog_id > 0 ? "프로그램 수정" : "프로그램 등록";
                cboModule_id.ComboBinding(new ModuleService().GetModules(1), "MODULE_NAME", "MODULE_ID");

                if (prog_id > 0)
                {
                    ProgramVO programVO = programService.GetProgram(prog_id);

                    cboModule_id.SelectedValue = programVO.Module_id;
                    txtProg_name.Text          = programVO.Prog_name;
                    txtProg_form_name.Text     = programVO.Prog_form_name;
                    nudProg_seq.Value          = programVO.Prog_seq;
                    txtProg_expl.Text          = programVO.Prog_expl;

                    if (programVO.Prog_use == "Y")
                    {
                        rdoProg_useY.Checked = true;
                    }
                    else
                    {
                        rdoProg_useN.Checked = true;
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Esempio n. 4
0
        public AuthorityGroupPopupForm(EmployeeVO employeeVO, int ath_grp_id = 0)
        {
            try
            {
                InitializeComponent();
                this.employeeVO = employeeVO;
                this.ath_grp_id = ath_grp_id;
                this.Text       = ath_grp_id > 0 ? "권한그룹 수정" : "권한그룹 등록";

                if (ath_grp_id > 0)
                {
                    AuthorityGroupVO AuthorityGroupVO = authorityService.GetAuthorityGroup(ath_grp_id);

                    txtAth_grp_name.Text = AuthorityGroupVO.Ath_grp_name;
                    nudAth_grp_seq.Value = AuthorityGroupVO.Ath_grp_seq;
                    txtAth_grp_expl.Text = AuthorityGroupVO.Ath_grp_expl;

                    if (AuthorityGroupVO.Ath_grp_use == "Y")
                    {
                        rdoAth_grp_useY.Checked = true;
                    }
                    else
                    {
                        rdoAth_grp_useN.Checked = true;
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Esempio n. 5
0
        public EmployeeVO GetLoginEmployee(string employee_id, string employee_pwd)
        {
            EmployeeVO employeeVO = null;
            string     sql        = @"SELECT EMPLOYEE_ID, CORPORATION_ID, ATH_GRP_ID, EMPLOYEE_NAME, EMPLOYEE_USE
						   FROM TBL_EMPLOYEE
						   WHERE EMPLOYEE_ID = @EMPLOYEE_ID
						   AND EMPLOYEE_PWD = @EMPLOYEE_PWD"                        ;
            SqlCommand cmd        = new SqlCommand();

            cmd.Connection  = new SqlConnection(connStr);
            cmd.CommandText = sql;
            cmd.Parameters.AddWithValue("@EMPLOYEE_ID", employee_id);
            cmd.Parameters.AddWithValue("@EMPLOYEE_PWD", employee_pwd);

            cmd.Connection.Open();
            SqlDataReader reader = cmd.ExecuteReader();

            if (reader.Read())
            {
                employeeVO = new EmployeeVO
                {
                    Employee_id    = reader["EMPLOYEE_ID"].ToString(),
                    Corporation_id = Convert.ToInt32(reader["CORPORATION_ID"]),
                    Ath_grp_id     = Convert.ToInt32(reader["ATH_GRP_ID"]),
                    Employee_name  = reader["EMPLOYEE_NAME"].ToString(),
                    Employee_use   = reader["EMPLOYEE_USE"].ToString()
                };
            }

            cmd.Connection.Close();

            return(employeeVO);
        }
Esempio n. 6
0
        private void ProcessWorkerForm_Load(object sender, EventArgs e)
        {
            dgvProcessWorker.IsAllCheckColumnHeader = true;

            dgvProcessWorker.AddNewColumns("법인명", "corporation_name", 100, true);
            dgvProcessWorker.AddNewColumns("공장명", "factory_name", 100, true);
            dgvProcessWorker.AddNewColumns("라인명", "line_name", 100, true);
            dgvProcessWorker.AddNewColumns("공정명", "process_name", 100, true);
            dgvProcessWorker.AddNewColumns("작업자코드", "worker_id", 100, false);
            dgvProcessWorker.AddNewColumns("작업자명", "employee_name", 100, true);

            LoadData();

            cboCorporationName.ComboBinding(service.CorporationCombm(), "corporation_id", "corporation_name", "전체", 0);
            factories = service.FactoryCombo();
            cboFactoryName.ComboBinding(factories != null ? factories.ToList() : null, "factory_id", "factory_name", "전체", 0);
            employees = service.EmployeeCombo();
            cboWorkerName.ComboBinding(employees != null ? employees.ToList() : null, "Employee_id", "Employee_name", "전체", "");

            cboFactoryName.ComboBinding(service.FactoryCombo(), "factory_id", "factory_name", "전체", 0);
            lines = service.LineCombo();
            cboLineName.ComboBinding(lines != null ? lines.ToList() : null, "line_id", "line_name", "전체", 0);

            cboLineName.ComboBinding(service.LineCombo(), "line_id", "line_name", "전체", 0);
            proceses = service.ProcessCombo();
            cboProcessName.ComboBinding(proceses != null ? proceses.ToList() : null, "process_id", "process_name", "전체", 0);



            emp = this.GetEmployee();
        }
        private void dgvEmp_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int empID = Convert.ToInt32(dgvEmp[0, e.RowIndex].Value);

            EmployeeService service = new EmployeeService();
            EmployeeVO      emp     = service.GetEmployeeInfo(empID);

            lblEmployeeID.Text  = emp.EmployeeID.ToString();
            txtFirstName2.Text  = emp.FirstName.Trim();
            txtLastName2.Text   = emp.LastName.Trim();
            txtTitle2.Text      = emp.Title.Trim();
            dtpBirthDate2.Value = Convert.ToDateTime(emp.BirthDate);
            dtpHiredDate2.Value = Convert.ToDateTime(emp.HireDate);
            txtHomePhone2.Text  = emp.HomePhone ?? "";
            txtNotes2.Text      = emp.Notes.Trim();

            //byte[] => PictureBox image

            //MemoryStream ms = new MemoryStream(emp.Photo);
            //picEmp2.Image = Image.FromStream(ms);

            //picEmp2.Image = new Bitmap(new MemoryStream(emp.Photo));

            //Image.FromStream(ms) 에서 오류가 발생
            //정상적인 이미지 포맷이 아니거나, 적절한 메타정보가 없어서 오류가 발생하는 경우 있다

            TypeConverter tc = TypeDescriptor.GetConverter(typeof(Bitmap));

            picEmp2.Image = (Bitmap)(tc.ConvertFrom(emp.Photo));
        }
Esempio n. 8
0
 public bool SaveEmployee(EmployeeVO employeeVO)
 {
     using (EmployeeDAC employeeDAC = new EmployeeDAC())
     {
         return(employeeDAC.SaveEmployee(employeeVO));
     }
 }
Esempio n. 9
0
        private void StorageForm_Load(object sender, EventArgs e)
        {
            DataGridViewContentAlignment RightAlign = DataGridViewContentAlignment.MiddleRight;

            dgv.IsAllCheckColumnHeader = true;

            dgv.AddNewColumns("창고 ID", "storage_id", 150, true, true, false, RightAlign);
            dgv.AddNewColumns("법인명", "corporation_name", 150, true);
            dgv.AddNewColumns("공장명", "factory_name", 150, true);
            dgv.AddNewColumns("창고명", "storage_name", 150, true);
            dgv.AddNewColumns("사용 여부", "storage_use", 150, true);
            dgv.AddNewColumns("창고 순번", "storage_seq", 150, true, true, false, RightAlign);
            dgv.AddNewColumns("최초등록시간", "first_regist_time", 150, true);
            dgv.AddNewColumns("최초등록직원", "first_regist_employee", 150, true);
            dgv.AddNewColumns("최종등록시간", "final_regist_time", 150, true);
            dgv.AddNewColumns("최종등록직원", "final_regist_employee", 150, true);

            emp = this.GetEmployee();


            dgv.DataSource = ss.SelectStorage();
            List <CorporationVO> corpInfo = cs.CorporationComboBinding();

            //corpInfo.Insert(0, new CorporationVO
            //{
            //    corporation_id = 0,
            //    corporation_name = "전체"
            //});

            cboCorporation.SelectedIndexChanged += CorporationChange;
            cboCorporation.ComboBinding(corpInfo, "corporation_id", "corporation_name", "전체", 0);
        }
Esempio n. 10
0
        private void CompanyForm_Load(object sender, EventArgs e)
        {
            DataGridViewContentAlignment RightAlign = DataGridViewContentAlignment.MiddleRight;

            dgvCompanyList.IsAllCheckColumnHeader = true;

            //거래처리스트 거래처코드, 거래처명칭, 거래처유형, 거래처순번, 거래처사용여부, 최초 최종
            dgvCompanyList.AddNewColumns("거래처코드", "company_id", 100, true, true, false, RightAlign);
            dgvCompanyList.AddNewColumns("거래처명칭", "company_name", 100, true);
            dgvCompanyList.AddNewColumns("거래처유형", "COMMON_NAME", 100, true);
            dgvCompanyList.AddNewColumns("거래처순번", "company_seq", 100, true, true, false, RightAlign);
            dgvCompanyList.AddNewColumns("최초등록 시각", "first_regist_time", 100, true);
            dgvCompanyList.AddNewColumns("최초등록 사원", "first_regist_employee", 100, true);
            dgvCompanyList.AddNewColumns("최종등록 시각", "final_regist_time", 100, true);
            dgvCompanyList.AddNewColumns("최종등록 사원", "final_regist_employee", 100, true);

            list = new CommonCodeService().GetCommonCodes("COMTYPE");
            //list = service.GetCommonCodeList("COMTYPE");
            cboCompany_Type.ComboBinding(list, "전체");

            string type = string.Empty;

            if (cboCompany_Type.SelectedValue == null)
            {
                type = "";
            }
            else
            {
                type = cboCompany_Type.SelectedValue.ToString();
            }

            LoadData();

            emp = this.GetEmployee();
        }
 /********************************************************
          Updates a row in the tbl_employee table given the fully-populated
          EmployeeVO object.
      **********************************************************/
 public EmployeeVO UpdateEmployee(EmployeeVO employee){
   try {
     DbCommand command = DataBase.GetSqlStringCommand(UPDATE_EMPLOYEE);
     DataBase.AddInParameter(command, FIRST_NAME, DbType.String, employee.FirstName);
     DataBase.AddInParameter(command, MIDDLE_NAME, DbType.String, employee.MiddleName);
     DataBase.AddInParameter(command, LAST_NAME, DbType.String, employee.LastName);
     DataBase.AddInParameter(command, BIRTHDAY, DbType.DateTime, employee.BirthDay);
     switch(employee.Gender){
       case EmployeeVO.Sex.MALE: DataBase.AddInParameter(command, GENDER, DbType.String, "M");
            break;
       case EmployeeVO.Sex.FEMALE: DataBase.AddInParameter(command, GENDER, DbType.String, "F");
            break;
     }
     if(employee.Picture != null){
      if(debug){ Console.WriteLine("Inserting picture!"); }
       MemoryStream ms = new MemoryStream();
       employee.Picture.Save(ms, ImageFormat.Tiff);
       byte[] byte_array = ms.ToArray();
       if(debug){
         for(int i=0; i<byte_array.Length; i++){
           Console.Write(byte_array[i]);
         }
       } // end if debug
      DataBase.AddInParameter(command, PICTURE, DbType.Binary, byte_array); 
      if(debug){ Console.WriteLine("Picture inserted, I think!"); }
     }
     DataBase.AddInParameter(command, EMPLOYEE_ID, DbType.Guid, employee.EmployeeID);
     DataBase.ExecuteNonQuery(command);
 }catch(Exception e){
   Console.WriteLine(e);
 }
 return this.GetEmployee(employee.EmployeeID);
 }
Esempio n. 12
0
        private void LineForm_Load(object sender, EventArgs e)
        {
            DataGridViewContentAlignment RightAlign = DataGridViewContentAlignment.MiddleRight;

            dgvLinelist.IsAllCheckColumnHeader = true;

            dgvLinelist.AddNewColumns("법인명", "corporation_name", 100, true);
            dgvLinelist.AddNewColumns("공장명", "factory_name", 100, true);
            dgvLinelist.AddNewColumns("라인코드", "line_id", 100, true);
            dgvLinelist.AddNewColumns("라인명", "line_name", 100, true);
            dgvLinelist.AddNewColumns("라인순번", "line_seq", 100, true, true, false, RightAlign);
            dgvLinelist.AddNewColumns("라인비고1", "line_note1", 100, true);
            dgvLinelist.AddNewColumns("라인비고2", "line_note2", 100, true);
            dgvLinelist.AddNewBtnCol("사용여부", "", new Padding(1, 1, 1, 1), false); // 8 버튼
            dgvLinelist.AddNewColumns("사용여부", "line_use", 100, true);             // 9
            dgvLinelist.AddNewColumns("최초등록시각", "first_regist_time", 100, true);
            dgvLinelist.AddNewColumns("최초등록사원", "first_regist_employee", 100, true);
            dgvLinelist.AddNewColumns("최종등록시각", "final_regist_time", 100, true);
            dgvLinelist.AddNewColumns("최종등록사원", "final_regist_employee", 100, true);

            LoadData();
            cboCorporationName.ComboBinding(service.LineComboGet(), "corporation_id", "corporation_name", "전체", 0);
            factories = service.factoryAllCombo();
            cboFactoryName.ComboBinding(factories != null ? factories.ToList() : null, "factory_id", "factory_name", "전체", 0);


            emp = this.GetEmployee();
        }
Esempio n. 13
0
        public bool InsertEmployee(EmployeeVO item)
        {
            string sql = "CMG_InsertEmployee";

            try
            {
                using (SqlCommand cmd = new SqlCommand(sql, conn))
                {
                    cmd.Parameters.AddWithValue("@Employees_Name", item.Employees_Name);
                    cmd.Parameters.AddWithValue("@CodeTable_CodeID", item.CodeTable_CodeID);
                    cmd.Parameters.AddWithValue("@Employees_Hiredate", item.Employees_Hiredate);
                    cmd.Parameters.AddWithValue("@Employees_Resigndate", DBNull.Value);
                    cmd.Parameters.AddWithValue("@Employees_PWD", item.Employees_PWD);
                    cmd.Parameters.AddWithValue("@Employees_Phone", item.Employees_Phone);
                    cmd.Parameters.AddWithValue("@Employees_Birth", item.Employees_Birth);
                    cmd.CommandType = CommandType.StoredProcedure;

                    conn.Open();
                    var rowsAffected = cmd.ExecuteNonQuery();
                    return(rowsAffected > 0);
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                conn.Close();
            }
        }
        private EmployeeVO FillInEmployeeVO(IDataReader reader)
        {
            EmployeeVO empVO = new EmployeeVO();

            empVO.EmployeeID = reader.GetInt32(0);
            empVO.FirstName  = reader.GetString(1);
            empVO.MiddleName = reader.GetString(2);
            empVO.LastName   = reader.GetString(3);
            empVO.Birthday   = reader.GetDateTime(4);
            empVO.HireDate   = reader.GetDateTime(5);
            empVO.IsActive   = reader.GetBoolean(6);
            empVO.UserName   = reader.GetString(7);
            string gender = reader.GetString(8);

            switch (gender)
            {
            case "M":
                empVO.Gender = EmployeeVO.Sex.MALE;
                break;

            case "F":
                empVO.Gender = EmployeeVO.Sex.FEMALE;
                break;
            }

            if (!reader.IsDBNull(9))
            {
                empVO.Picture = (byte[])reader.GetValue(9);
            }

            return(empVO);
        }
Esempio n. 15
0
        private void FactorySave(string UseCheck, string Status, int factory_id)
        {
            if (MessageBox.Show($"공장을 {Status}하시겠습니까?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                EmployeeVO employee = this.GetEmployee();

                FactoryVO factory = new FactoryVO
                {
                    factory_id            = factory_id,
                    corporation_id        = cboName.SelectedValue.ToInt(),
                    factory_name          = txtName.Text,
                    factory_seq           = Convert.ToInt32((nudFactory_seq.Value.ToString().Length > 0) ? nudFactory_seq.Value.ToString() : "0"),
                    factory_use           = UseCheck,
                    first_regist_employee = employeeName,
                    final_regist_employee = employeeName,
                    factory_note1         = txtNote1.Text,
                    factory_note2         = txtNote2.Text
                };

                if (service.SaveFactory(factory))
                {
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
            }
        }
        public TokenVO ValidateCredentials(EmployeeVO employeeCredentials)
        {
            var employee = _repository.ValidateCredentials(employeeCredentials);

            if (employee == null)
            {
                return(null);
            }
            var claims = new List <Claim>
            {
                new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString("N")),
                new Claim(JwtRegisteredClaimNames.UniqueName, employee.Username)
            };

            var accessToken  = _tokenService.GenerateAccessToken(claims);
            var refreshToken = _tokenService.GenerateRefreshToken();

            employee.RefreshToken           = refreshToken;
            employee.RefreshTokenExpiryTime = DateTime.Now.AddDays(_configuration.DaysToExpire);

            _repository.RefreshEmployeeInfo(employee);

            DateTime createDate     = DateTime.Now;
            DateTime expirationDate = createDate.AddMinutes(_configuration.Minutes);

            return(new TokenVO(
                       true,
                       createDate.ToString(DATE_FORMAT),
                       expirationDate.ToString(DATE_FORMAT),
                       accessToken,
                       refreshToken
                       ));
        }
Esempio n. 17
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.HasEmptyTxt())
                {
                    return;
                }

                string employee_id  = txtEmployee_id.Text.Trim();
                string employee_pwd = txtEmployee_pwd.Text.Trim().GetSHA256();

                Employee = employeeService.GetLoginEmployee(employee_id, employee_pwd);

                if (Employee != null)
                {
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("로그인에 실패했습니다. ID혹은 비밀번호를 확인해주세요.");
                    txtEmployee_pwd.Focus();
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Esempio n. 18
0
        public EmployeeVO InsertEmployee(string first_name,
                                         string middle_name,
                                         string last_name,
                                         DateTime birthday,
                                         DateTime hiredate,
                                         Boolean is_active,
                                         string username,
                                         EmployeeVO.Sex gender,
                                         byte[] picture)
        {
            EmployeeVO vo = new EmployeeVO();

            vo.FirstName  = first_name;
            vo.MiddleName = middle_name;
            vo.LastName   = last_name;
            vo.Birthday   = birthday;
            vo.HireDate   = hiredate;
            vo.UserName   = username;
            vo.IsActive   = is_active;
            vo.Gender     = gender;
            vo.Picture    = picture;

            try
            {
                EmployeeDAO dao = new EmployeeDAO();
                vo = dao.InsertEmployee(vo);
            }
            catch (Exception e)
            {
                LogError(e);
            }
            return(vo);
        }
Esempio n. 19
0
        public ModulePopupForm(EmployeeVO employeeVO, int module_id = 0)
        {
            try
            {
                InitializeComponent();
                this.employeeVO = employeeVO;
                this.module_id  = module_id;
                this.Text       = module_id > 0 ? "모듈 수정" : "모듈 등록";
                cboApp_id.ComboBinding(new ApplicationService().GetAllApplications(true), "APP_NAME", "APP_ID");

                if (module_id > 0)
                {
                    ModuleVO moduleVO = moduleService.GetModule(module_id);

                    cboApp_id.SelectedItem = moduleVO.App_id;
                    txtModule.Text         = moduleVO.Module_name;
                    nudModule_seq.Value    = moduleVO.Module_seq;

                    if (moduleVO.Module_use == "Y")
                    {
                        rdoModule_useY.Checked = true;
                    }
                    else
                    {
                        rdoModule_useN.Checked = true;
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Esempio n. 20
0
		/*******************************************************
		Inserts an employee given a fully-populated EmployeeVO object
		*********************************************************/
		public EmployeeVO InsertEmployee(EmployeeVO employee){
			try{
				employee.EmployeeID = Guid.NewGuid();
				DbCommand command = DataBase.GetSqlStringCommand(INSERT_EMPLOYEE);
				DataBase.AddInParameter(command, EMPLOYEE_ID, DbType.Guid, employee.EmployeeID);
				DataBase.AddInParameter(command, FIRST_NAME, DbType.String, employee.FirstName);
				DataBase.AddInParameter(command, MIDDLE_NAME, DbType.String, employee.MiddleName);
				DataBase.AddInParameter(command, LAST_NAME, DbType.String, employee.LastName);
				DataBase.AddInParameter(command, BIRTHDAY, DbType.DateTime, employee.Birthday);
				switch(employee.Gender){
					case EmployeeVO.Sex.MALE: 
							DataBase.AddInParameter(command, GENDER, DbType.String, "M");
							break;
					case EmployeeVO.Sex.FEMALE: 
							DataBase.AddInParameter(command, GENDER, DbType.String, "F");
							break;
				}

				if(employee.Picture != null){
					if(debug) Console.WriteLine("Inserting picture!"); 
					if(debug){
						for(int i=0; i<employee.Picture.Length; i++){
						Console.Write(employee.Picture[i]);
						}
					} // end if debug
					DataBase.AddInParameter(command, PICTURE, DbType.Binary, employee.Picture); 
					if(debug) Console.WriteLine("Picture inserted, I think!");
				}
				DataBase.ExecuteNonQuery(command);
			} catch(Exception e){
					Console.WriteLine(e);
			}
			return this.GetEmployee(employee.EmployeeID);
		}
 /********************************************************
          Private utility method that populates an EmployeeVO object from
          data read from the IDataReader object
     ************************************************************/
 private EmployeeVO FillInEmployeeVO(IDataReader reader){
   EmployeeVO empVO = new EmployeeVO();
   empVO.EmployeeID = reader.GetGuid(0);
   empVO.FirstName = reader.GetString(1);
   empVO.MiddleName = reader.GetString(2);
   empVO.LastName = reader.GetString(3);
   empVO.BirthDay = reader.GetDateTime(4);
   String gender = reader.GetString(5);
   switch(gender){
     case "M" : empVO.Gender = EmployeeVO.Sex.MALE;
                break;
     case "F" : empVO.Gender = EmployeeVO.Sex.FEMALE;
                break;
   }
   if(!reader.IsDBNull(6)){
     int buffersize = 5000;
     int startindex = 0;
     Byte[] byte_array = new Byte[buffersize];
     MemoryStream ms = new MemoryStream();
     long retval = reader.GetBytes(6, startindex, byte_array, 0, buffersize);
     while(retval > 0){
       ms.Write(byte_array, 0, byte_array.Length);
       startindex += buffersize;
       retval = reader.GetBytes(6, startindex, byte_array, 0, buffersize);
      }
     empVO.Picture = new Bitmap(ms);
   }
   return empVO;
 }
Esempio n. 22
0
        public static EmployeeVO AddEmployee(EmployeeVO emp)
        {
            EmployeeVO e = emp;

            e.Saved = true;

            return(e);
        }
    public void LoadEmployee(Object sender, EventArgs e)
    {
        EmployeeDAO dao = new EmployeeDAO();

        _emp_vo.Picture   = null;
        _emp_vo           = dao.GetEmployee(_emp_vo.EmployeeID);
        _picturebox.Image = _emp_vo.Picture;
    }
Esempio n. 24
0
        // BOM 복사
        public void BOMCopySettings(ProductManagementForm frm, EmployeeVO employee, List <int> ProductIDs, bool IsBomCopy)
        {
            this.ProductIDs = ProductIDs;
            this.IsBomCopy  = IsBomCopy;

            CheckedList = new List <BomVO>();

            BOMBindingSettings(frm, employee, true, "");
        }
 private void UpdateInfo(EmployeeVO item)
 {
     eCode = item.Employees_ID;
     txtEmployeesName.Text           = item.Employees_Name;
     maskedEmployeesPhoneNumber.Text = item.Employees_Phone;
     departID = item.CodeTable_CodeID;
     dtpEmployeesBirthDay.Value = Convert.ToDateTime(item.Employees_Birth);
     dtpEmployeesHireDate.Value = Convert.ToDateTime(item.Employees_Hiredate);
 }
Esempio n. 26
0
 public ModulePopupForm(EmployeeVO employeeVO)
 {
     try
     {
     }
     catch (Exception err)
     {
         MessageBox.Show(err.Message);
     }
 }
    public void UpdateEmployee(Object sender, EventArgs e)
    {
        _emp_vo = this.PopulateEmployeeVOFromEntryFields(_emp_vo);
        EmployeeAdminBO bo = new EmployeeAdminBO();

        _emp_vo = bo.UpdateEmployee(_emp_vo);
        this.ResetEntryFields();
        this.DisplayEmployeeInfo();
        this.DisplayEmployeeTraining(bo);
    }
Esempio n. 28
0
        private void Add(object sender, EventArgs e)
        {
            EmployeeVO      employeeVO = this.GetEmployee();
            ModulePopupForm frm        = new ModulePopupForm(employeeVO);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                LoadData();
            }
        }
Esempio n. 29
0
        public EmployeeVO GetEmployeeByID(int employeeID)
        {
            EmployeeData employeeData = new EmployeeData();
            EmployeeVO   employeeVO   = new EmployeeVO();
            EmployeePO   employeePO   = employeeData.GetEmployeeByID(employeeID);

            employeeVO = Mapper.Map <EmployeePO, EmployeeVO>(employeePO);

            return(employeeVO);
        }
 private EmployeeVO PopulateEmployeeVOFromEntryFields(EmployeeVO vo)
 {
     vo.FirstName  = _fname_textbox.Text;
     vo.MiddleName = _mname_textbox.Text;
     vo.LastName   = _lname_textbox.Text;
     vo.Gender     = this.RadioButtonToSexEnum();
     vo.BirthDay   = _bday_picker.Value;
     vo.Picture    = _picturebox.Image;
     return(vo);
 }