Exemple #1
0
        private void button8_Click(object sender, EventArgs e)
        {
            Matcher.Matcher.readAllCarParams("", @"D:\柔性参数填报系统\上海通用\data.xls");
            ChooseSample cs = new ChooseSample();

            cs.ShowDialog();
            LoginAction.tryLogin(this.mainWebBrowser);
        }
Exemple #2
0
        void rememberUsernameCheckEdit_EditValueChanged(object sender, EventArgs e)
        {
            MessageBox.Show(this.rememberUsernameCheckEdit.EditValue.ToString());
            //MessageBox.Show("test");
            String value    = this.rememberUsernameCheckEdit.EditValue.ToString();
            String username = this.usernameTextbox.EditValue.ToString();
            String password = this.passwordTextbox.EditValue.ToString();

            if (!String.IsNullOrEmpty(value) && value.Equals(true.ToString(), StringComparison.OrdinalIgnoreCase))
            {
                LoginAction.saveUsernameAndPassword(username, password);
            }
        }
Exemple #3
0
 void passwordTextbox_EditValueChanged(object sender, EventArgs e)
 {
     try
     {
         String password = this.passwordTextbox.EditValue.ToString();
         if (String.IsNullOrEmpty(password))
         {
             throw new Exception("密码为空");
         }
         else
         {
             LoginAction.saveUsernameAndPassword(Properties.Settings.Default.USERNAME, password);
             //this.mainWebBrowser.Url = new Uri(DeclarationSite.PZSite);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #4
0
 void usernameTextbox_EditValueChanged(object sender, EventArgs e)
 {
     try
     {
         String username = this.usernameTextbox.EditValue.ToString();
         if (String.IsNullOrEmpty(username))
         {
             throw new Exception("用户名为空");
         }
         else
         {
             LoginAction.saveUsernameAndPassword(username, Properties.Settings.Default.PASSWORD);
             //this.mainWebBrowser.Url = new Uri(DeclarationSite.PZSite);
         }
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
Exemple #5
0
        //private void Form1_FormClosing(object sender, EventArgs e)
        //{
        //    Application.Exit();
        //}

        //protected override void OnResize(EventArgs e)
        //{
        //    base.OnResize(e);
        //    if (cccFiller != null && ribbon.SelectedPage.Text == "CCC")
        //        cccFiller.SetWindowPos();
        //}

        //protected override void OnLocationChanged(EventArgs e)
        //{
        //    base.OnLocationChanged(e);
        //    if (cccFiller != null && ribbon.SelectedPage.Text == "CCC")
        //        cccFiller.SetWindowPos();
        //}

        //protected override void OnSizeChanged(EventArgs e)
        //{
        //    base.OnSizeChanged(e);
        //    if (cccFiller != null && ribbon.SelectedPage.Text == "CCC")
        //        cccFiller.SetWindowPos();
        //}

        private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                //判断dataFile地址是不是为空
                if (this.dataFileTextBox.EditValue == null)
                {
                    throw new Exception("数据文件未导入,请选择数据文件");
                }
                String        dataFilePath    = this.dataFileTextBox.EditValue.ToString();
                String        ruleFilePath    = ParamsCollection.localAddr + "rules.xls";
                ImportAction  importAction    = new ImportAction();
                List <String> listPackageCode = importAction.importDataAndRules(ruleFilePath, dataFilePath);

                ChooseSample cs = new ChooseSample();
                if (cs.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
                {
                    importAction.deleteUnselectedCarParams(ParamsCollection.selectedPackageCodes);
                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < ParamsCollection.carParams.Count; i++)
                    {
                        CarParams cps = ParamsCollection.carParams[i];
                        ParamsCollection.runningCarParams = cps;
                        this.RunningCarInfo.Caption       = "当前正在处理的车型为" + cps.packageCode + "  (" + (i + 1) + "/" + ParamsCollection.carParams.Count + ")";
                        cps.listHtmlAttributes.Clear();
                        cps.listHtmlAttributes.AddRange(DataTransformServiceForHCBM.getAllHAInACar(cps.listParams, ParamsCollection.dicRules));
                        LoginAction.tryLogin(this.mainWebBrowser);
                        this.wait(1);
                        this.mainWebBrowser.Navigate(Constants.APPLY_TEMPORARY_SEQUENCE_NUMBER_PAGE);
                        this.wait(1);
                        FillConfigurationAction f = new FillConfigurationAction(this.mainWebBrowser);
                        f.fillConfigTest(cps.listHtmlAttributes);
                        this.wait(1);
                        //f.submit();
                        this.wait(1);
                        //while (String.IsNullOrEmpty(ParamsCollection.runningCarParams.configCode))
                        //{
                        //    Application.DoEvents();
                        //}
                        this.wait(1);
                        f = new FillConfigurationAction(this.mainWebBrowser);
                        ExportServiceForHCBM.exportCarParams(dataFilePath, cps);
                        //在网页上直接提交车型
                        //f.submitConfigCode(ParamsCollection.runningCarParams.configCode);
                        //while (ParamsCollection.runningCarParams.submitConfigCode != true)
                        //{
                        //    Application.DoEvents();
                        //}
                    }
                    //LoggerUtils.LoggerUtils.loggerTxt(@"d:\test.txt", sb.ToString());
                    this.mainWebBrowser.Url     = new Uri(DeclarationSite.PZSite);
                    this.RunningCarInfo.Caption = "全部任务完成";
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace + ex.Message);
            }
        }