Exemplo 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();
            }
        }
Exemplo n.º 2
0
        private void GetTransferRequestLines(string strScanVal) //Get From Reservation Entry Table
        {
            LocationCode = strScanVal;

            DataTable dt = new DataTable("MyTable");

            dt.Columns.Add(new DataColumn("ItemNo"));
            dt.Columns.Add(new DataColumn("Desc"));
            dt.Columns.Add(new DataColumn("Quantity"));
            dt.Columns.Add(new DataColumn("LotNo"));
            dt.Columns.Add(new DataColumn("LocCode"));

            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 = "5741";
            filterArray.Add(nameFilter1);

            ReservationEntry_Filter nameFilter2 = new ReservationEntry_Filter();

            nameFilter2.Field = ReservationEntry_Fields.Source_ID;
            //nameFilter2.Criteria = "1";
            nameFilter2.Criteria = strScanVal;
            filterArray.Add(nameFilter2);

            ReservationEntry_Filter nameFilter3 = new ReservationEntry_Filter();

            nameFilter3.Field    = ReservationEntry_Fields.Source_Subtype;
            nameFilter3.Criteria = "0";
            filterArray.Add(nameFilter3);

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

            ResvList = Resv_service.ReadMultiple(filterArray.ToArray(), null, 0);

            for (int i = 0; i < ResvList.Length; i++)
            {
                if (!ResvList[i].Scanned)
                {
                    object[] array = new object[5];

                    array[0] = ResvList[i].Item_No;
                    array[1] = ResvList[i].Description;
                    array[2] = Math.Abs(ResvList[i].Quantity);
                    array[3] = ResvList[i].Lot_No;
                    array[4] = ResvList[i].Location_Code;

                    dt.Rows.Add(array);
                }
            }
            //Show Request Lines Count to lblReqLineCount
            lblReqLineCount.Text = "( " + dt.Rows.Count.ToString() + " )";

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

            dgTrReqLines.TableStyles.Clear();
            dgTrReqLines.TableStyles.Add(DataGridStyleReqLiness(dt));

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