Exemplo n.º 1
0
        private async void updateInfo(string Name)
        {
            IFirebaseConfig config1 = new FirebaseConfig
            {
                AuthSecret = "Fld3TLREfZ47bmggol008nKkHzDAMphTdhlqi09d",
                BasePath   = "https://weldonetechnocrats.firebaseio.com/"
            };
            var client1 = new FireSharp.FirebaseClient(config1);

            Name = wOrderID.Text;

            FirebaseResponse response1 = await client1.GetAsync("Manufacturing/RouteCard/" + Name + "/");

            routeCard var = response1.ResultAs <routeCard>();

            updateMaster(Name);

            try
            {
                FirebaseResponse response = await client1.GetAsync("Manufacturing/RouteCard/" + Name + "/processLayout/1/Name/");

                string a = response.ResultAs <string>();
                fProduct.Text = a;
                fBatch.Text   = var.batchNo;
                updateProcess(a);
            }
            catch (Exception)
            {
                updateInfo(Name);
            }
        }
Exemplo n.º 2
0
        private async void submit(object sender, RoutedEventArgs e)
        {
            if (fOrderNo.Text.Length > 0 && fSalesNo.Text.Length > 0 && fQuantityStrip.Text.Length > 0 && fStripSize.Text.Length > 0 && fCoilNo.Text.Length > 0 && fBatchNo.Text.Length > 0 && fDate.Text.Length > 0 && fTime.Text.Length > 0)
            {
                try
                {
                    routeCard card = new routeCard();
                    card.workid    = fOrderNo.Text;
                    card.salesid   = fSalesNo.Text;
                    card.quantityS = Int32.Parse(fQuantityStrip.Text);
                    card.stripsize = fStripSize.Text;
                    card.coilno    = fCoilNo.Text;
                    card.batchNo   = fBatchNo.Text;
                    card.date      = fDate.Text;
                    card.time      = fTime.Text;

                    FirebaseResponse response = await client.SetAsync("Manufacturing/RouteCard/" + card.workid + "/", card);

                    foreach (employeeList1 tempP in endList1.Items)
                    {
                        client = new FireSharp.FirebaseClient(config);
                        FirebaseResponse response12 = await client.SetAsync("Manufacturing/RouteCard/" + card.workid + "/employeeLayout/" + tempP.SNo + "/", tempP);

                        FirebaseResponse response13 = await client.SetAsync("Manufacturing/RouteCard/" + card.workid + "/employeeLayout/count/", tempP.SNo);
                    }

                    foreach (employeeList1 tempP in endList2.Items)
                    {
                        client = new FireSharp.FirebaseClient(config);
                        FirebaseResponse response12 = await client.SetAsync("Manufacturing/RouteCard/" + card.workid + "/machineLayout/" + tempP.SNo + "/", tempP);

                        FirebaseResponse response13 = await client.SetAsync("Manufacturing/RouteCard/" + card.workid + "/machineLayout/count/", tempP.SNo);
                    }

                    foreach (employeeList1 tempP in endList3.Items)
                    {
                        client = new FireSharp.FirebaseClient(config);
                        FirebaseResponse response12 = await client.SetAsync("Manufacturing/RouteCard/" + card.workid + "/toolLayout/" + tempP.SNo + "/", tempP);

                        FirebaseResponse response13 = await client.SetAsync("Manufacturing/RouteCard/" + card.workid + "/toolLayout/count/", tempP.SNo);
                    }

                    foreach (employeeList1 tempP in endList4.Items)
                    {
                        client = new FireSharp.FirebaseClient(config);
                        FirebaseResponse response12 = await client.SetAsync("Manufacturing/RouteCard/" + card.workid + "/processLayout/" + tempP.SNo + "/", tempP);

                        FirebaseResponse response13 = await client.SetAsync("Manufacturing/RouteCard/" + card.workid + "/processLayout/count/", tempP.SNo);
                    }

                    FirebaseResponse firebase = await client.SetAsync("Manufacturing/" + card.workid + "/StripsCount/", Int32.Parse(fQuantityStrip.Text));
                }
                catch (Exception)
                {
                    MessageDialog error = new MessageDialog("Failed to connect to database!");
                    this.Frame.Navigate(typeof(BlankPage6));
                }
            }
            else
            {
                MessageDialog md = new MessageDialog("Check the inputs!");
                await md.ShowAsync();
            }
        }
Exemplo n.º 3
0
        private async void orderQuery(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            rc.Visibility        = Visibility.Collapsed;
            progress1.Visibility = Visibility.Visible;
            sender.Text          = args.QueryText;
            string cName = fOrderNo.Text;

            client = new FireSharp.FirebaseClient(config);
            FirebaseResponse response = await client.GetAsync("Manufacturing/RouteCard/" + cName + "/");

            routeCard ab = new routeCard();

            ab                  = response.ResultAs <routeCard>();
            fSalesNo.Text       = ab.salesid;
            fStripSize.Text     = ab.stripsize;
            fDate.Text          = ab.date;
            fTime.Text          = ab.time;
            fQuantityStrip.Text = ab.quantityS.ToString();
            fCoilNo.Text        = ab.coilno;
            fBatchNo.Text       = ab.batchNo;

            FirebaseResponse response5 = await client.GetAsync("Manufacturing/RouteCard/" + cName + "/employeeLayout/count/");

            int count5;

            try
            {
                count5 = response5.ResultAs <int>();
            }
            catch
            {
                count5 = 0;
            }
            for (int i = 1; i <= count5; i++)
            {
                FirebaseResponse response1 = await client.GetAsync("Manufacturing/RouteCard/" + cName + "/employeeLayout/" + i);

                employeeList1 list1 = new employeeList1();
                list1 = response1.ResultAs <employeeList1>();
                endList1.Items.Add(list1);
                lEmployee.Items.Add(list1);
            }

            FirebaseResponse response6 = await client.GetAsync("Manufacturing/RouteCard/" + cName + "/machineLayout/count/");

            int count6;

            try
            {
                count6 = response6.ResultAs <int>();
            }
            catch (Exception)
            {
                count6 = 0;
            }
            for (int i = 1; i <= count6; i++)
            {
                FirebaseResponse response1 = await client.GetAsync("Manufacturing/RouteCard/" + cName + "/machineLayout/" + i);

                employeeList1 list1 = new employeeList1();
                list1 = response1.ResultAs <employeeList1>();
                endList2.Items.Add(list1);
                lMachine.Items.Add(list1);
            }

            FirebaseResponse response7 = await client.GetAsync("Manufacturing/RouteCard/" + cName + "/toolLayout/count/");

            int count7;

            try
            {
                count7 = response7.ResultAs <int>();
            }
            catch (Exception)
            {
                count7 = 0;
            }
            for (int i = 1; i <= count7; i++)
            {
                FirebaseResponse response1 = await client.GetAsync("Manufacturing/RouteCard/" + cName + "/toolLayout/" + i);

                employeeList1 list1 = new employeeList1();
                list1 = response1.ResultAs <employeeList1>();
                endList3.Items.Add(list1);
                lTool.Items.Add(list1);
            }

            FirebaseResponse response8 = await client.GetAsync("Manufacturing/RouteCard/" + cName + "/processLayout/count/");

            int count8;

            try
            {
                count8 = response8.ResultAs <int>();
            }
            catch (Exception)
            {
                count8 = 0;
            }
            for (int i = 1; i <= count8; i++)
            {
                FirebaseResponse response1 = await client.GetAsync("Manufacturing/RouteCard/" + cName + "/processLayout/" + i);

                employeeList1 list1 = new employeeList1();
                list1 = response1.ResultAs <employeeList1>();
                endList4.Items.Add(list1);
            }
            rc.Visibility        = Visibility.Visible;
            progress1.Visibility = Visibility.Collapsed;
        }