Ejemplo n.º 1
0
        private void mnuItmRegtoNav_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            ReservationEntry_Service Resv_service = new ReservationEntry_Service();

            Resv_service.Credentials = nc;

            List <ReservationEntry_Filter> filterArray = new List <ReservationEntry_Filter>();

            ReservationEntry_Filter nameFilter1 = new ReservationEntry_Filter();

            nameFilter1.Field    = ReservationEntry_Fields.Source_Type;
            nameFilter1.Criteria = Reservation.SO_sourceType;
            filterArray.Add(nameFilter1);

            ReservationEntry_Filter nameFilter2 = new ReservationEntry_Filter();

            nameFilter2.Field = ReservationEntry_Fields.Source_ID;
            //nameFilter2.Criteria = txtTOScan.Text.Trim();
            nameFilter2.Criteria = SONO.Trim();
            filterArray.Add(nameFilter2);

            ReservationEntry_Filter nameFilter3 = new ReservationEntry_Filter();

            nameFilter3.Field    = ReservationEntry_Fields.Source_Subtype;
            nameFilter3.Criteria = Reservation.SO_sourceSubType;
            filterArray.Add(nameFilter3);

            ReservationEntry.ReservationEntry[] listToNav = Resv_service.ReadMultiple(filterArray.ToArray(), null, 0);

            for (int i = 0; i < ResvLineScanIndex.Count; i++)
            {
                int iVal = Convert.ToInt16(ResvLineScanIndex[i]);

                listToNav[iVal].ScannedSpecified = true;
                listToNav[iVal].Scanned          = true;
            }

            bool bSuccess = false;

            try
            {
                Resv_service.UpdateMultiple(ref listToNav);
                bSuccess = true;
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show("Failed. " + ex.Message);
            }
            if (bSuccess)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show("Successfully registered.");
                //menuItem3_Click(null, null);
                this.Close();
                frmSOscan newScan = new frmSOscan();
                newScan.ShowDialog();
            }
        }
Ejemplo n.º 2
0
        private void menuNewScan_Click(object sender, EventArgs e)
        {
            this.Close();
            frmSOscan frmToShip = new frmSOscan();

            frmToShip.ShowDialog();
        }
Ejemplo n.º 3
0
        private void txtTOScan_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                try
                {
                    Cursor.Current    = Cursors.WaitCursor;
                    txtTOScan.Enabled = false;

                    SalesOrderDP.Sales_Order_DP_Service poCrdSvc = new RGSMobile.SalesOrderDP.Sales_Order_DP_Service();
                    poCrdSvc.Credentials = nc;

                    List <SalesOrderDP.Sales_Order_DP_Filter> filterArray = new List <SalesOrderDP.Sales_Order_DP_Filter>();

                    SalesOrderDP.Sales_Order_DP_Filter nameFilter1 = new SalesOrderDP.Sales_Order_DP_Filter();
                    nameFilter1.Field    = SalesOrderDP.Sales_Order_DP_Fields.Shipping_No;
                    nameFilter1.Criteria = txtTOScan.Text.Trim().ToString();
                    filterArray.Add(nameFilter1);

                    //SalesOrderDP.SalesOrderDP poC = poCrdSvc.Read(txtTOScan.Text.Trim().ToString());

                    SalesOrderDP.Sales_Order_DP[] poCarr = poCrdSvc.ReadMultiple(filterArray.ToArray(), null, 0);

                    if (poCarr.Length < 1)
                    {
                        MessageBox.Show("Shipping No. is not found in SO.");
                        this.Close();
                        frmSOscan newScan = new frmSOscan();
                        newScan.ShowDialog();
                    }

                    SalesOrderDP.Sales_Order_DP poC = poCarr[0];
                    bScanned = true;
                    SONO     = poC.No.ToString();
                    DataTable dt = new DataTable("MyTable");

                    dt.Columns.Add(new DataColumn("ItemNo"));
                    dt.Columns.Add(new DataColumn("Desc"));
                    dt.Columns.Add(new DataColumn("UOM"));
                    dt.Columns.Add(new DataColumn("Quantity"));
                    dt.Columns.Add(new DataColumn("SecUnit"));
                    dt.Columns.Add(new DataColumn("SecQtytoRec"));
                    dt.Columns.Add(new DataColumn("SecQtytoShp"));

                    for (int i = 0; i < poC.SalesLines.Length; i++)
                    {
                        if (poC.SalesLines[i].Type.ToString().ToLower().StartsWith("item"))
                        {
                            object[] array = new object[7];

                            array[0] = poC.SalesLines[i].No;
                            array[1] = poC.SalesLines[i].Description;
                            array[2] = poC.SalesLines[i].Unit_of_Measure_Code;
                            array[3] = poC.SalesLines[i].Quantity.ToString();
                            array[4] = poC.SalesLines[i].Qty_to_Ship.ToString();
                            array[5] = poC.SalesLines[i].Qty_to_Invoice.ToString();
                            array[6] = poC.SalesLines[i].Quantity_Shipped.ToString();

                            dt.Rows.Add(array);
                        }
                    }

                    lblCount.Text = "( " + dt.Rows.Count.ToString() + " )";

                    dgTOLine.DataSource = dt;
                    dgTOLine.BackColor  = Color.SkyBlue;

                    dgTOLine.TableStyles.Clear();
                    dgTOLine.TableStyles.Add(DataGridStyle(dt));

                    Cursor.Current = Cursors.Default;
                    txtTOScan.SelectAll();

                    if (bScanned)
                    {
                        GetTransferRequestLines(poC.No);
                    }
                    txtTOScan.Enabled    = false;
                    tbMain.SelectedIndex = 1;
                    txtTRLines.Focus();
                }
                catch (Exception ex)
                {
                    string s = ex.Message;
                }
            }
        }