Exemplo n.º 1
0
        public LTLShipmentDataset SearchLTLShipments(DateTime shipDateStart, DateTime shipDateEnd, string clientNumber, string shipperNumber, int consigneeNumber)
        {
            //
            LTLShipmentDataset      shipments = new LTLShipmentDataset();
            LTLClientService2Client client    = new LTLClientService2Client();

            try {
                if (clientNumber != null && clientNumber.Trim().Length > 0)
                {
                    LTLSearch2 criteria = new LTLSearch2();
                    criteria.ShipDateStart   = shipDateStart;
                    criteria.ShipDateEnd     = shipDateEnd;
                    criteria.ClientNumber    = clientNumber;
                    criteria.ShipperNumber   = shipperNumber;
                    criteria.ConsigneeNumber = consigneeNumber;
                    DataSet ds = client.SearchLTLShipments(criteria);
                    if (ds != null && ds.Tables["LTLShipmentTable"] != null && ds.Tables["LTLShipmentTable"].Rows.Count > 0)
                    {
                        shipments.Merge(ds);
                    }
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(shipments);
        }
Exemplo n.º 2
0
        public DataSet SearchLTLShipments(LTLSearch2 criteria)
        {
            //
            DataSet shipments = null;

            try {
                shipments = new DataService().FillDataset(SQL_CONNID, USP_SHIPMENTS_SEARCH, TBL_SHIPMENT,
                                                          new object[] {
                    criteria.ShipDateStart, criteria.ShipDateEnd,
                    criteria.ClientNumber,
                    (criteria.ShipperNumber != null && criteria.ShipperNumber.Trim().Length > 0 ? criteria.ShipperNumber : null),
                    (criteria.ConsigneeNumber > 0 ? criteria.ConsigneeNumber : null as object)
                });
            }
            catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
            return(shipments);
        }
Exemplo n.º 3
0
        private void OnSearchClick(object sender, EventArgs e)
        {
            //
            this.Cursor = Cursors.WaitCursor;
            try {
                this.grdSearch.Text = "Search Results for " + this.cboClient2.Text;
                this.mSearch.Clear();

                LTLSearch2 criteria = new LTLSearch2();
                criteria.ShipDateStart   = this.dtpShipDateStart.Value;
                criteria.ShipDateEnd     = this.dtpShipDateEnd.Value;
                criteria.ClientNumber    = this.cboClient2.SelectedValue.ToString();
                criteria.ShipperNumber   = this.cboShipper.SelectedValue.ToString();
                criteria.ConsigneeNumber = (int)this.cboConsignee.SelectedValue;
                this.mSearch.Merge(FreightGateway.SearchLTLShipments(criteria));
            }
            catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); }
            finally { setUserServices(); this.Cursor = Cursors.Default; }
        }
Exemplo n.º 4
0
        public static FreightDataset SearchLTLShipments(LTLSearch2 criteria)
        {
            //
            FreightDataset         shipments = new FreightDataset();
            LTLAdminService2Client client    = new LTLAdminService2Client();

            try {
                DataSet ds = client.SearchLTLShipmentsForAdmin(criteria);
                if (ds != null && ds.Tables["LTLShipmentTable"] != null && ds.Tables["LTLShipmentTable"].Rows.Count > 0)
                {
                    shipments.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <LTLFault> dfe) { client.Abort(); throw new ApplicationException(dfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(shipments);
        }