Exemple #1
0
        private void menuNewScan_Click(object sender, EventArgs e)
        {
            this.Close();
            frmToReceive frmToRcv = new frmToReceive();

            frmToRcv.ShowDialog();
        }
Exemple #2
0
        private void txtTOScan_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                try
                {
                    Cursor.Current    = Cursors.WaitCursor;
                    txtTOScan.Enabled = false;

                    TransferOrder.TransferOrder_Service poCrdSvc = new RGSMobile.TransferOrder.TransferOrder_Service();
                    poCrdSvc.Credentials = nc;
                    TransferOrder.TransferOrder poC = poCrdSvc.Read(txtTOScan.Text.Trim().ToString());

                    if (poC == null)
                    {
                        MessageBox.Show("Cannot Find TO No.");
                        this.Close();
                        frmToReceive newScan = new frmToReceive();
                        newScan.ShowDialog();
                    }
                    bScanned = true;

                    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.TransferLines.Length; i++)
                    {
                        if ((poC.TransferLines[i].Qty_to_Receive <= poC.TransferLines[i].Quantity) && (poC.TransferLines[i].Qty_to_Receive > 0))
                        {
                            object[] array = new object[7];

                            array[0] = poC.TransferLines[i].Item_No;
                            array[1] = poC.TransferLines[i].Description;
                            array[2] = poC.TransferLines[i].Unit_of_Measure_Code;
                            array[3] = Math.Abs(poC.TransferLines[i].Quantity).ToString();
                            array[4] = poC.TransferLines[i].Secondary_Unit_Name;
                            array[5] = poC.TransferLines[i].Secondary_Qty_to_Receive;
                            array[6] = poC.TransferLines[i].Secondary_Qty_to_Ship;

                            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.Transfer_to_Code);
                        GetTransferRequestLines(txtTOScan.Text);
                    }
                    txtTOScan.Enabled    = false;
                    tbMain.SelectedIndex = 1;
                    txtScanNo.Focus();
                }
                catch (Exception ex)
                {
                    string s = ex.Message;
                }
            }
        }
Exemple #3
0
        private void mnuItmRegtoTO_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.ToRecv_sourceType;
            filterArray.Add(nameFilter1);

            ReservationEntry_Filter nameFilter2 = new ReservationEntry_Filter();

            nameFilter2.Field = ReservationEntry_Fields.Source_ID;
            //nameFilter2.Criteria = Reservation.ToRecv_SourceId;
            nameFilter2.Criteria = txtTOScan.Text;
            filterArray.Add(nameFilter2);

            ReservationEntry_Filter nameFilter3 = new ReservationEntry_Filter();

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

            //ReservationEntry_Filter nameFilter4 = new ReservationEntry_Filter();
            //nameFilter4.Field = ReservationEntry_Fields.Location_Code;
            //nameFilter4.Criteria = LocationCode;
            //filterArray.Add(nameFilter4);

            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();
                frmToReceive newScan = new frmToReceive();
                newScan.ShowDialog();
            }
        }