Exemplo n.º 1
0
 private void ItemNoEntry_Unfocused(object sender, FocusEventArgs e)
 {
     if (!string.IsNullOrEmpty(BarCodeEntry.Text))
     {
         DataManager manager = new DataManager();
         Item        item    = new Item();
         item = manager.GetSQLite_ItembyItemNo(BarCodeEntry.Text);
         if (item != null)
         {
             ItemNoLabel.Text = item.ItemNo;
             _ItemNo          = item.ItemNo;
             DescEntry.Text   = item.Description;
             UomEntry.Text    = item.BaseUOM;
             isItemExisted    = true;
             QtyEntry.Focus();
         }
         else
         {
             ItemNoLabel.Text = "Scan or select Item";
             _ItemNo          = string.Empty;
             DescEntry.Text   = string.Empty;
             isItemExisted    = false;
             UserDialogs.Instance.ShowError("Wrong Item No or Item does not existed!", 3000);
         }
     }
 }
Exemplo n.º 2
0
        private void QtyperBagEntry_Completed(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(QtyEntry.Text))
            {
                UserDialogs.Instance.ShowError("Not allow blank quantity!", 3000);
                QtyEntry.Focus();
                return;
            }

            //if (!string.IsNullOrEmpty(NoofBagsEntry.Text))
            //{
            //    QuantityLabel.Text = (decimal.Parse(QtyperBagEntry.Text) * decimal.Parse(NoofBagsEntry.Text)).ToString();
            //    NoofBagsEntry.Focus();
            //}
            //else
            //{
            //    UserDialogs.Instance.ShowError("Empty No of Bags!", 3000);
            //    NoofBagsEntry.Focus();
            //}
        }
Exemplo n.º 3
0
        private async void SaveButton_Clicked(object sender, EventArgs e)
        {
            if (_isEnableSaveBtn)
            {
                _isEnableSaveBtn = false;
                try
                {
                    if (string.IsNullOrEmpty(_ItemNo))
                    {
                        //DependencyService.Get<IMessage>().LongAlert("Not allow blank Item!");
                        UserDialogs.Instance.ShowError("Not allow blank Item!", 3000);
                        BarCodeEntry.Focus();
                        return;
                    }

                    if (!isItemExisted)
                    {
                        UserDialogs.Instance.ShowError("Wrong Item No or Item does not existed!", 3000);
                        BarCodeEntry.Focus();
                        return;
                    }

                    if (string.IsNullOrEmpty(QtyEntry.Text))
                    {
                        //DependencyService.Get<IMessage>().LongAlert("Not allow blank quantity!");
                        UserDialogs.Instance.ShowError("Not allow blank quantity!", 3000);
                        QtyEntry.Focus();
                        return;
                    }

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

                    //if (string.IsNullOrEmpty(NoofBagsEntry.Text))
                    //{
                    //    //DependencyService.Get<IMessage>().LongAlert("Not allow blank quantity!");
                    //    UserDialogs.Instance.ShowError("Not allow blank unit price!", 3000);
                    //    NoofBagsEntry.Focus();
                    //    return;
                    //}

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

                    // if (!string.IsNullOrEmpty(VendorEntry.Text)) InHouse = false;
                    DataManager manager = new DataManager();
                    RequestLine line    = new RequestLine()
                    {
                        ID            = LineID,
                        EntryNo       = EntryNo,
                        HeaderEntryNo = HeaderNo,
                        ItemNo        = _ItemNo,
                        ItemDesc      = DescEntry.Text,
                        QtyperBag     = 0,
                        // NoofBags= decimal.Parse(NoofBagsEntry.Text),
                        Quantity     = decimal.Parse(QtyEntry.Text),
                        PickQty      = decimal.Parse(QtyEntry.Text),
                        LoadQty      = 0,
                        UomCode      = UomEntry.Text,
                        VendorNo     = string.Empty,//VendorEntry.Text,
                        RequestNo    = _RequestNo,
                        UserID       = App.gSalesPersonCode,
                        InHouse      = InHouse,
                        IsSync       = "request",
                        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);
                        _isEnableSaveBtn = true;
                    }
                }
                catch (Exception ex)
                {
                    UserDialogs.Instance.ShowError(ex.Message.ToString(), 3000);
                    _isEnableSaveBtn = true;
                }
            }
        }