Esempio n. 1
0
        private void pictureBoxTR_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            TransferOrder toledger = new TransferOrder(usng, staffdimg, uslvelg);

            toledger.Show();
            Cursor.Current = Cursors.Default;
        }
Esempio n. 2
0
        private void menuItem1_Click(object sender, EventArgs e)
        {
            TransferOrder tof = new TransferOrder(staffname, staffdimension, stafflevel);

            tof.Show();
        }
Esempio n. 3
0
        private void menuItem2_Click(object sender, EventArgs e)
        {
            if (GrdTO == null)
            {
                MessageBox.Show("There is no record to register!");
            }
            else
            {
                Cursor.Current = Cursors.WaitCursor;

                try
                {
                    ItemJournalQH.ItemJournalQH_Service journalService = new QHMobile.ItemJournalQH.ItemJournalQH_Service();
                    journalService.Url         = WebServiceInstants.GetURL(ServiceType.ItemJournalQH);
                    journalService.Credentials = nc;

                    for (int i = 0; i < journalarray.Count; i++)
                    {
                        ItemJournalQH.ItemJournalQH journal = new QHMobile.ItemJournalQH.ItemJournalQH();
                        journalService.Create("DEFAULT", ref journal);
                        journal.Document_Date          = journalarray[i].postingDate;
                        journal.Document_DateSpecified = true;
                        journal.Posting_Date           = journalarray[i].postingDate;


                        journalService.Update("DEFAULT", ref journal);

                        journal.Item_No              = journalarray[i].ItemNo;
                        journal.Location_Code        = journalarray[i].location;
                        journal.Bin_Code             = journalarray[i].frombin;
                        journal.New_Location_Code    = journalarray[i].location;
                        journal.New_Bin_Code         = journalarray[i].tobin;
                        journal.Quantity             = journalarray[i].quantity;
                        journal.Staff_Dimension_Code = journalarray[i].staffdimension;



                        journalService.Update("DEFAULT", ref journal);
                    }


                    ArrayList tnk = new ArrayList();
                    for (int i = 0; i < journalarray.Count; i++)
                    {
                        if (i == 0)
                        {
                            tnk.Add(journalarray[i].frombin);
                        }
                        else
                        {
                            if (!tnk.Contains(journalarray[i].frombin))
                            {
                                tnk.Add(journalarray[i].frombin);
                            }
                        }
                    }

                    decimal countotal = 0;
                    bool    flagtemp  = false;
                    string  itemtemp;
                    string  locationtemp;
                    string  bincodetemp;

                    for (int j = 0; j < tnk.Count; j++)
                    {
                        countotal    = 0;
                        flagtemp     = false;
                        itemtemp     = "";
                        locationtemp = "";
                        bincodetemp  = "";

                        for (int k = 0; k < journalarray.Count; k++)
                        {
                            if (tnk[j].ToString().Equals(journalarray[k].frombin))
                            {
                                itemtemp     = journalarray[k].ItemNo;
                                countotal    = countotal + Convert.ToDecimal(journalarray[k].quantity);
                                locationtemp = journalarray[k].location;
                                bincodetemp  = journalarray[k].frombin;

                                if (journalarray[k].emptyBin == true)
                                {
                                    flagtemp = true;
                                }
                            }
                        }

                        if (flagtemp == true) //qhbincon[0].Quantity_Base < countotal ||
                        {
                            QHEmptyTank.QHEmptyTank_Service qhempty = new QHMobile.QHEmptyTank.QHEmptyTank_Service();
                            qhempty.Url         = WebServiceInstants.GetURL(ServiceType.QHEmptyTank);
                            qhempty.Credentials = nc;

                            QHEmptyTank.QHEmptyTank qhcheck = qhempty.Read(bincodetemp);
                            if (qhcheck == null)
                            {
                                QHEmptyTank.QHEmptyTank qhtnk = new QHMobile.QHEmptyTank.QHEmptyTank();
                                qhtnk.Bin_Code = bincodetemp;

                                qhempty.Create(ref qhtnk);


                                qhtnk.Batch_Name    = "IReclass";
                                qhtnk.Item_No       = itemtemp;
                                qhtnk.Location_Code = locationtemp;
                                qhempty.Update(ref qhtnk);
                            }
                        }
                    }

                    CompactSQL comsql = new CompactSQL();
                    comsql.deleteRecord("ItemReclass");

                    MessageBox.Show("Submitted to Journal.");

                    TransferOrder tro = new TransferOrder(staffname, staffdimension, stafflevel);
                    tro.Show();
                    GrdTO.DataSource = null;

                    Cursor.Current = Cursors.Default;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Eorror:" + ex);
                }
                Cursor.Current = Cursors.Default;
            }
        }