Example #1
0
        private void btnSaveAndAutomate_Click(object sender, EventArgs e)
        {
            if (((DataTable)dgDatabase.DataSource).Rows.Count < 1)
            {
                MessageBox.Show("Nothing to Save and Automate.");
                SharedValidators.Log.LogMessages(" Error : next_Click: Nothing to Save and Automate. ");
                return;
            }
            saveprogress_Click(btnsaveprogress, new EventArgs());

            //  panel3.Visible = false;
            foreach (var process in Process.GetProcesses())
            {
                if (process.ProcessName == "DEApp")
                {
                    process.Kill();
                }
            }
            DataRow[] dr = ((DataTable)dgDatabase.DataSource).Select("Verified=true");

            if (dr.Length > 0)
            {
                int fField = Convert.ToInt32(ConfigurationManager.AppSettings["FormFields"].ToString());
                int loginRequired = Convert.ToInt32(ConfigurationManager.AppSettings["loginRequired"].ToString());

                string appPath = ConfigurationManager.AppSettings["appPath"].ToString();
                string loginWinName = ConfigurationManager.AppSettings["loginWindowName"].ToString();
                string MainWinName = ConfigurationManager.AppSettings["MainWindowName"].ToString();
                string DriveName = ConfigurationManager.AppSettings["DriveName"].ToString();
                //lblStatus.Text = dr.Length.ToString() + " Records to fill";
                ExtraFeatures feature = new ExtraFeatures(this);

                Dbmdb = new SharedValidators.DataBase("database.mdb");
                Dbmdb.getRowCount();
                DateTime DT = Convert.ToDateTime(Dbmdb.dataTable.Rows[Dbmdb.dataTable.Rows.Count - 1]["submittedOn"].ToString());

                ADS.Form.Filler.Scenarios.Win32Tests x = new ADS.Form.Filler.Scenarios.Win32Tests();
                // x.NotepadTests();

                string eMessage = x.USdeap(appPath, dr, fField, loginRequired, loginWinName, MainWinName, lblInputdirectory.Text, DriveName);
                if (!String.IsNullOrEmpty(eMessage))
                {
                    SharedValidators.Log.LogMessages("Error :  During Automation " + eMessage);

                    return;
                }
                feature.DoRandomizeSubmission("database.mdb", DT, Dbmdb.dataTable.Rows.Count);
            }
        }
Example #2
0
        public Form1()
        {
            try
            {
                InitializeComponent();
                this.Text += "  V:" + xVersion;
                NoFields = Convert.ToInt32(ConfigurationManager.AppSettings["NoFields"]);
                extrafeature = lic.CheckFeature("FeatureSet1") ;
                AdvancedFeature = lic.CheckFeature("AdvancedFeature") ;
                OCRFeature = lic.CheckFeature("OCRFeature");
                lastFormField = Convert.ToInt32(ConfigurationManager.AppSettings["FormFields"].ToString());
                btnAdvanced.Visible = AdvancedFeature;
                grpmearge.Visible = lic.CheckFeature("MergeFileFeature");
                btnConvertMdbtoXl.Visible = lic.CheckFeature("ConvertToXls");
                btnRandomizeDateTime.Visible = lic.CheckFeature("RandomizeDateTime");
                dtpStartdate.Visible = lic.CheckFeature("RandomizeDateTime");
                lbldatetime.Visible = lic.CheckFeature("RandomizeDateTime");

                grpMdbChanges.Visible = lic.CheckFeature("RandomizeDateTime") || lic.CheckFeature("ConvertToXls");

                //grpmearge.Visible = extrafeature;
                if (Convert.ToInt32(lic.GetProperties("OCRFeature")) < 2)
                {
                    btnADSConvert.Visible = OCRFeature;
                }
                else
                {
                    SharedValidators.ModifyRegistry Reg = new SharedValidators.ModifyRegistry();
                    btnADSConvert.Visible =  (Reg.Read("OCRTRIED") == null);

                }
                ExtraFeatures feature = new ExtraFeatures(this);
                columnNames = feature.BuildColumnNames();
                SharedValidators.Machine Machine = new SharedValidators.Machine();
                string MachineKey = Machine.GetMachineIdentificationKey();
                LicenceValidated = lic.ValidateCurrentKey(MachineKey);

                suped = lic.suped();
                txtMessage.Text = Machine.GetDisplayMessage(MachineKey, lic);
                Rectangle resolution = Screen.PrimaryScreen.Bounds;
                this.Width = resolution.Width;
                this.Height = resolution.Height;
                this.MinimumSize = new System.Drawing.Size(this.Width, (this.Height * 97 / 100));
                this.MaximumSize = new System.Drawing.Size(this.Width, (this.Height * 97 / 100));
                ResizeCode();
                pnlMain.Visible = true;
                pnlGrid.Visible = false;
                pnlMain.BringToFront();
                chkAutoHighlight.Checked = false;
                chkAutoSave.Checked = false;

                txtMessage.Visible = !lic.isAdmin;
                plnAdminTools.Visible = lic.isAdmin;
                if (lic.isAdmin)
                {
                    txtclientName.Text = lic.GetProperties("CustomerName");
                    txtMachines.Text = lic.GetProperties("NumberofMachines");
                    Licence.StringCipher cypher = new Licence.StringCipher();
                    for (int i = 1; i <= Convert.ToInt32(txtMachines.Text); i++)
                    {
                        string ekey = lic.GetProperties("Mkey" + i.ToString());
                        if (ekey != "")
                        {
                            string uekey = cypher.Decrypt(ekey, lic.cypherKey);
                            ListViewItem lt = new ListViewItem();
                            lt.Text = "Mkey" + i.ToString();
                            lt.SubItems.Add(uekey);
                            lt.SubItems.Add(ekey);
                            lslLicences.Items.Add(lt);

                        }
                    }
                }

                pnlLeft.Enabled = LicenceValidated;
                pnlGrid.Enabled = LicenceValidated;
                lblInputdirectory.Text = ConfigurationManager.AppSettings["inputfolder"].ToString();
                lblOutputdirectory.Text = ConfigurationManager.AppSettings["outputfolder"].ToString();

                SharedValidators.Log.LogMessages(" Form constructor " + "done");

            }
            catch (Exception e)
            {
                SharedValidators.Log.LogMessages("Error :  Form constructor " + e.Message.ToString());

            }
        }
Example #3
0
        private void btnRandomizeDateTime_Click(object sender, EventArgs e)
        {
            ExtraFeatures feature = new ExtraFeatures(this);

                OFileDialog.Tag = 32;
                OFileDialog.ShowDialog();
                if (OFileDialog.FileName.IndexOf(".mdb") > 0)
                {
                    feature.DoRandomizeSubmission(OFileDialog.FileName, dtpStartdate.Value);
                }
        }
Example #4
0
        private void btnMergedFile_Click(object sender, EventArgs e)
        {
            folderBrowserDialog1.ShowDialog();
            btnMergedFile.Text = folderBrowserDialog1.SelectedPath;
            if (btnfirstfile.Text == "Choose First File" || btnsecondfile.Text == "Choose Second File") return;

            if (btnMergedFile.Text == "Location of  Merged File") return;

            ExtraFeatures feature = new ExtraFeatures(this);
            feature.Mearge2ADSFiles(btnfirstfile.Text, btnsecondfile.Text, btnMergedFile.Text);

            btnfirstfile.Text = "Choose First File";
            btnsecondfile.Text = "Choose Second File";

            btnMergedFile.Text = "Location of  Merged File";
        }
Example #5
0
 private void btnConvertMdbtoXl_Click(object sender, EventArgs e)
 {
     OFileDialog.Tag = 31;
     OFileDialog.ShowDialog();
     ExtraFeatures feature = new ExtraFeatures(this);
     feature.ConvertMDBtoXLS(OFileDialog.FileName);
 }
Example #6
0
        private void saveprogress_Click(object sender, EventArgs e)
        {
            ExtraFeatures feature = new ExtraFeatures(this);

            DataTable dt = (DataTable)dgDatabase.DataSource;
            string ofile = lbladsFile.Text;
            if (SharedValidators.FileLocked.FileInUse(ofile) || SharedValidators.FileLocked.FileInUse(ofile.Replace(".ads", ".lds")))
            {
                MessageBox.Show("System is using the files. Please wait for some time.");
                return;
            }
            feature.SaveDataChanges(dt, ofile);
        }