private void btnCreate_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtEmployeeName.Text)) { MessageBox.Show("등록 할 [직원 성명]을 입력해주세요."); return; } // creat var emp = new EmployeeVO() { empId = "",// 이거는 입력해도 의미 없음 birthDate = employeeBirthDate.Value.ToUniversalTime().ToString("s") + "Z", birthState = cboEmployeeBrithState.SelectedItem.ToString() == "양력" ? "0" : cboEmployeeBrithState.SelectedItem.ToString() == "음력" ? "1" : "", depart = null, email = txtEmailFirst.Text + "@" + cboEmailAddr.Text, empAddr = txtEmployeeAddr.Text, empAddrDtl = txtEmployeeAddrDtl.Text, empEngNm = txtEmployeeEngName.Text, empFlag = cboEmployeeType.SelectedItem.ToString() == "정규직" ? "0" : cboEmployeeType.SelectedItem.ToString() == "계약직" ? "1" : cboEmployeeType.SelectedItem.ToString() == "협력사직원" ? "2" : cboEmployeeType.SelectedItem.ToString() == "파트타임" ? "3" : "9", empHp = txtEmployeeHtel.Text, empNm = txtEmployeeName.Text, empPwd = null, empTel = txtEmployeeTel.Text, empZip = txtEmployeeZip.Text, enteringDate = employeeEnteringDate.Value.ToUniversalTime().ToString("s") + "Z", leaveDate = cboEmployeeLeaveType.Text != "퇴사" ? "" : employeeLeaveDate.Value.ToUniversalTime().ToString("s") + "Z", loginDate = DateTime.MaxValue.ToUniversalTime().ToString("s") + "Z", maritalDate = cboEmployeeMaritalState.SelectedItem.ToString() != "기혼" ? "" : employeeMarital_date.Value.ToUniversalTime().ToString("s") + "Z", maritalState = cboEmployeeMaritalState.SelectedItem.ToString() == "기혼" ? "1" : cboEmployeeMaritalState.SelectedItem.ToString() == "미혼" ? "0" : "", officeTel = null, photo = null, position = null, reason = null, regEmpId = null, regEmpNm = null, registDste = DateTime.Now.ToUniversalTime().ToString("s") + "Z", rank = RankInfo.Where(o => o.rankName.Equals(cboRank.SelectedItem.ToString())).First(), project = ProjectInfo.Where(o => o.prjNm.Equals(cboProject.SelectedItem.ToString())).First(), spouseTel = null, state = null, team = cboTeamName.Text, updateDate = DateTime.Now.ToUniversalTime().ToString("s") + "Z", workPosition = cboWorkPosition.Text, userInfo = "", rankDisp = "", prjInfo = null }; ANBTX.Create("/api/employee", emp); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
// Create private void btnCreate_Click(object sender, EventArgs e) { var currentDate = DateTime.Now.ToLongDateString(); // creat var emp = new EmployeeVO() { empId = "", // 이거는 입력해도 의미 없음 birthDate = null, birthState = null, depart = null, email = "null empid test22", empAddr = null, empAddrDtl = null, empEngNm = null, empFlag = "CREATE22", empHp = "010CREATE22", empNm = textBox1.Text, empPwd = null, empTel = "010-0000-0000", empZip = null, enteringDate = currentDate, leaveDate = currentDate, loginDate = currentDate, maritalDate = null, maritalState = "true", officeTel = null, photo = null, position = null, reason = null, regEmpId = null, regEmpNm = null, registDste = currentDate, rank = new RankVO { rankCode = "RANK50", rankName = "대리", rankOrder = 50, useYn = "Y", regEmpId = null, regEmpNm = null, registDate = currentDate, updateDate = "" }, project = new ProjectVO { prjId = null, prjNm = null, prjStatus = null, startDate = null, endDate = null }, spouseTel = null, state = null, team = null, updateDate = currentDate, workPosition = null, userInfo = "CREATE,kim22", rankDisp = "CREATE", prjInfo = null }; ANBTX.Create(API_URL, emp); }