예제 #1
0
 private void wReportView_Load(object sender, EventArgs e)
 {
     try
     {
         if (oBackgroundWorker.IsBusy != true)
         {
             oBackgroundWorker.RunWorkerAsync();
             oW_ProgressDlg = new wProgressDlg();
             oW_ProgressDlg.ShowDialog();
         }
         ocrCrystalReportViewer.ReportSource = oCryRpt;
     }
     catch (Exception oEx)
     {
         throw oEx;
     }
 }
예제 #2
0
        private void ocmOk_Click(object sender, EventArgs e)
        {
            try
            {
                if (oBackgroundWorker.IsBusy != true)
                {
                    oBackgroundWorker.RunWorkerAsync();
                    oW_ProgressDlg = new wProgressDlg();
                    oW_ProgressDlg.ShowDialog();
                }
                if (otbUsrName.Text.Equals(""))
                {
                    otbUsrName.Focus();
                    return;
                }
                if (otbUsrPwd.Text.Equals(""))
                {
                    otbUsrPwd.Focus();
                    return;
                }

                var oEmpFCode = W_CHKoLogin();
                if (oEmpFCode.Rows.Count > 0)
                {
                    otaTebControl.SelectedTab = otaTabReport;
                    otoLogout.Enabled         = true;
                    ostUserDT.Text            = oEmpFCode.Rows[0]["FTEmpCode"].ToString();
                    //  otoRptPreview.Visible = true;
                    otoPlantDB.Visible = false;
                    log.Info(ostUserDT.Text + ": Login Successful");
                }
                else
                {
                    MessageBox.Show("UserName or Password InValidate", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    log.Info("UserName or Password InValidate");
                }
            }
            catch (Exception oEx)
            {
                MessageBox.Show("ไม่พบข้อมูล[กรุณาเลือกPlantให้ถุกต้อง]", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                log.Error("ไม่พบข้อมูล[กรุณาเลือกPlantให้ถุกต้อง]" + oEx.Message);
            }
        }