Files
Groupware/SubProject/FPJ0000/OtConfirm/fOTConfirmOK.cs
2022-02-25 19:36:51 +09:00

87 lines
2.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 fOTConfirmOK : Form
{
dsPRJ.JobReportRow dr;
Boolean binit = false;
public fOTConfirmOK(dsPRJ.JobReportRow dr_)
{
InitializeComponent();
dr = dr_;
//var userlist = FCOMMON.DBM.getUserTable();
//this.cmbUser.DataSource = userlist;
//this.cmbUser.ValueMember = "id";
//this.cmbUser.DisplayMember = "dispname";
textBox1.Text = dr.username;
textBox2.Text = dr.pdate;
textBox3.Text = dr.projectName;
tbRemark.Text = dr.description;
numericUpDown2.Value = (decimal)dr.ot;
tbRemark.ImeMode = ImeMode.Hangul;
var dt = DateTime.Parse(dr.pdate);
textBox2.Text = dt.ToLongDateString();
if(dt.DayOfWeek == DayOfWeek.Sunday || dt.DayOfWeek == DayOfWeek.Saturday)
{
numericUpDown1.Value = (decimal)(dr.ot * 1.5f);
}
else
{
numericUpDown1.Value = (decimal)dr.ot;
}
}
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));
button1.Enabled = curLevel >= 5;
binit = true;
}
private void button1_Click(object sender, EventArgs e)
{
var intime = (float)numericUpDown1.Value;
if (intime == 0f)
{
var dlg = FCOMMON.Util.MsgQ("승인시간이 입력되지 않았습니다. 저장 할까요?\n해당 자료는 미승인 자료가 됩니다");
if (dlg != DialogResult.Yes) return;
}
else
{
var dlg = FCOMMON.Util.MsgQ("승인시간을 입력할까요?\n" +
$"요청:{numericUpDown2.Value},승인:{numericUpDown1.Value}\n" +
$"비고:{tbResponse.Text}\n" +
$"바로 저장 됩니다");
if (dlg != DialogResult.Yes) return;
}
dr.ot2 = (float)this.numericUpDown1.Value;
dr.otReason = this.tbResponse.Text.Trim();
dr.EndEdit();
DialogResult = DialogResult.OK;
}
}
}