private void btnRead_Click(object sender, EventArgs e) { // read richTextBox1.AppendText("Employee Read....\n\r"); try { var lstEmployee = ANBTX_Common.GetEmployee(API_URL); if (lstEmployee == null || lstEmployee.Count == 0) { richTextBox1.AppendText("Employee Read Result : 0 \n\r"); return; } foreach (var emp in lstEmployee) { richTextBox1.AppendText(emp.empId + "\n\r"); } richTextBox1.AppendText("Employee Count :" + lstEmployee.Count + "\n\r"); } catch (Exception ex) { richTextBox1.AppendText(ex.ToString() + "\n\r"); } }
public void ReadStaffMagementListItem( ) { string API_URL = "/api/employee"; try { var lstEmployee = ANBTX_Common.GetEmployee(API_URL); if (lstEmployee == null || lstEmployee.Count == 0) { AddListColumns(); } else { m_hlist.Clear(); AddListColumns(); } int indexcount = 1; foreach (var emp in lstEmployee) { m_hlist.Items.Add(new ListViewItem(new string[] { "", indexcount.ToString(), emp.empNm, emp.rank.rankName, "디자인팀", "*****@*****.**", "ANB New Project", "2017-04-04", "이천", "정직원" })); indexcount++; } } catch (Exception ex) { MessageBox.Show(ex.ToString() + "\n\r"); } }
private void btnSave_Click(object sender, EventArgs e) { try { var lstEmployee = ANBTX_Common.GetEmployee(API_URL); for (int i = 0; i < grdRpt.Rows.Count; i++) { var chk = grdRpt.Rows[i].Cells[1].FormattedValue.ToString(); if (chk.Equals("True")) { var chkEmpId = grdRpt.Rows[i].Cells[2].FormattedValue.ToString(); if (lstEmployee.Any(o => o.empId.Equals(chkEmpId))) { var emp = lstEmployee.Where(o => o.empId.Equals(chkEmpId)).ToArray()[0]; emp.email = "updateTest!!!!!!!!!"; //emp.project.prjId = FrmProjectP1.prjId; //emp.project.prjNm = "test"; //emp.project.prjStatus = "OK"; //emp.project.startDate = DateTime.Now; //emp.project.endDate = DateTime.Now; ANBTX.Update(API_URL, emp); } } } MessageBox.Show("성공적으로 등록되었습니다."); } catch (Exception ex) { MessageBox.Show("An exception occurred :" + ex.ToString()); } this.Close(); }
private void InitControl() { //공통 코드 ( 근무지역 초기화 ) _lstCodeCommon = ANBTX_Common.GetCodeCommon(API_CODE_COMMON_URL); // 직원이름 초기화. _lstEmployeeTotal = ANBTX_Common.GetEmployee(API_EMPLOYEE_URL); var lstEmpName = _lstEmployeeTotal.Select(o => o.empNm).ToList().Where(o => !string.IsNullOrEmpty(o)).ToList(); this.SetComboBox(cboEmployeeName, lstEmpName); // 부서명 초기화. _lstTeam = _lstEmployeeTotal.Select(o => o.team).ToList().Where(o => !string.IsNullOrEmpty(o)).Distinct().ToList(); this.SetComboBox(cboTeamName, _lstTeam); // 프로젝트명 초기화. _lstProject = ANBTX_Common.GetProject(API_PROJECT_URL); var lstProject = _lstProject.Select(o => o.prjNm).Where(o => !string.IsNullOrEmpty(o)).Distinct().ToList(); this.SetComboBox(cboProjectName, lstProject); // 직급 초기화. _lstRank = ANBTX_Common.GetRank(API_RANK_URL); var lstRank = _lstRank.Select(o => o.rankName).ToList(); this.SetComboBox(cboRank, lstRank); // 기간 초기화. this.dtpkFrom.Value = DateTime.Today.AddDays(-30);; this.dtpkTo.Value = DateTime.Now; }
private void commGetEmp() { try { var lstEmp = ANBTX_Common.GetEmployee(API_URL_EMP); if (lstEmp == null || lstEmp.Count == 0) { MessageBox.Show("There is no data."); return; } //makeDt(lstEmp); } catch (Exception ex) { MessageBox.Show("An exception occurred :" + ex.ToString()); } }
public static SessionVO SessionCheck(string splitToken) { var check = splitToken.Split('.'); string partToConvert = check[1]; partToConvert = partToConvert.Replace('-', '+'); partToConvert = partToConvert.Replace('_', '/'); switch (partToConvert.Length % 4) { case 0: break; case 2: partToConvert += "=="; break; case 3: partToConvert += "="; break; } var partAsBytes = Convert.FromBase64String(partToConvert); Console.WriteLine(partAsBytes.ToString()); var partAsUTF8String = Encoding.UTF8.GetString(partAsBytes, 0, partAsBytes.Count()); Console.WriteLine(partAsUTF8String.ToString()); var jwt = JObject.Parse(partAsUTF8String); Console.WriteLine(jwt.ToString()); var session = new SessionVO(); session.loginEmailId = jwt.GetValue("user_name").ToString(); session.loginPassword = setSession.password.ToString() == null?session.loginPassword.ToString() : setSession.password.ToString(); session.loginJti = jwt.GetValue("jti").ToString(); session.loginAdmin = jwt.GetValue("authorities").ToString(); var gaga = ANBTX_Common.GetEmployee("/api/employee"); Console.WriteLine(gaga.Where(o => o.email != null && o.email.Equals("*****@*****.**")).Select(o => o.empNm).ToString()); //session.loginEmpId = gaga.Where(o => o.email == jwt.GetValue("user_name").ToString()).Select(o => o.empNm).; return(session); }
private void btnUpdate_Click(object sender, EventArgs e) { // update var lstEmployee = ANBTX_Common.GetEmployee(API_URL); if (lstEmployee.Any(o => o.empId.Equals(textBox3.Text))) { var emp = lstEmployee.Where(o => o.empId.Equals(textBox3.Text)).ToArray()[0]; emp.email = "updateTest!!!!!!!!!"; ANBTX.Update(API_URL, emp); } // 이렇게 하고 업데이트하니 에러발생. // error info. //{ //"timestamp": 1489502978843, //"status": 500, //"error": "Internal Server Error", //"exception": "org.springframework.dao.InvalidDataAccessApiUsageException", //"message": "Target object must not be null; nested exception is java.lang.IllegalArgumentException: Target object must not be null", //"path": "/api/employee" //} }