private void Shift_HeadApprove() { //if (ClassCurUser.LogInSection == "32" || ClassCurUser.LogInSection == "322") //{ //if (CheckShiftLogIn() == true) if (CheckLogIn() == true) { HRDOCS.Shift_ApproveHD shiftheadapprove = new Shift_ApproveHD(); if (!this.CheckOpened(shiftheadapprove.Name)) { shiftheadapprove.EmplId = ClassCurUser.LogInEmplId; shiftheadapprove.EmplName = ClassCurUser.LogInEmplName; shiftheadapprove.Key = ClassCurUser.LogInEmplKey; shiftheadapprove.SysOutoffice = ClassCurUser.SysOutoffice; shiftheadapprove.StartPosition = FormStartPosition.CenterParent; shiftheadapprove.WindowState = FormWindowState.Maximized; if (shiftheadapprove.SysOutoffice == "1") { shiftheadapprove.MdiParent = this; shiftheadapprove.Show(); } else { MessageBox.Show("คุณไม่มีสิทธิเข้าถึงหน้านี้ได้"); } } //if (!ActivateForm(shiftheadapprove)) //{ // shiftheadapprove.EmplId = ClassCurUser.LogInEmplId; // shiftheadapprove.EmplName = ClassCurUser.LogInEmplName; // shiftheadapprove.Key = ClassCurUser.LogInEmplKey; // shiftheadapprove.SysOutoffice = ClassCurUser.SysOutoffice; // shiftheadapprove.StartPosition = FormStartPosition.CenterParent; // shiftheadapprove.WindowState = FormWindowState.Maximized; // if (shiftheadapprove.SysOutoffice == "1") // { // shiftheadapprove.MdiParent = this; // shiftheadapprove.Show(); // } // else // { // MessageBox.Show("คุณไม่มีสิทธิเข้าถึงหน้านี้ได้"); // } //} } //} else { MessageBox.Show("คุณไม่มีสิทธิเข้าถึงหน้านี้ได้"); } }
void Btn_HDApprove_Click(object sender, EventArgs e) { using (Shift_ApproveHD frm = new Shift_ApproveHD()) { frm.Text = "หัวหน้า/ผู้ช่วย อนุมัติ"; if (ClassForm.ShowDialog(frm) == DialogResult.Yes) { } } }