Beispiel #1
0
        /// <summary>
        /// @author:khoaht
        /// @createdate:5/2008
        /// </summary>
        /// <param name="formId"></param>
        /// <returns></returns>
        private CommonForm GetFormObject(int formId)
        {
            CommonForm frm = null;
            switch (formId)
            {
                case CONFIG.FORM_CUSTOMER:
                    frm = new FrmCustomer();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_CLIP:
                    frm = new FrmClip();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_WORKSTATION:
                    frm = new FrmWorkstation();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_WORKSTATION_STATUS:
                    frm = new FrmListWorkstationStatus();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_AREA:
                    frm = new FrmArea();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_SCHEDULE:
                    frm = new FrmSchedule();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_CSDL:
                    frm = new FrmDBConfigServer();
                    break;
                case CONFIG.FORM_ABOUT:
                    frm = new AboutAdvertise();
                    break;
                case CONFIG.FORM_CONFIG_PROPERTIES:
                    frm = new FrmConfigProperties();
                    break;
                    // REPORT FORM
                case   CONFIG.FORM_REPORT_CURRENCY:
                    frm = new FrmCurrencyReport();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_REPORT_WORKSTATION:
                    frm = new FrmRptWorkstatoinFree();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_REPORT_CUSTOMER:
                    frm = new FrmRptScheduleBillDetail();
                    frm.MdiParent = this;
                    break;

                     // Admin tool
                case CONFIG.FORM_ADMIN_GROUPS:
                    frm = new FrmGroup();
                    frm.MdiParent = this;
                    break;
                case CONFIG.FORM_ADMIN_USERS:
                    frm = new FrmUser();
                    frm.MdiParent = this;
                    break;
            }

            return frm;
        }
Beispiel #2
0
            /// <summary>
            /// @author : KhoaHT
            /// @CreateDate:04/07/2008
            /// @Description: Process test connection
            /// </summary>
            public override void Process()
            {
                try
                {
                    SetProcessingLabel("Đang kiểm tra kết nối CSDL.");
                    SetOverallValue(1);
                    if (!QTC.Adv.BusinessModule.Global.HasValidDBConfig() || !QTC.Adv.BusinessModule.Global.TestConnection())
                    {
                        FrmDBConfigServer frmDBConfig = new FrmDBConfigServer();
                        frmDBConfig.ShowInTaskbar = true;
                        frmDBConfig.ShowDialog();
                    }

                    SetProcessingLabel("Đang lấy cấu hình hệ thống.");
                    SetOverallValue(2);
                    QTC.Adv.BusinessModule.Global.LoadPropertiesInfo();

                    bool blnLogin = false;
                    if (QTC.Admin.WinForm.Global.SavedInfo)
                        blnLogin = QTC.Admin.WinForm.Global.Login();
                    if (!blnLogin)
                    {
                            QTC.Admin.WinForm.FrmLogin frmLogin = new QTC.Admin.WinForm.FrmLogin();
                            frmLogin.ShowInTaskbar = true;
                            frmLogin.UserName = QTC.Admin.WinForm.Global.SavedInfo ? QTC.Admin.WinForm.Global.UserName : "";
                            frmLogin.SavedInfo = QTC.Admin.WinForm.Global.SavedInfo;
                            frmLogin.ShowDialog();
                    }
                    SetOverallValue(3);

                    mblnSuccess = true;
                }
                catch (Exception exp)
                {
                    mblnSuccess = false;
                    mException = exp;
                }
                finally
                {
                    CloseForm();
                }
            }