Beispiel #1
0
 void MDIParent1_Shown(object sender, EventArgs e)
 {
     if (SysApp.ClassCurUser.LogInEmplId == null || string.IsNullOrEmpty(ClassCurUser.LogInEmplId.ToString()))
     {
         using (FormLogIn frmLogIn = new FormLogIn()) 
         {
             frmLogIn.StartPosition = FormStartPosition.CenterParent;
             if (DialogResult.OK == frmLogIn.ShowDialog(this))
             {
                 this.statusLabelUserName.Text = ClassCurUser.LogInEmplName;
             }
             else
             {
                 this.statusLabelUserName.Text = "";
                 this.Close();
             }
             
         }
     }
 }
Beispiel #2
0
        //private void radTreeViewSecur_NodeMouseClick(object sender, RadTreeViewEventArgs e)
        //{
        //    switch (e.Node.Name)
        //    {
        //        case "Pay_SignUp":
        //            this.PaySignUp();
        //            break;
        //        default:break;
        //    }
        //    switch (e.Node.Name)
        //    {
        //        case "Pay_Diagnosis":
        //            this.PayDiagnosis();
        //            break;
        //        default:break;
        //    }
        //    switch (e.Node.Name)
        //    {
        //        case "Pay_Workpermit":
        //            this.PayWorkpermit();
        //            break;
        //        default: break;
        //    }
        //    switch (e.Node.Name)
        //    {
        //        case "Pay_Visa":
        //            this.PayVisa();
        //            break;
        //        default: break;
        //    }

        //    switch (e.Node.Name)
        //    {
        //        case "Pay_Report":
        //            this.PayReport();
        //            break;
        //        default: break;
        //    }
        //}

        #endregion

        #region <Functions and Methods>
        // <SignIn and SignOut>
        private void LogIn()
        {
            if (ClassCurUser.LogInEmplId == null || string.IsNullOrEmpty(ClassCurUser.LogInEmplId.ToString()))
            {
                using (FormLogIn frmLogIn = new FormLogIn())
                {
                    frmLogIn.StartPosition = FormStartPosition.CenterParent;
                    if (DialogResult.OK == frmLogIn.ShowDialog(this))
                    {
                        this.statusLabelUserName.Text = ClassCurUser.LogInEmplName;
                        //<neung 26-04-57>
                        this.sys_hdapprove = ClassCurUser.SysOutoffice;

                        this.sys_hrapprovein = ClassCurUser.SysHrApproveIn;
                        this.sys_hrapproveout = ClassCurUser.SysHrApproveOut;

                        this.sys_mnapprovein = ClassCurUser.SysMNApproveIn;
                        this.sys_mnapproveout = ClassCurUser.SysMNApproveOut;
                        this.sys_administrater = ClassCurUser.SysAdministrator;

                        if (sys_hdapprove != "")
                        {
                            if (sys_hdapprove == "1")
                            {
                                // radPageViewStart.Pages[0].Hide();
                                this.radPageViewPage2.Enabled = true;
                            }
                            else
                            {
                                this.radPageViewPage2.Enabled = false;
                            }
                        }
                        if (sys_mnapprovein != "" && sys_mnapproveout != "")
                        {
                            if (sys_mnapprovein == "1" || sys_mnapproveout == "1")
                            {
                                this.radPageViewPage4.Enabled = true;
                            }
                            else
                            {
                                this.radPageViewPage4.Enabled = false;
                            }
                        }

                        if (sys_hrapprovein != "" && sys_hrapproveout != "")
                        {
                            if (sys_hrapprovein == "1" || sys_hrapproveout == "1")
                            {
                                this.radPageViewPage5.Enabled = true;
                            }
                            else
                            {
                                this.radPageViewPage5.Enabled = false;
                            }
                        }
                        if (sys_administrater != "")
                        {
                            if (sys_administrater == "1")
                            {
                                this.radPageViewPage3.Enabled = true;
                            }
                            else
                            {
                                this.radPageViewPage3.Enabled = false;
                            }
                        }
                        //<end neung>
                    }
                    else
                    {
                        this.statusLabelUserName.Text = "";
                        this.Close();
                    }
                }
            }
        }