protected void Button1_Click(object sender, EventArgs e) { NewOrder.ServiceReference2.Service1SoapClient s = new NewOrder.ServiceReference2.Service1SoapClient(); string str = null; str = DateTime.Now.ToString("yyyy/MM/dd"); //int i=s.insert_order("PR", TextBox1.Text, str, "", "C", 27); int p = (int)Session["ec1"]; NewOrder.ServiceReference2.Class3[] c1 = s.Getstatus(p); string s1 = c1[0].oxml; //<state_code>NY</state_code> // <zip_code>10001</zip_code> string x = s1; int i = x.IndexOf("<state_code>"); int j = x.IndexOf("</state_code>"); string l = "<state_code>"; int k = j - i - l.Length; string s2 = x.Substring(i + l.Length, k); string y = s1; i = x.IndexOf("<zip_code>"); j = x.IndexOf("</zip_code>"); l = "<zip_code>"; k = j - i - l.Length; string s3 = x.Substring(i + l.Length, k); //string str2 = s.Replace(x, "Inactive"); // Console.WriteLine(str2); changeSession c = new changeSession(); c.id = (int)Session["ec1"]; c.statecode = s2; c.zipcode = s3; Session["change"] = c; Response.Redirect("OrderForm.aspx?v1=1"); }
protected void Button1_Click(object sender, EventArgs e) { NewOrder.ServiceReference2.Service1SoapClient s = new NewOrder.ServiceReference2.Service1SoapClient(); string str = null; str = DateTime.Now.ToString("yyyy/MM/dd"); //int i=s.insert_order("PR", TextBox1.Text, str, "", "C", 27); int p = (int)Session["ec1"]; NewOrder.ServiceReference2.Class3[] c1 = s.Getstatus(p); //if (c1[0].otype == "D" )//|| c1[0].otype == "S") //{ // Label1.Text = "This Service is disconnected."; // GridView1.Visible = false; // Button1.Visible = false; //} //else if (c1[0].otype == "S") //{ // Label1.Text = "This Service is suspended."; // GridView1.Visible = false; // Button1.Visible = false; // string s1 = c1[0].oxml; //<state_code>NY</state_code> // <zip_code>10001</zip_code> string x = s1; int i = x.IndexOf("<state_code>"); int j = x.IndexOf("</state_code>"); string l = "<state_code>"; int k = j - i - l.Length; string s2 = x.Substring(i + l.Length, k); string y = s1; i = y.IndexOf("<zip_code>"); j = y.IndexOf("</zip_code>"); l = "<zip_code>"; k = j - i - l.Length; string s3 = y.Substring(i + l.Length, k); //string str2 = s.Replace(x, "Inactive"); // Console.WriteLine(str2); changeSession c = new changeSession(); c.id = (int)Session["ec1"]; c.statecode = s2; c.zipcode = s3; Session["change"] = c; Response.Redirect("OrderForm.aspx?v1=1"); }
protected void Button1_Click(object sender, EventArgs e) { List <Product> x3 = new List <Product>(); l = (List <NewOrder.ProdCats.ProductClass>)ViewState["ob"]; string s = "wow"; string q = "wow"; string r = "wow"; if (RadioButtonList1.SelectedIndex != -1) { s = RadioButtonList1.SelectedItem.Text.ToString(); } if (RadioButtonList2.SelectedIndex != -1) { q = RadioButtonList2.SelectedItem.Text.ToString(); } if (RadioButtonList3.SelectedIndex != -1) { r = RadioButtonList3.SelectedItem.Text.ToString(); } foreach (NewOrder.ProdCats.ProductClass item in l) { if (item.Product_name == s || item.Product_name == q || item.Product_name == r) { Product P = new Product(); P.P_id = item.Product_ID; P.P_name = item.Product_name; P.P_description = item.Product_desc; P.P_price = item.Rate.ToString(); P.start_date = item.Prod_eff_date.ToString("yyyy/MM/dd"); P.end_date = item.Prod_end_date.ToString("yyyy/MM/dd"); x3.Add(P); } } foreach (var i in x3) { i.due_date = TextBox1.Text; if (i.P_name == s) { i.P_qty = txtQty1.Text; } if (i.P_name == q) { i.P_qty = txtQty2.Text; } if (i.P_name == r) { i.P_qty = txtQty3.Text; } } DataSet Ds = new DataSet(); if (Int32.Parse(Request.QueryString["v1"]) != 1) { Address A = new Address(); A = (Address)Session["BillAdd"]; List <Address> x21 = new List <Address>(); x21.Add(A); Address B = new Address(); B = (Address)Session["ShipAdd"]; List <Address> x22 = new List <Address>(); x22.Add(A); Customer C = new Customer(); C = (Customer)Session["Personal_Details"]; List <Customer> x1 = new List <Customer>(); x1.Add(C); DataTable dt1 = new DataTable(); DataTable dt2 = new DataTable(); dt1.Columns.Add("customer_fname"); dt1.Columns.Add("customer_lname"); dt1.Columns.Add("customer_email_id"); dt1.Columns.Add("customer_mobile_no"); dt1.Columns.Add("customer_status"); dt1.Columns.Add("customer_type"); dt1.Columns.Add("customer_Bill_pay"); dt2.Columns.Add("add_type"); dt2.Columns.Add("add_line1"); dt2.Columns.Add("add_line2"); dt2.Columns.Add("city"); dt2.Columns.Add("state"); dt2.Columns.Add("state_code"); dt2.Columns.Add("zip_code"); foreach (var i in x1) { var Row = dt1.NewRow(); Row["customer_fname"] = i.F_name; Row["customer_lname"] = i.L_name; Row["customer_email_id"] = i.Email_id; Row["customer_mobile_no"] = i.Ph_no; Row["customer_status"] = "Active"; Row["customer_type"] = "New Order"; Row["customer_Bill_pay"] = i.Bill_pay_meth; dt1.Rows.Add(Row); } foreach (var i in x21) { var Row = dt2.NewRow(); Row["add_type"] = "Billing"; Row["add_line1"] = i.line1; Row["add_line2"] = i.line2; Row["city"] = i.city; Row["state"] = i.state; Row["state_code"] = i.statecode; Row["zip_code"] = i.zipcode; dt2.Rows.Add(Row); } foreach (var i in x22) { var Row = dt2.NewRow(); Row["add_type"] = "Shipping"; Row["add_line1"] = i.line1; Row["add_line2"] = i.line2; Row["city"] = i.city; Row["state"] = i.state; Row["state_code"] = i.statecode; Row["zip_code"] = i.zipcode; dt2.Rows.Add(Row); } DataTable dt3 = new DataTable(); dt3.Columns.Add("product_id"); dt3.Columns.Add("product_name"); dt3.Columns.Add("product_qty"); dt3.Columns.Add("product_description"); dt3.Columns.Add("product_start_date"); dt3.Columns.Add("product_end_date"); dt3.Columns.Add("order_negotiation_date"); dt3.Columns.Add("order_due_date"); dt3.Columns.Add("order_status"); dt3.Columns.Add("order_type"); dt3.Columns.Add("service_id"); dt3.Columns.Add("service_name"); dt3.Columns.Add("service_end_date"); foreach (var i in x3) { var Row = dt3.NewRow(); Row["product_id"] = i.P_id; Row["product_name"] = i.P_name; Row["product_qty"] = i.P_qty; Row["product_description"] = i.P_description; Row["product_start_date"] = i.start_date; Row["product_end_date"] = i.end_date; Row["order_negotiation_date"] = DateTime.Now.ToString("yyyy/MM/dd"); Row["order_due_date"] = i.due_date; Row["order_status"] = "PR"; Row["order_type"] = "N"; Row["service_id"] = "6"; Row["service_name"] = "Enterprise"; Row["service_end_date"] = "2999/12/31"; dt3.Rows.Add(Row); } Ds.Tables.Add(dt1); Ds.Tables.Add(dt2); Ds.Tables.Add(dt3); str = Ds.GetXml(); NewOrder.ServiceReference2.Service1SoapClient t = new NewOrder.ServiceReference2.Service1SoapClient(); t.insert_order("PR", TextBox1.Text, DateTime.Now.ToString("yyyy/MM/dd"), str, "N", 0); Response.Redirect("Confirmed.aspx"); } if ((Int32.Parse(Request.QueryString["v1"])) == 1) { c1 = (changeSession)Session["change"]; DataTable dt4 = new DataTable(); dt4.Columns.Add("customer_id"); dt4.Columns.Add("service_id"); dt4.Columns.Add("product_id"); dt4.Columns.Add("product_desc"); dt4.Columns.Add("product_price"); dt4.Columns.Add("product_qty"); dt4.Columns.Add("order_negotiation_date"); dt4.Columns.Add("order_type"); dt4.Columns.Add("order_due_date"); foreach (var i in x3) { var Row = dt4.NewRow(); Row["customer_id"] = c1.id; Row["service_id"] = "6"; Row["product_id"] = i.P_id; Row["product_desc"] = i.P_description; Row["product_qty"] = i.P_qty; Row["order_negotiation_date"] = DateTime.Now.ToString("yyyy/MM/dd"); Row["order_type"] = "C"; Row["order_due_date"] = i.due_date; dt4.Rows.Add(Row); } Ds.Tables.Add(dt4); str = Ds.GetXml(); NewOrder.ServiceReference2.Service1SoapClient t = new NewOrder.ServiceReference2.Service1SoapClient(); t.insert_order("PR", TextBox1.Text, DateTime.Now.ToString("yyyy/MM/dd"), str, "C", c1.id); Response.Redirect("Confirm_Change.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { NewOrder.ProdCats.GetAllProductsSoapClient w = new NewOrder.ProdCats.GetAllProductsSoapClient(); //Whenever a webmethod returns a list of objects we receive an array of objects (here of ProductClass) if (Int32.Parse(Request.QueryString["v1"]) != 1) { Address A = new Address(); A = (Address)Session["BillAdd"]; NewOrder.ProdCats.ProductClass[] p = w.GetEnterpriseProducts(A.statecode, int.Parse(A.zipcode)); for (int i = 0; i < p.Length; i++) { l.Add(p[i]); } ViewState["ob"] = l; } if (Int32.Parse(Request.QueryString["v1"]) == 1) { c1 = (changeSession)Session["change"]; NewOrder.ProdCats.ProductClass[] p = w.GetEnterpriseProducts(c1.statecode, int.Parse(c1.zipcode)); for (int i = 0; i < p.Length; i++) { l.Add(p[i]); } ViewState["ob"] = l; } //ViewState["Tot"] = txtTotal.Text; if (!IsPostBack) { if (txtTotal1.Text == "") { txtTotal1.Text = "0"; } if (txtTotal2.Text == "") { txtTotal2.Text = "0"; } if (txtTotal3.Text == "") { txtTotal3.Text = "0"; } txtTotal.Text = "0"; foreach (var item in l) { if (item.Product_name.Contains("Cloud")) { RadioButtonList1.Items.Add(item.Product_name); } if (item.Product_name.Contains("Security")) { RadioButtonList2.Items.Add(item.Product_name); } if (item.Product_name.Contains("VOIP")) { RadioButtonList3.Items.Add(item.Product_name); } } if (RadioButtonList1.Items.Count == 0) { Label13.Text = "Cloud is not available in the selected region"; txtQty1.ReadOnly = true; } if (RadioButtonList2.Items.Count == 0) { Label14.Text = "Security is not available in the selected region"; txtQty2.ReadOnly = true; } if (RadioButtonList3.Items.Count == 0) { Label15.Text = "VOIP is not available in the selected region"; txtQty3.ReadOnly = true; } } }
protected void Button1_Click(object sender, EventArgs e) { List<Product> x3 = new List<Product>(); l = (List<NewOrder.ProdCats.ProductClass>)ViewState["ob"]; string s = "wow"; string q = "wow"; string r = "wow"; if (RadioButtonList1.SelectedIndex != -1) { s = RadioButtonList1.SelectedItem.Text.ToString(); } if (RadioButtonList2.SelectedIndex != -1) { q = RadioButtonList2.SelectedItem.Text.ToString(); } if (RadioButtonList3.SelectedIndex != -1) { r = RadioButtonList3.SelectedItem.Text.ToString(); } foreach (NewOrder.ProdCats.ProductClass item in l) { if (item.Product_name == s || item.Product_name == q || item.Product_name == r) { Product P = new Product(); P.P_id = item.Product_ID; P.P_name = item.Product_name; P.P_description = item.Product_desc; P.P_price = item.Rate.ToString(); P.start_date = item.Prod_eff_date.ToString("yyyy/MM/dd"); P.end_date = item.Prod_end_date.ToString("yyyy/MM/dd"); x3.Add(P); } } foreach (var i in x3) { i.due_date = TextBox1.Text; if (i.P_name == s) i.P_qty = txtQty1.Text; if (i.P_name == q) i.P_qty = txtQty2.Text; if (i.P_name == r) i.P_qty = txtQty3.Text; } DataSet Ds = new DataSet(); if (Int32.Parse(Request.QueryString["v1"]) != 1) { Address A = new Address(); A = (Address)Session["BillAdd"]; List<Address> x21 = new List<Address>(); x21.Add(A); Address B = new Address(); B = (Address)Session["ShipAdd"]; List<Address> x22 = new List<Address>(); x22.Add(A); Customer C = new Customer(); C = (Customer)Session["Personal_Details"]; List<Customer> x1 = new List<Customer>(); x1.Add(C); DataTable dt1 = new DataTable(); DataTable dt2 = new DataTable(); dt1.Columns.Add("customer_fname"); dt1.Columns.Add("customer_lname"); dt1.Columns.Add("customer_email_id"); dt1.Columns.Add("customer_mobile_no"); dt1.Columns.Add("customer_status"); dt1.Columns.Add("customer_type"); dt1.Columns.Add("customer_Bill_pay"); dt2.Columns.Add("add_type"); dt2.Columns.Add("add_line1"); dt2.Columns.Add("add_line2"); dt2.Columns.Add("city"); dt2.Columns.Add("state"); dt2.Columns.Add("state_code"); dt2.Columns.Add("zip_code"); foreach (var i in x1) { var Row = dt1.NewRow(); Row["customer_fname"] = i.F_name; Row["customer_lname"] = i.L_name; Row["customer_email_id"] = i.Email_id; Row["customer_mobile_no"] = i.Ph_no; Row["customer_status"] = "Active"; Row["customer_type"] = "New Order"; Row["customer_Bill_pay"] = i.Bill_pay_meth; dt1.Rows.Add(Row); } foreach (var i in x21) { var Row = dt2.NewRow(); Row["add_type"] = "Billing"; Row["add_line1"] = i.line1; Row["add_line2"] = i.line2; Row["city"] = i.city; Row["state"] = i.state; Row["state_code"] = i.statecode; Row["zip_code"] = i.zipcode; dt2.Rows.Add(Row); } foreach (var i in x22) { var Row = dt2.NewRow(); Row["add_type"] = "Shipping"; Row["add_line1"] = i.line1; Row["add_line2"] = i.line2; Row["city"] = i.city; Row["state"] = i.state; Row["state_code"] = i.statecode; Row["zip_code"] = i.zipcode; dt2.Rows.Add(Row); } DataTable dt3 = new DataTable(); dt3.Columns.Add("product_id"); dt3.Columns.Add("product_name"); dt3.Columns.Add("product_qty"); dt3.Columns.Add("product_description"); dt3.Columns.Add("product_start_date"); dt3.Columns.Add("product_end_date"); dt3.Columns.Add("order_negotiation_date"); dt3.Columns.Add("order_due_date"); dt3.Columns.Add("order_status"); dt3.Columns.Add("order_type"); dt3.Columns.Add("service_id"); dt3.Columns.Add("service_name"); dt3.Columns.Add("service_end_date"); foreach (var i in x3) { var Row = dt3.NewRow(); Row["product_id"] = i.P_id; Row["product_name"] = i.P_name; Row["product_qty"] = i.P_qty; Row["product_description"] = i.P_description; Row["product_start_date"] = i.start_date; Row["product_end_date"] = i.end_date; Row["order_negotiation_date"] = DateTime.Now.ToString("yyyy/MM/dd"); Row["order_due_date"] = i.due_date; Row["order_status"] = "PR"; Row["order_type"] = "N"; Row["service_id"] = "6"; Row["service_name"] = "Enterprise"; Row["service_end_date"] = "2999/12/31"; dt3.Rows.Add(Row); } Ds.Tables.Add(dt1); Ds.Tables.Add(dt2); Ds.Tables.Add(dt3); str = Ds.GetXml(); NewOrder.ServiceReference2.Service1SoapClient t = new NewOrder.ServiceReference2.Service1SoapClient(); t.insert_order("PR", TextBox1.Text, DateTime.Now.ToString("yyyy/MM/dd"), str, "N", 0); Response.Redirect("Confirmed.aspx"); } if ((Int32.Parse(Request.QueryString["v1"])) == 1) { c1 = (changeSession)Session["change"]; DataTable dt4 = new DataTable(); dt4.Columns.Add("customer_id"); dt4.Columns.Add("service_id"); dt4.Columns.Add("product_id"); dt4.Columns.Add("product_desc"); dt4.Columns.Add("product_price"); dt4.Columns.Add("product_qty"); dt4.Columns.Add("order_negotiation_date"); dt4.Columns.Add("order_type"); dt4.Columns.Add("order_due_date"); foreach (var i in x3) { var Row = dt4.NewRow(); Row["customer_id"] = c1.id; Row["service_id"] = "6"; Row["product_id"] = i.P_id; Row["product_desc"] = i.P_description; Row["product_qty"] = i.P_qty; Row["order_negotiation_date"] = DateTime.Now.ToString("yyyy/MM/dd"); Row["order_type"] = "C"; Row["order_due_date"] = i.due_date; dt4.Rows.Add(Row); } Ds.Tables.Add(dt4); str = Ds.GetXml(); NewOrder.ServiceReference2.Service1SoapClient t = new NewOrder.ServiceReference2.Service1SoapClient(); t.insert_order("PR", TextBox1.Text, DateTime.Now.ToString("yyyy/MM/dd"), str, "C", c1.id); Response.Redirect("Confirm_Change.aspx"); } }