Esempio n. 1
0
        public override void DataSelect(int intKbn, object objList)
        {
            Common.gstrMsgSessionError = "";

            ExPage    pg;
            Dlg_Login login;

            object[] prm;

            switch ((ExWebService.geWebServiceCallKbn)intKbn)
            {
            case ExWebService.geWebServiceCallKbn.Login:
                EntitySysLogin entity = (EntitySysLogin)objList;
                switch (entity._login_flg)
                {
                case 0:             // 正常ログイン
                    if (Common.gblnStartSettingDlg == false)
                    {
                        Common.gblnStartSettingDlg = true;

                        ExBackgroundWorker.DoWork_StartUpInstanceSet();

                        // 起動時間短縮の為に画面情報を保持しておく
                        Dlg_InpSearch InpSearch = null;
                        Common.dataForm   = new View.Dlg.Dlg_DataForm();
                        Common.report     = new View.Dlg.Report.Dlg_Report();
                        Common.reportView = new View.Dlg.Report.Dlg_ReportView();
                        InpSearch         = Common.InpSearchEstimate;
                        InpSearch         = Common.InpSearchOrder;
                        InpSearch         = Common.InpSearchSales;
                        InpSearch         = Common.InpSearchReceipt;
                        InpSearch         = Common.InpSearchPlan;
                        InpSearch         = Common.InpSearchInvoice;
                        InpSearch         = Common.InpSearchPurchaseOrder;
                        InpSearch         = Common.InpSearchPurchase;
                        InpSearch         = Common.InpSearchPaymentCash;
                        InpSearch         = Common.InpSearchPayment;
                        InpSearch         = Common.InpSearchInOutDelivery;
                    }

                    // システム情報設定
                    Common.gintCompanyId                     = entity._company_id;
                    Common.gstrCompanyNm                     = entity._company_nm;
                    Common.gintGroupId                       = entity._group_id;
                    Common.gstrGroupNm                       = entity._group_nm;
                    Common.gintDefaultPersonId               = entity._defult_person_id;
                    Common.gstrDefaultPersonNm               = entity._defult_person_nm;
                    Common.gstrGroupDisplayNm                = entity._group_display_name;
                    Common.gintEvidenceFlg                   = entity._evidence_flg;
                    Common.gintidFigureSlipNo                = entity._idFigureSlipNo;
                    Common.gintidFigureCustomer              = entity._idFigureCustomer;
                    Common.gintidFigurePurchase              = entity._idFigurePurchase;
                    Common.gintidFigureCommodity             = entity._idFigureGoods;
                    Common.gintEstimateApprovalFlg           = entity._estimate_approval_flg;
                    Common.gintReceiptAccountInvoicePringFlg = entity._receipt_account_invoice_print_flg;
                    Common.gstrSessionString                 = entity._session_string;
                    Common.gintUserID        = entity._user_id;
                    Common.gstrUserNm        = entity._user_nm;
                    Common.gstrSessionString = entity._session_string;
                    Common.gstrLoginUserID   = this.txtLoginID.Text.Trim();;
                    Common.gstrLoginPassword = this.txtPass.Password.Trim();
                    Common.gintDemoFlg       = entity._demo_flg;
                    Common.gstrSystemVer     = entity._sys_ver;
                    Common.gblnLogin         = true;

                    // System開始時の証跡を保存
                    DataPgEvidence.SaveLoadOrUnLoadEvidence(DataPgEvidence.PGName.System, DataPgEvidence.geOperationType.Start);

                    // 名称リスト取得
                    prm    = new object[1];
                    prm[0] = "";
                    webService.CallWebService(ExWebService.geWebServiceCallKbn.GetNameList,
                                              ExWebService.geDialogDisplayFlg.No,
                                              ExWebService.geDialogCloseFlg.No,
                                              prm);
                    break;

                case 1:             // 同一ユーザーログイン
                    // 権限リスト取得
                    prm    = new object[1];
                    prm[0] = Common.gintUserID;
                    webService.CallWebService(ExWebService.geWebServiceCallKbn.GetAuthority,
                                              ExWebService.geDialogDisplayFlg.No,
                                              ExWebService.geDialogCloseFlg.Yes,
                                              prm);
                    //webService.ProcessingDlgClose();
                    //pg = (ExPage)ExVisualTreeHelper.FindPerentPage(this);
                    //if (pg != null)
                    //{
                    //    UA_Main main = (UA_Main)pg;
                    //    Common.gPageGroupType = Common.gePageGroupType.Menu;
                    //    Common.gPageType = Common.gePageType.Menu;
                    //    main.ChangePage();
                    //    return;
                    //}
                    //login = (Dlg_Login)ExVisualTreeHelper.FindPerentChildWindow(this);
                    //login.Close();
                    break;

                default:            // ログイン失敗
                    webService.ProcessingDlgClose();
                    ExMessageBox.Show(this, this.txtLoginID, entity._login_message);
                    return;
                }

                break;

            case ExWebService.geWebServiceCallKbn.GetNameList:
                Common.gNameList = new MeiNameList(objList);

                // 権限リスト取得
                prm    = new object[1];
                prm[0] = Common.gintUserID;
                webService.CallWebService(ExWebService.geWebServiceCallKbn.GetAuthority,
                                          ExWebService.geDialogDisplayFlg.No,
                                          ExWebService.geDialogCloseFlg.Yes,
                                          prm);
                break;

            case ExWebService.geWebServiceCallKbn.GetAuthority:
                Common.gAuthorityList = (ObservableCollection <EntityAuthority>)objList;

                pg = (ExPage)ExVisualTreeHelper.FindPerentPage(this);
                if (pg != null)
                {
                    if (Common.gstrSystemVer != "" && Common.gstrSystemVer != Common.gstrClinetVer)
                    {
                        ExMessageBox.Show("システムのバージョン Ver." + Common.gstrSystemVer + " がリリースされています。" + Environment.NewLine +
                                          "(現在 Ver." + Common.gstrClinetVer + ")" + Environment.NewLine +
                                          "一旦アンインストールして再インストールして下さい。");
                    }

                    UA_Main main = (UA_Main)pg;
                    Common.gPageGroupType = Common.gePageGroupType.Menu;
                    Common.gPageType      = Common.gePageType.Menu;
                    main.ChangePage();
                    return;
                }
                login = (Dlg_Login)ExVisualTreeHelper.FindPerentChildWindow(this);
                login.Close();
                break;
            }
        }