コード例 #1
0
ファイル: TerminalsGateway.cs プロジェクト: jpheary/Argix10
        public static bool UpdatePickup(RSReportsDataset.PickupTableRow pickup)
        {
            //
            bool updated = false;
            RSReportsServiceClient client = new RSReportsServiceClient();

            try {
                Pickup p = new Pickup();
                p.RecordID          = !pickup.IsRecordIDNull() ? pickup.RecordID : 0;
                p.Driver            = !pickup.IsDriverNull() ? pickup.Driver : "";
                p.RouteName         = !pickup.IsRt_NameNull() ? pickup.Rt_Name : "";
                p.CustomerID        = !pickup.IsCustomer_IDNull() ? pickup.Customer_ID : "";
                p.CustomerName      = !pickup.IsCustomerNameNull() ? pickup.CustomerName : "";
                p.CustomerType      = !pickup.IsCustTypeNull() ? pickup.CustType : "";
                p.CustomerAddress   = !pickup.IsAddressNull() ? pickup.Address : "";
                p.CustomerCity      = !pickup.IsCityNull() ? pickup.City : "";
                p.CustomerState     = !pickup.IsStateNull() ? pickup.State : "";
                p.CustomerZip       = !pickup.IsZipNull() ? pickup.Zip : "";
                p.ActualOrderSize   = !pickup.IsActOrdSizeNull() ? pickup.ActOrdSize : 0;
                p.ActualOrderWeight = !pickup.IsActOrdLbsNull() ? pickup.ActOrdLbs : 0;
                p.UnscheduledPickup = !pickup.IsUnsched_PUNull() ? pickup.Unsched_PU : "";
                p.Comments          = !pickup.IsCommentsNull() ? pickup.Comments : "";
                p.ActualCommodity   = !pickup.IsActCmdtyNull() ? pickup.ActCmdty : "";
                updated             = client.UpdatePickup(p);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RoadshowFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(updated);
        }