private void LoadQtyEntry_Completed(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(LoadQtyEntry.Text))
     {
         UserDialogs.Instance.ShowError("Not allow blank quantity!", 3000);
         LoadQtyEntry.Focus();
         return;
     }
 }
        private async void SaveButton_Clicked(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(LoadQtyEntry.Text))
                {
                    //DependencyService.Get<IMessage>().LongAlert("Not allow blank quantity!");
                    UserDialogs.Instance.ShowError("Not allow blank quantity!", 3000);
                    LoadQtyEntry.Focus();
                    return;
                }

                if (decimal.Parse(LoadQtyEntry.Text) == 0)
                {
                    //DependencyService.Get<IMessage>().LongAlert("Not allow 0 quantity!");
                    UserDialogs.Instance.ShowError("Not allow 0 quantity!", 3000);
                    LoadQtyEntry.Focus();
                    return;
                }

                DataManager manager = new DataManager();
                RequestLine line    = new RequestLine()
                {
                    ID            = data.ID,
                    EntryNo       = data.EntryNo,
                    HeaderEntryNo = data.HeaderEntryNo,
                    ItemNo        = data.ItemNo,
                    ItemDesc      = data.ItemDesc,
                    QtyperBag     = data.QtyperBag,
                    NoofBags      = data.NoofBags,
                    Quantity      = data.Quantity,
                    PickQty       = data.PickQty,
                    LoadQty       = decimal.Parse(LoadQtyEntry.Text),
                    SoldQty       = data.SoldQty,
                    UnloadQty     = data.UnloadQty,
                    UomCode       = data.UomCode,
                    VendorNo      = data.VendorNo,
                    RequestNo     = data.RequestNo,
                    UserID        = data.UserID,
                    InHouse       = data.InHouse,
                    IsSync        = data.IsSync,
                    SyncDateTime  = data.SyncDateTime
                };

                string retval = await manager.SaveSQLite_RequestLine(line);

                if (retval == "Success")
                {
                    UserDialogs.Instance.ShowSuccess(retval, 3000);
                    Navigation.PopAsync();
                }
                else
                {
                    //DependencyService.Get<IMessage>().LongAlert(retval);
                    UserDialogs.Instance.ShowError(retval, 3000);
                }
            }
            catch (Exception ex)
            {
                UserDialogs.Instance.ShowError(ex.Message.ToString(), 3000);
            }
        }
示例#3
0
        private async void SaveButton_Clicked(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(LoadQtyEntry.Text))
                {
                    //DependencyService.Get<IMessage>().LongAlert("Not allow blank quantity!");
                    UserDialogs.Instance.ShowError("Not allow blank quantity!", 3000);
                    LoadQtyEntry.Focus();
                    return;
                }

                if (decimal.Parse(LoadQtyEntry.Text) == 0)
                {
                    //DependencyService.Get<IMessage>().LongAlert("Not allow 0 quantity!");
                    UserDialogs.Instance.ShowError("Not allow 0 quantity!", 3000);
                    LoadQtyEntry.Focus();
                    return;
                }

                DataManager manager = new DataManager();
                RequestLine line    = new RequestLine()
                {
                    ID            = ItemId,
                    EntryNo       = EntryNo,
                    HeaderEntryNo = HeaderNo,
                    ItemNo        = ItemNoLabel.Text,
                    ItemDesc      = DescLabel.Text,
                    QtyperBag     = decimal.Parse(QtyperBagLabel.Text),
                    NoofBags      = decimal.Parse(NoofBagsLabel.Text),
                    Quantity      = decimal.Parse(ReqQtyLabel.Text),
                    PickQty       = decimal.Parse(PickQtyLabel.Text),
                    LoadQty       = decimal.Parse(LoadQtyEntry.Text),
                    SoldQty       = 0,
                    UnloadQty     = 0,
                    UomCode       = UomCode,
                    VendorNo      = VendorNo,
                    RequestNo     = _RequestNo,
                    UserID        = App.gSalesPersonCode,
                    InHouse       = InHouse,
                    IsSync        = "false",
                    SyncDateTime  = string.Empty
                };

                string retval = await manager.SaveSQLite_RequestLine(line);

                if (retval == "Success")
                {
                    UserDialogs.Instance.ShowSuccess(retval, 3000);
                    Navigation.PopAsync();
                }
                else
                {
                    //DependencyService.Get<IMessage>().LongAlert(retval);
                    UserDialogs.Instance.ShowError(retval, 3000);
                }
            }
            catch (Exception ex)
            {
                UserDialogs.Instance.ShowError(ex.Message.ToString(), 3000);
            }
        }