private async void updateInfo(string cName) { client = new FireSharp.FirebaseClient(config); FirebaseResponse response1 = await client.GetAsync("Purchase/PurchaseOrder/" + cName + "/supplierName/"); pSupplier.Text = response1.ResultAs <string>(); FirebaseResponse response4 = await client.GetAsync("Purchase/PurchaseOrder/" + cName + "/itemLayout/count/"); int c2; try { c2 = response4.ResultAs <int>(); } catch (Exception) { c2 = 0; } for (int i = 1; i <= c2; i++) { FirebaseResponse response3 = await client.GetAsync("Purchase/PurchaseOrder/" + cName + "/itemLayout/" + i + "/"); Product1 sales2 = new Product1(); sales2 = response3.ResultAs <Product1>(); endList.Items.Add(sales2); MyList2.Items.Add(sales2); } }
private void Popup_Submit(object sender, RoutedEventArgs e) { Product1 c1 = new Product1(); c1.pName = pNameT.Text; c1.pQuantity = Int32.Parse(pQuantityT.Text); if (MyList2.Items.Count > 0) { c1.SNo = MyList2.Items.Count + 1; } else { c1.SNo = 1; } itemList.Add(c1); MyList2.Items.Add(c1); }
private async void selc(object sender, SelectionChangedEventArgs e) { ComboBox temp = (ComboBox)sender; pOrderID.Text = temp.SelectedItem.ToString(); string order = (string)temp.SelectedItem; FirebaseResponse response = await client.GetAsync("Purchase/PurchaseOrder/" + order + "/supplierName/"); string sname = response.ResultAs <string>(); pSupplier.Text = sname; FirebaseResponse response1 = await client.GetAsync("Purchase/PurchaseOrder/" + order + "/salesLayout/count/"); int c = response1.ResultAs <int>(); for (int i = 1; i <= c; i++) { FirebaseResponse response2 = await client.GetAsync("Purchase/PurchaseOrder/" + order + "/salesLayout/" + i + "/"); Sales1 sales1 = new Sales1(); sales1 = response2.ResultAs <Sales1>(); endList2.Items.Add(sales1); MyList.Items.Add(sales1); } FirebaseResponse response4 = await client.GetAsync("Purchase/PurchaseOrder/" + order + "/itemLayout/count/"); int c2 = response4.ResultAs <int>(); for (int i = 1; i <= c2; i++) { FirebaseResponse response3 = await client.GetAsync("Purchase/PurchaseOrder/" + order + "/itemLayout/" + i + "/"); Product1 sales2 = new Product1(); sales2 = response3.ResultAs <Product1>(); endList.Items.Add(sales2); MyList2.Items.Add(sales2); } }
private async void Page_Loader(object sender, RoutedEventArgs e) { try { client = new FireSharp.FirebaseClient(config); FirebaseResponse response = await client.GetAsync("Purchase/PurchaseRegister/Spinner/finished/count"); int c; try { c = response.ResultAs <int>(); } catch { c = 0; } productIn result = new productIn(); List <string> numberList = new List <string>(); for (int i = 1; i <= c; i++) { FirebaseResponse response1 = await client.GetAsync("Purchase/PurchaseRegister/Spinner/finished/" + i + "/"); string ab = response1.ResultAs <string>(); pOrderFinal abc = new pOrderFinal(); FirebaseResponse response15 = await client.GetAsync("Purchase/PurchaseRegister/" + ab + "/"); abc = response15.ResultAs <pOrderFinal>(); result.sno = MyList.Items.Count + 1; result.purchaseid = ab; result.supplier = abc.supplierName; result.date = abc.date; result.time = abc.time; result.coilno = abc.coilNo; FirebaseResponse response2 = await client.GetAsync("Purchase/PurchaseRegister/" + ab + "/itemLayout/count/"); int count; try { count = response2.ResultAs <int>(); } catch { count = 0; } for (int i1 = 1; i1 <= count; i1++) { FirebaseResponse response3 = await client.GetAsync("Purchase/PurchaseRegister/" + ab + "/itemLayout/" + i1 + "/"); Product1 product1 = new Product1(); product1 = response3.ResultAs <Product1>(); productIn productIn = new productIn(); productIn.sno = result.sno; productIn.purchaseid = result.purchaseid; productIn.supplier = result.supplier; productIn.date = result.date; productIn.time = result.time; productIn.coilno = result.coilno; productIn.stripsize = product1.pName; productIn.quantity = product1.pQuantity; MyList.Items.Add(productIn); } if (MyList.Items.Count > 0) { progress1.Visibility = Visibility.Collapsed; pin.Visibility = Visibility.Visible; } } } catch (Exception) { MessageDialog error = new MessageDialog("Failed to connect to database!"); this.Frame.Navigate(typeof(BlankPage6)); } }