Exemplo n.º 1
0
        async void buttonClicked(object sender, EventArgs e)
        {
            var bc  = (plu)BindingContext;
            var bc1 = new updatedPlu();

            bc1.PLU            = bc.PLU;
            bc1.PLU_BARCODE    = bc.PLU_BARCODE;
            bc1.PLU_CONTAINER  = bc.PLU_CONTAINER;
            bc1.PLU_DESCRIPTOR = bc.PLU_DESCRIPTOR;
            bc1.PLU_DPT        = bc.PLU_DPT;
            bc1.PLU_LINK       = bc.PLU_LINK;
            bc1.PLU_NAME       = bc.PLU_NAME;
            bc1.PLU_OTHERPRICE = bc.PLU_OTHERPRICE;
            bc1.PLU_PRICE      = bc.PLU_PRICE;
            bc1.PLU_SPEC_REG   = bc.PLU_SPEC_REG;
            bc1.PLU_TAXRATE    = bc.PLU_TAXRATE;
            bc1.PLU_UNIT       = bc.PLU_UNIT;
            bc1.KASA           = bc.KASA;
            bc1.selected       = false;

            if (bc.PLU_NAME.Equals("NaN"))
            {
                await DisplayAlert("Warning", "Musíte zadať meno", "OK");
            }
            else
            {
                if (bc.PLU_PRICE.Equals("NaN"))
                {
                    bc.PLU_PRICE = "0.00";
                }
                else if (bc.PLU_PRICE.Contains(','))
                {
                    bc.PLU_PRICE.Replace(',', '.');
                }
                else if (!bc.PLU_PRICE.Contains('.'))
                {
                    bc.PLU_PRICE += ".00";
                }
                await App.Database.updatePLU(bc);

                await App.Database.saveUpdatedPLU(bc1);

                await Navigation.PopAsync();
            }
        }
Exemplo n.º 2
0
 public Task <int> updateUpdatedPLU(updatedPlu updatedPlu)
 {
     return(connection.UpdateAsync(updatedPlu));
 }
Exemplo n.º 3
0
 public Task <int> deleteUpdatedDPT(updatedPlu updatedPlu)
 {
     return(connection.DeleteAsync(updatedPlu));
 }
Exemplo n.º 4
0
 public Task <int> saveUpdatedPLU(updatedPlu updatedPlu)
 {
     return(connection.InsertAsync(updatedPlu));
 }