114 lines
3.7 KiB
C#
114 lines
3.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace FPJ0000.OtConfirm
|
|
{
|
|
public partial class fHolyRequestAdd : Form
|
|
{
|
|
DSKuntae.EETGW_HolydayRequestRow dr;
|
|
public fHolyRequestAdd(DSKuntae.EETGW_HolydayRequestRow dr_)
|
|
{
|
|
InitializeComponent();
|
|
dr = dr_;
|
|
|
|
if (dr.RowState == DataRowState.Detached)
|
|
{
|
|
this.Text = "휴가신청 추가";
|
|
tbName.Text = FCOMMON.info.Login.nameK;
|
|
tbProcess.Text = FCOMMON.info.Login.process;
|
|
tbTel.Text = FCOMMON.info.Login.tel;
|
|
}
|
|
else
|
|
{
|
|
this.Text = "휴가신청 편집";
|
|
tbName.Text = dr.name;
|
|
tbProcess.Text = dr.processs;
|
|
tbTel.Text = dr.tel;
|
|
}
|
|
if (dr.conf == 1) rad1.Checked = true;
|
|
else if (dr.conf == 2) rad2.Checked = true;
|
|
else rad0.Checked = true;
|
|
|
|
tbCate.Text = dr.cate;
|
|
tbRemark.Text = dr.Remark;
|
|
tbResponse.Text = dr.Response;
|
|
tbSD.Value = DateTime.Parse(dr.sdate);
|
|
tbED.Value = DateTime.Parse(dr.edate);
|
|
}
|
|
int curLevel = 0;
|
|
private void fHolyRequestAdd_Load(object sender, EventArgs e)
|
|
{
|
|
curLevel = Math.Max(FCOMMON.info.Login.level, FCOMMON.DBM.getAuth(FCOMMON.DBM.eAuthType.holyreq));
|
|
|
|
//관리자라면 관리자패널을 활성해준다.
|
|
if(dr.RowState == DataRowState.Detached)
|
|
{
|
|
grpAdmin.Enabled = false;
|
|
}
|
|
else
|
|
{
|
|
grpAdmin.Enabled = curLevel >= 5;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
var cate = tbCate.Text.Trim();
|
|
var remark = tbRemark.Text.Trim();
|
|
var response = tbResponse.Text.Trim();
|
|
if (string.IsNullOrEmpty(cate))
|
|
{
|
|
FCOMMON.Util.MsgE("구분을 입력하세요 (연차/하기휴가/연장근무)");
|
|
tbCate.Focus();
|
|
return;
|
|
}
|
|
|
|
if (tbED.Value.ToShortDateString().CompareTo(tbSD.Value.ToShortDateString()) < 0)
|
|
{
|
|
FCOMMON.Util.MsgE("시작일~종료일 범위를 확인하세요");
|
|
return;
|
|
}
|
|
|
|
if (dr.RowState == DataRowState.Detached)
|
|
{
|
|
var dlg = FCOMMON.Util.MsgQ("입력을 완료하시겠습니까?\r\n관리자에게 메일로 알림이 발생 합니다");
|
|
if (dlg != DialogResult.Yes) return;
|
|
}
|
|
|
|
if (curLevel >= 5 && rad2.Checked)
|
|
{
|
|
if (string.IsNullOrEmpty(response))
|
|
{
|
|
FCOMMON.Util.MsgE("거절 사유를 입력 해주세요");
|
|
tbResponse.Focus();
|
|
return;
|
|
}
|
|
}
|
|
|
|
dr.cate = tbCate.Text.Trim();
|
|
dr.Remark = tbRemark.Text.Trim();
|
|
dr.Response = tbResponse.Text.Trim();
|
|
dr.sdate = tbSD.Value.ToShortDateString();
|
|
dr.edate = tbED.Value.ToShortDateString();
|
|
if (rad0.Checked) dr.conf = 0;
|
|
else if (rad1.Checked) dr.conf = 1;
|
|
else if (rad2.Checked) dr.conf = 2;
|
|
else dr.conf = 0;
|
|
dr.EndEdit();
|
|
|
|
DialogResult = DialogResult.OK;
|
|
}
|
|
|
|
|
|
}
|
|
}
|