Example #1
0
        private void BindPostLines()
        {
            ItemJournalQH.ItemJournalQH_Service sev = new QHMobile.ItemJournalQH.ItemJournalQH_Service();
            sev.Url         = WebServiceInstants.GetURL(ServiceType.ItemJournalQH);
            sev.Credentials = nc;

            ItemJournalQH.ItemJournalQH[] journal = sev.ReadMultiple("DEFAULT", null, null, 0);

            for (int i = 0; i < journal.Length; i++)
            {
                Object[] array = new Object[6];
                array[0] = journal[i].Item_No;
                array[1] = journal[i].Location_Code;
                array[2] = journal[i].New_Location_Code;
                array[3] = journal[i].Bin_Code;
                array[4] = journal[i].New_Bin_Code;
                array[5] = journal[i].Quantity;

                PostJournal.Rows.Add(array);
            }

            grdLineToPost.DataSource = PostJournal;
        }
Example #2
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;
            }
        }