Example #1
0
 private void SetValues()
 {
     this.license.TypeCode     = this.Label1.Text;
     this.license.AcctNo       = CLAS_Security.CleanStringRegex(this.txtAcctNum.Text);
     this.license.AName        = CLAS_Security.CleanStringRegex(this.txtAppName.Text);
     this.license.BAddr        = CLAS_Security.CleanStringRegex(this.txtBusAdd.Text);
     this.license.BCity        = CLAS_Security.CleanStringRegex(this.txtBusCity.Text);
     this.license.BName        = CLAS_Security.CleanStringRegex(this.txtBusName.Text);
     this.errorHandle          = "Check the Bond Amount. Invalid number";
     this.license.BondAmt      = (this.txtBondAmt.Text != string.Empty) ? Convert.ToDecimal(CLAS_Security.CleanStringRegex(this.txtBondAmt.Text)) : new decimal(0);
     this.errorHandle          = "Check the Bond Date. Invalid Date mm/dd/yyyy";
     this.license.BondDate     = (this.txtBondDate.Text == string.Empty) ? DateTime.MinValue : Convert.ToDateTime(this.txtBondDate.Text);
     this.license.BPhone       = CLAS_Security.CleanStringRegex(this.txtBusPhone.Text);
     this.license.BState       = CLAS_Security.CleanStringRegex(this.txtBusSt.Text);
     this.license.BZip         = CLAS_Security.CleanStringRegex(this.txtBusZip.Text);
     this.license.CheckNo      = CLAS_Security.CleanStringRegex(this.txtCheckNo.Text);
     this.license.DbaFor       = this.rbtnDba.Checked ? "DBA" : "FOR";
     this.license.DriverLic    = "";
     this.license.Fee          = Convert.ToDecimal(CLAS_Security.CleanStringRegex(this.txtLicFee.Text));
     this.errorHandle          = "Check the Insurance Date. Invalid Date mm/dd/yyyy.";
     this.license.InsDate      = (this.txtInsuDate.Text == string.Empty) ? DateTime.MinValue : Convert.ToDateTime(this.txtInsuDate.Text);
     this.license.LegalId      = CLAS_Security.CleanStringRegex(this.txtLegalId.Text);
     this.license.InsAmt       = new decimal(0);
     this.license.LicStat      = (this.lblDyIssueDate.Text == "Pending") ? "PENDING" : "ACTIVE";
     this.license.LiqLic       = CLAS_Security.CleanStringRegex(this.txtLiqLic.Text);
     this.license.LName        = CLAS_Security.CleanStringRegex(this.txtLicName.Text);
     this.license.MAddr        = CLAS_Security.CleanStringRegex(this.txtMailAddress.Text);
     this.license.MCity        = CLAS_Security.CleanStringRegex(this.txtMailCity.Text);
     this.license.MState       = CLAS_Security.CleanStringRegex(this.txtMailSt.Text);
     this.license.MZip         = CLAS_Security.CleanStringRegex(this.txtMailZip.Text);
     this.license.OAddr        = CLAS_Security.CleanStringRegex(this.txtOwAddress.Text);
     this.license.OCity        = CLAS_Security.CleanStringRegex(this.txtOwCity.Text);
     this.license.OName        = CLAS_Security.CleanStringRegex(this.txtOwName.Text);
     this.license.Notes        = CLAS_Security.CleanStringRegex(this.txtNotes.Text);
     this.license.OPhone       = CLAS_Security.CleanStringRegex(this.txtOwPhone.Text);
     this.license.OState       = CLAS_Security.CleanStringRegex(this.txtOwSt.Text);
     this.license.OwMgr        = this.rbtnOwner.Checked ? "OWNER" : "MANAGER";
     this.license.OZip         = CLAS_Security.CleanStringRegex(this.txtOwZip.Text);
     this.errorHandle          = "Check the Paid Date. Invalid Date mm/dd/yyyy.";
     this.license.PaidDate     = Convert.ToDateTime(this.txtDatePaid.Text);
     this.license.PayType      = this.drplstPayType.SelectedValue;
     this.license.SalesTax     = CLAS_Security.CleanStringRegex(this.txtSalesTax.Text);
     this.license.Ssn          = "";
     this.license.StatDate     = DateTime.Now;
     this.license.Vin          = CLAS_Security.CleanStringRegex(this.txtVin.Text);
     this.license.IssueDate    = (this.lblDyIssueDate.Text == "Pending") ? DateTime.MinValue : Convert.ToDateTime(this.lblDyIssueDate.Text);
     this.license.ExpDate      = (this.txtExpDate.Text == "Pending") ? DateTime.MinValue : Convert.ToDateTime(this.txtExpDate.Text);
     this.license.Zoning       = CLAS_Security.CleanStringRegex(this.txtZoning.Text);
     this.license.EmailAddress = CLAS_Security.CleanStringRegex(this.txtEmailAddress.Text);
     this.license.Notes        = this.txtNotes.Text;
     this.errorHandle          = "";
 }
Example #2
0
 private void BindSearch(bool useMailMerge, bool createReport, bool lookInCache)
 {
     try
     {
         License license1 = new License();
         license1.LicNo   = CLAS_Security.CleanStringRegex(this.txtLicNo.Text);
         license1.LicStat = this.statusList.SelectedItem.Text.StartsWith("--Do Not Use") ? "" : this.statusList.SelectedItem.Text;
         license1.PayType = this.paymentList.SelectedItem.Text.StartsWith("--Do Not Use") ? "" : this.paymentList.SelectedItem.Text;
         DateTime time1 = Convert.ToDateTime("1/1/1900");
         DateTime time2 = Convert.ToDateTime("12/12/2060");
         license1.AName      = CLAS_Security.CleanStringRegex(this.txtAppName.Text);
         license1.OName      = CLAS_Security.CleanStringRegex(this.txtOwName.Text);
         license1.OAddr      = CLAS_Security.CleanStringRegex(this.txtOwAdd.Text);
         license1.IssueDate1 = (this.txtIsuDateOne.Text == string.Empty) ? time1 : Convert.ToDateTime(this.txtIsuDateOne.Text);
         license1.IssueDate2 = (this.txtIsuDateTwo.Text == string.Empty) ? time2 : Convert.ToDateTime(this.txtIsuDateTwo.Text);
         license1.PaidDate1  = (this.txtPaidDateOne.Text == string.Empty) ? time1 : Convert.ToDateTime(this.txtPaidDateOne.Text);
         license1.PaidDate2  = (this.txtPaidDateTwo.Text == string.Empty) ? time2 : Convert.ToDateTime(this.txtPaidDateTwo.Text);
         license1.StDate1    = (this.txtStDateOne.Text == string.Empty) ? time1 : Convert.ToDateTime(this.txtStDateOne.Text);
         license1.StDate2    = (this.txtStDateTwo.Text == string.Empty) ? time2 : Convert.ToDateTime(this.txtStDateTwo.Text);
         license1.ExpDate1   = (this.txtExpDateOne.Text == string.Empty) ? time1 : Convert.ToDateTime(this.txtExpDateOne.Text);
         license1.ExpDate2   = (this.txtExpDateTwo.Text == string.Empty) ? time2 : Convert.ToDateTime(this.txtExpDateTwo.Text);
         license1.LiqLic     = CLAS_Security.CleanStringRegex(this.txtLiqLic.Text);
         license1.Vin        = CLAS_Security.CleanStringRegex(this.txtVin.Text);
         license1.TypeCode   = this.licenseTypeList.SelectedItem.Text.StartsWith("--Do Not Use") ? "" : this.licenseTypeList.SelectedItem.Text.Substring(0, 4);
         license1.CheckNo    = CLAS_Security.CleanStringRegex(this.txtCheckNu.Text);
         license1.LName      = CLAS_Security.CleanStringRegex(this.txtLicName.Text);
         license1.BName      = CLAS_Security.CleanStringRegex(this.txtBusName.Text);
         license1.BAddr      = CLAS_Security.CleanStringRegex(this.txtBusAdd.Text);
         license1.Ssn        = "";
         license1.PayType    = this.paymentList.SelectedItem.Text.StartsWith("--Do Not Use") ? "" : this.paymentList.SelectedItem.Text;
         license1.AcctNo     = CLAS_Security.CleanStringRegex(this.txtAcctNum.Text);
         license1.DriverLic  = "";
         license1.SalesTax   = CLAS_Security.CleanStringRegex(this.txtSalesTax.Text);
         license1.LegalId    = CLAS_Security.CleanStringRegex(this.txtLegalId.Text);
         if (!useMailMerge && !createReport)
         {
             if (lookInCache)
             {
                 this.ds = (DataSet)base.Cache.Get("dsSearch");
             }
             else
             {
                 this.ds = license1.GetSearchResult();
                 base.Cache["dsSearch"] = this.ds;
             }
             DataTable table1 = this.ds.Tables[0];
             DataView  view1  = new DataView(table1);
             if (!lookInCache && (((license1.IssueDate1 != Convert.ToDateTime("1/1/1900")) || (license1.IssueDate2 != Convert.ToDateTime("12/12/2060"))) || ((license1.ExpDate1 != Convert.ToDateTime("1/1/1900")) || (license1.ExpDate2 != Convert.ToDateTime("12/12/2060")))))
             {
                 foreach (DataRow row1 in table1.Rows)
                 {
                     if ((row1[5].ToString() != "ACTIVE") && (row1[5].ToString() != "EXPIRED"))
                     {
                         row1.Delete();
                     }
                 }
                 table1.AcceptChanges();
             }
             view1.Sort = this.sortLable.Text;
             this.DataGrid2.DataSource = view1;
             this.DataGrid2.DataBind();
             this.Label4.Text = "NUMBER OF ROWS: " + table1.Rows.Count;
         }
         else if (useMailMerge && !createReport)
         {
             this.ds = license1.GetMailMerge();
             DataTable table2 = this.ds.Tables[0];
             if (((license1.IssueDate1 != Convert.ToDateTime("1/1/1900")) || (license1.IssueDate2 != Convert.ToDateTime("12/12/2060"))) || ((license1.ExpDate1 != Convert.ToDateTime("1/1/1900")) || (license1.ExpDate2 != Convert.ToDateTime("12/12/2060"))))
             {
                 foreach (DataRow row2 in table2.Rows)
                 {
                     if ((row2[1].ToString() != "ACTIVE") && (row2[1].ToString() != "EXPIRED"))
                     {
                         row2.Delete();
                     }
                 }
                 table2.AcceptChanges();
             }
             if (table2.Rows.Count > 0)
             {
                 int num1 = 0;
                 try
                 {
                     while (num1 < table2.Rows.Count)
                     {
                         string text3;
                         string text4;
                         string text5;
                         string text1 = "";
                         string text2 = "";
                         if (table2.Rows[num1].ItemArray[9].ToString() != "0")
                         {
                             text3 = table2.Rows[num1].ItemArray[9].ToString().Remove(table2.Rows[num1].ItemArray[9].ToString().Length - 2, 2);
                         }
                         else
                         {
                             text3 = "0";
                         }
                         table2.Rows[num1][9]  = text3;
                         table2.Rows[num1][14] = text1;
                         table2.Rows[num1][15] = text2;
                         if (table2.Rows[num1].ItemArray[7] != DBNull.Value)
                         {
                             text4 = Convert.ToDateTime(table2.Rows[num1].ItemArray[7]).ToShortDateString();
                         }
                         else
                         {
                             text4 = "PENDING";
                         }
                         if (table2.Rows[num1].ItemArray[8] != DBNull.Value)
                         {
                             text5 = Convert.ToDateTime(table2.Rows[num1].ItemArray[8]).ToShortDateString();
                         }
                         else
                         {
                             text5 = "PENDING";
                         }
                         string text6 = Convert.ToDateTime(table2.Rows[num1].ItemArray[2]).ToShortDateString();
                         table2.Rows[num1][7] = text4;
                         table2.Rows[num1][8] = text5;
                         table2.Rows[num1][2] = text6;
                         num1++;
                     }
                 }
                 catch (Exception)
                 {
                     this.lblAcctNum.Text = table2.Rows[num1].ItemArray[9].ToString();
                     this.Label11.Text    = "jkjkl";
                 }
             }
             StreamWriter writer1 = new StreamWriter(base.MapPath(@"Reports\MailMerge.txt"));
             int          num2    = table2.Columns.Count;
             for (int num3 = 0; num3 < num2; num3++)
             {
                 writer1.Write("\"" + table2.Columns[num3] + "\"");
                 if (num3 < (num2 - 1))
                 {
                     writer1.Write(",");
                 }
             }
             writer1.Write(writer1.NewLine);
             foreach (DataRow row3 in table2.Rows)
             {
                 for (int num4 = 0; num4 < num2; num4++)
                 {
                     if (!Convert.IsDBNull(row3[num4]))
                     {
                         writer1.Write("\"" + row3[num4].ToString() + "\"");
                     }
                     if (num4 < (num2 - 1))
                     {
                         writer1.Write(",");
                     }
                 }
                 writer1.Write(writer1.NewLine);
             }
             writer1.Close();
         }
         else if (!useMailMerge && createReport)
         {
             this.ds = license1.GetMailMerge();
             DataTable table3 = this.ds.Tables[0];
             if (((license1.IssueDate1 != Convert.ToDateTime("1/1/1900")) || (license1.IssueDate2 != Convert.ToDateTime("12/12/2060"))) || ((license1.ExpDate1 != Convert.ToDateTime("1/1/1900")) || (license1.ExpDate2 != Convert.ToDateTime("12/12/2060"))))
             {
                 foreach (DataRow row4 in table3.Rows)
                 {
                     if ((row4[1].ToString() != "ACTIVE") && (row4[1].ToString() != "EXPIRED"))
                     {
                         row4.Delete();
                     }
                 }
                 table3.AcceptChanges();
             }
             if (table3.Rows.Count > 0)
             {
                 for (int num5 = 0; num5 < table3.Rows.Count; num5++)
                 {
                     string text7 = "";
                     string text8 = "";
                     table3.Rows[num5][14] = text7;
                     table3.Rows[num5][15] = text8;
                     string text9  = Convert.ToDateTime(table3.Rows[num5].ItemArray[7]).ToShortDateString();
                     string text10 = Convert.ToDateTime(table3.Rows[num5].ItemArray[8]).ToShortDateString();
                     string text11 = Convert.ToDateTime(table3.Rows[num5].ItemArray[2]).ToShortDateString();
                     table3.Rows[num5].ItemArray[0x1a].ToString();
                     table3.Rows[num5][7] = text9;
                     table3.Rows[num5][8] = text10;
                     table3.Rows[num5][2] = text11;
                 }
                 if (table3.Rows.Count == 1)
                 {
                     object[] objArray1 = new object[] { "BBBB", "BBBB" };
                     table3.DataSet.Tables[0].Rows.Add(objArray1);
                     string text12 = table3.DataSet.GetXml();
                     string text13 = table3.DataSet.GetXmlSchema();
                     string text15 = text12 + text13;
                     table3.AcceptChanges();
                 }
                 string text14 = base.MapPath(@"Reports\LicenseSearchResultXML.XML");
                 table3.DataSet.WriteXml(text14);
             }
         }
     }
     catch (Exception exception1)
     {
         this.Label4.Text = exception1.ToString();
     }
 }