Beispiel #1
0
        private void ScanUPC()
        {
            tblBoxDetail boxdetails = new tblBoxDetail();
            string       oqty, rqty;

            if (Convert.ToInt32(txtScanUPC.Text.Length) > 1)
            {
                if (txtScanUPC.Text.Substring(Convert.ToInt32(txtScanUPC.Text.Length) - 1, 1) == "\n")
                {
                    var scanItem = ItemRepository.GetPTLUPC(Intent.GetStringExtra("move_doc"), txtScanUPC.Text);
                    if (scanItem != null)
                    {
                        oqty = scanItem.oqty;
                        rqty = scanItem.rqty;

                        string stat = "0";
                        if (Convert.ToInt32(rqty) + 1 == Convert.ToInt32(oqty))
                        {
                            stat = "1";
                        }
                        PTLDetails.id       = scanItem.id;
                        PTLDetails.move_doc = scanItem.move_doc;
                        PTLDetails.upc      = scanItem.upc;
                        PTLDetails.sku      = scanItem.sku;
                        PTLDetails.dept     = scanItem.dept;
                        PTLDetails.style    = scanItem.style;
                        PTLDetails.descr    = scanItem.descr;
                        PTLDetails.oqty     = oqty;
                        PTLDetails.rqty     = Convert.ToString(Convert.ToInt32(rqty) + 1);
                        PTLDetails.status   = stat;
                        ItemRepository.UpdatePTLListDetail(PTLDetails);

                        var boxdetail = ItemRepository.ChkBoxDetailUPC(txtBoxCode.Text, txtTlno.Text, scanItem.upc);
                        if (boxdetail != null)
                        {
                            boxdetails.id       = boxdetail.id;
                            boxdetails.box_code = txtBoxCode.Text;
                            boxdetails.move_doc = txtTlno.Text;
                            boxdetails.upc      = scanItem.upc;
                            boxdetails.rqty     = Convert.ToString(Convert.ToInt32(boxdetail.rqty) + 1);
                            ItemRepository.UpdateBoxDetail(boxdetails);
                        }
                        else
                        {
                            ItemRepository.AddBoxDetail(txtBoxCode.Text, txtTlno.Text, scanItem.upc, "1");
                        }

                        refreshItems();
                    }
                    else
                    {
                        var builder = new AlertDialog.Builder(this);
                        builder.SetTitle("Debenhams");
                        builder.SetMessage("You've scan UPC not in Picking List.");
                        builder.SetPositiveButton("OK", delegate { builder.Dispose(); });
                        builder.Show();
                    }
                }
            }
        }
Beispiel #2
0
 public static long UpdateBoxDetail(tblBoxDetail item)
 {
     using (var database = WMSDatabase.NewConnection())
     {
         database.Update(item);
         return(item.id);
     }
 }
Beispiel #3
0
        private void btnqty_Clicked(object sender, EventArgs e)
        {
            tblBoxDetail boxdetails = new tblBoxDetail();

            if (Convert.ToInt32(txtRqty.Text) >= 1)
            {
                var boxdetail = ItemRepository.ChkBoxDetailUPC(txtBoxNo.Text, Intent.GetStringExtra("move_doc"), txtUPC.Text);
                int upccount  = 0;
                if (boxdetail != null)
                {
                    upccount = Convert.ToInt32(boxdetail.rqty);
                }
                if (upccount > 0)
                {
                    txtRqty.Text = Convert.ToString(Convert.ToInt32(txtRqty.Text) - 1);
                    string stat = "0";
                    if (Convert.ToInt32(txtRqty.Text) == Convert.ToInt32(Intent.GetStringExtra("oqty")))
                    {
                        stat = "1";
                    }

                    PTLDetails.id       = Convert.ToInt32(Intent.GetStringExtra("id"));
                    PTLDetails.move_doc = Intent.GetStringExtra("move_doc").ToString();
                    PTLDetails.upc      = Intent.GetStringExtra("upc").ToString();
                    PTLDetails.sku      = Intent.GetStringExtra("sku").ToString();
                    PTLDetails.dept     = Intent.GetStringExtra("dept").ToString();
                    PTLDetails.style    = Intent.GetStringExtra("style").ToString();
                    PTLDetails.descr    = Intent.GetStringExtra("descr").ToString();
                    PTLDetails.oqty     = Intent.GetStringExtra("oqty").ToString();
                    PTLDetails.rqty     = txtRqty.Text;
                    PTLDetails.status   = stat;
                    ItemRepository.UpdatePTLListDetail(PTLDetails);

                    boxdetails.id       = boxdetail.id;
                    boxdetails.box_code = boxdetail.box_code;
                    boxdetails.move_doc = boxdetail.move_doc;
                    boxdetails.upc      = boxdetail.upc;
                    boxdetails.rqty     = Convert.ToString(Convert.ToInt32(boxdetail.rqty) - 1);
                    ItemRepository.UpdateBoxDetail(boxdetails);
                }
                else
                {
                    var builder = new AlertDialog.Builder(this);
                    builder.SetTitle("Debenhams");
                    builder.SetMessage("Unable to continue..\nThere are no UPC (" + txtUPC.Text + ")\nIn the selected Box (" + txtBoxNo.Text + ")..");
                    builder.SetPositiveButton("OK", delegate { builder.Dispose(); });
                    builder.Show();
                }
            }
        }