public DriverRates(DateTime ratesDate, string agentNumber, string agentName) { //Constructor try { //Cache the rate tables for this rates date this.mRatesDate = ratesDate; this.mAgentNumber = agentNumber; this.mAgentName = agentName; this.mRates = new DriverRatesDS(); Refresh(); } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new DriverRates instance.", ex); } }
public DriverRatesDS GetUnitRouteRates(DateTime date, string terminalAgent, string route) { //Return applicable route-based unit rates (i.e. multi-trip, carton, pallet) for the specified date DriverRatesDS rates = new DriverRatesDS(); try { DataSet ds = new DataService().FillDataset(this.mConnectionID, USP_RATEUNITROUTE, TBL_RATEUNITROUTE, new object[] { date, terminalAgent, route }); if (ds.Tables[TBL_RATEUNITROUTE].Rows.Count > 0) { rates.Merge(ds); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new DriverRateException("Unexpected error while reading rates.", ex); } return(rates); }
public static DriverRatesDS GetMileageRouteRates(DateTime date, string terminalAgent, string route) { //Return applicable route-based mileage rates for the specified date DriverRatesDS rates = new DriverRatesDS(); try { DataSet ds = Mediator.FillDataset(USP_RATEMILEAGEROUTE, TBL_RATEMILEAGEROUTE, new object[] { date, terminalAgent, route }); if (ds.Tables[TBL_RATEMILEAGEROUTE].Rows.Count > 0) { rates.Merge(ds); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new DriverRateException("Unexpected error while reading rates.", ex); } return(rates); }
public DriverRatesDS GetMileageRates(DateTime date, string terminalAgent, int equipmentTypeID) { //Return applicable mileage rates for the specified date DriverRatesDS rates = new DriverRatesDS(); try { object id = null; if (equipmentTypeID > -1) { id = equipmentTypeID; } DataSet ds = new DataService().FillDataset(this.mConnectionID, USP_RATEMILEAGE, TBL_RATEMILEAGE, new object[] { date, terminalAgent, id }); if (ds.Tables[TBL_RATEMILEAGE].Rows.Count > 0) { rates.Merge(ds); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new DriverRateException("Unexpected error while reading rates.", ex); } return(rates); }
public static DriverRatesDS GetUnitRates(DateTime date, string terminalAgent, int equipmentTypeID) { //Return applicable unit rates (i.e. multi-trip, carton, pallet) for the specified date DriverRatesDS rates = new DriverRatesDS(); try { object id = null; if (equipmentTypeID > -1) { id = equipmentTypeID; } DataSet ds = Mediator.FillDataset(USP_RATEUNIT, TBL_RATEUNIT, new object[] { date, terminalAgent, id }); if (ds.Tables[TBL_RATEUNIT].Rows.Count > 0) { rates.Merge(ds); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new DriverRateException("Unexpected error while reading rates.", ex); } return(rates); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(dlgRates)); this.btnOK = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); this.mDriverRatesDS = new Argix.Finance.DriverRatesDS(); this.ctlRates1 = new Argix.Finance.ctlRates(); ((System.ComponentModel.ISupportInitialize)(this.mDriverRatesDS)).BeginInit(); this.SuspendLayout(); // // btnOK // this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnOK.Location = new System.Drawing.Point(366, 324); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(96, 24); this.btnOK.TabIndex = 0; this.btnOK.Text = "&OK "; this.btnOK.Visible = false; // // btnCancel // this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnCancel.Location = new System.Drawing.Point(468, 324); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(96, 24); this.btnCancel.TabIndex = 1; this.btnCancel.Text = "&Close"; // // mDriverRatesDS // this.mDriverRatesDS.DataSetName = "DriverCompRatesDS"; this.mDriverRatesDS.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // ctlRates1 // this.ctlRates1.Cursor = System.Windows.Forms.Cursors.Default; this.ctlRates1.Location = new System.Drawing.Point(1, 2); this.ctlRates1.Name = "ctlRates1"; this.ctlRates1.Rates = null; this.ctlRates1.Size = new System.Drawing.Size(571, 316); this.ctlRates1.TabIndex = 2; this.ctlRates1.ErrorMessage += new Argix.Finance.ErrorEventHandler(this.OnErrorMessage); // // dlgRates // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(570, 352); this.Controls.Add(this.ctlRates1); this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnOK); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "dlgRates"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Driver Rates"; this.TopMost = true; this.Load += new System.EventHandler(this.OnFormLoad); ((System.ComponentModel.ISupportInitialize)(this.mDriverRatesDS)).EndInit(); this.ResumeLayout(false); }