private void OnFormLoad(object sender, EventArgs e) { //Event handler for form load event this.Cursor = Cursors.WaitCursor; try { //Initialize controls #region Grid customizations from normal layout (to support cell editing) this.grdSchedule.DisplayLayout.Override.RowSelectors = DefaultableBoolean.False; this.grdSchedule.DisplayLayout.Override.SelectTypeRow = SelectType.None; this.grdSchedule.DisplayLayout.Override.SelectTypeCell = SelectType.Single; this.grdSchedule.DisplayLayout.TabNavigation = TabNavigation.NextCell; this.grdSchedule.DisplayLayout.Override.AllowAddNew = AllowAddNew.No; this.grdSchedule.DisplayLayout.Override.AllowDelete = DefaultableBoolean.False; this.grdSchedule.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.True; this.grdSchedule.DisplayLayout.Override.CellClickAction = CellClickAction.EditAndSelectText; this.grdSchedule.DisplayLayout.Override.MaxSelectedCells = 1; this.grdSchedule.DisplayLayout.Override.RowFilterMode = RowFilterMode.AllRowsInBand; this.grdSchedule.DisplayLayout.Override.RowFilterAction = RowFilterAction.HideFilteredOutRows; this.grdSchedule.DisplayLayout.Bands[0].Columns["ID"].CellActivation = Activation.NoEdit; this.grdSchedule.DisplayLayout.Bands[0].Columns["Created"].SortIndicator = SortIndicator.Descending; #endregion this.ColumnHeaders = global::Argix.Properties.Settings.Default.LoadTenderColumnHeaders; this.mOrigins.Merge(FreightGateway.GetLocations()); this.mDestinations.Merge(FreightGateway.GetLocations()); this.mCarriers.Merge(FreightGateway.GetCarriers()); this.mDrivers.Merge(FreightGateway.GetDrivers()); this.cboSchedule.SelectedIndex = 1; Application.DoEvents(); OnScheduleChanged(null, EventArgs.Empty); } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); } finally { setUserServices(); this.Cursor = Cursors.Default; } }
private void OnFormLoad(object sender, System.EventArgs e) { //Event handler for form load event this.Cursor = Cursors.WaitCursor; try { //Load selection lists this.mOrigins.Merge(FreightGateway.GetLocations()); this.mDestinations.Merge(FreightGateway.GetLocations()); this.mCarriers.Merge(FreightGateway.GetCarriers()); this.mDrivers.Merge(FreightGateway.GetDrivers()); //Load controls this.Text = "BBB Trip" + " (" + (this.mTrip.ID > 0 ? this.mTrip.ID.ToString() : "New") + (this.mIsTemplate ? " Template)" : ")"); this.lblID.Text = this.mTrip.ID > 0 ? this.mTrip.ID.ToString("00000000") : ""; this.dtpScheduleDate.Value = !this.mTrip.IsScheduleDateNull() ? this.mTrip.ScheduleDate : DateTime.Today; this.cboOrigin.Text = !this.mTrip.IsOriginNull() ? this.mTrip.Origin : ""; this.txtOriginLoc.Text = !this.mTrip.IsOriginLocationNull() ? this.mTrip.OriginLocation : ""; this.cboDestination.Text = !this.mTrip.IsDestinationNull() ? this.mTrip.Destination : ""; this.txtDestinationLoc.Text = !this.mTrip.IsDestinationLocationNull() ? this.mTrip.DestinationLocation : ""; this.txtAmount.Text = !this.mTrip.IsAmountNull() ? this.mTrip.Amount.ToString() : "0"; this.cboAmountType.Text = !this.mTrip.IsAmountTypeNull() ? this.mTrip.AmountType : "Cartons"; this.cboFreightType.Text = !this.mTrip.IsFreightTypeNull() ? this.mTrip.FreightType : "PCS"; this.txtTrailerNumber.Text = !this.mTrip.IsDriverNameNull() ? this.mTrip.TrailerNumber : ""; this.txtDropEmptyTrailerNumber.Text = !this.mTrip.IsDropEmptyTrailerNumberNull() ? this.mTrip.DropEmptyTrailerNumber : ""; this.chkIsLiveUnload.Checked = !this.mTrip.IsIsLiveUnloadNull() ? this.mTrip.IsLiveUnload : false; this.cboCarrier.Text = !this.mTrip.IsCarrierNameNull() ? this.mTrip.CarrierName : "ARGIX"; this.cboDriver.Text = !this.mTrip.IsDriverNameNull() ? this.mTrip.DriverName : ""; this.chkConfirmed.Checked = !this.mTrip.IsConfirmedNull() ? this.mTrip.Confirmed : false; this.dtpScheduledDeparture.MinDate = DateTime.MinValue; this.dtpScheduledDeparture.MaxDate = DateTime.MaxValue; if (!this.mTrip.IsScheduledDepartureNull()) { this.dtpScheduledDeparture.Value = this.mTrip.ScheduledDeparture; } this.dtpScheduledArrival.MinDate = DateTime.MinValue; this.dtpScheduledArrival.MaxDate = DateTime.MaxValue; if (!this.mTrip.IsScheduledArrivalNull()) { this.dtpScheduledArrival.Value = this.mTrip.ScheduledArrival; } this.dtpActualDeparture.MinDate = DateTime.MinValue; this.dtpActualDeparture.MaxDate = DateTime.MaxValue; if (!this.mTrip.IsActualDepartureNull()) { this.dtpActualDeparture.Value = this.mTrip.ActualDeparture; } this.dtpActualDeparture.Checked = !this.mTrip.IsActualDepartureNull(); this.dtpActualArrival.MinDate = DateTime.MinValue; this.dtpActualArrival.MaxDate = DateTime.MaxValue; if (!this.mTrip.IsActualArrivalNull()) { this.dtpActualArrival.Value = this.mTrip.ActualArrival; } this.dtpActualArrival.Checked = !this.mTrip.IsActualArrivalNull(); this.txtComments.Text = !this.mTrip.IsCommentsNull() ? this.mTrip.Comments : ""; this.txtTDSNumber.Text = !this.mTrip.IsTDSNumberNull() ? this.mTrip.TDSNumber : ""; } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); } finally { OnValidateForm(null, null); this.Cursor = Cursors.Default; } }
private void OnFormLoad(object sender, System.EventArgs e) { //Event handler for form load event this.Cursor = Cursors.WaitCursor; try { //Load selection lists this.mLocations.Merge(FreightGateway.GetLocations()); this.mConsignees.Merge(FreightGateway.GetLocations()); this.mCarriers.Merge(FreightGateway.GetCarriers()); this.mDrivers.Merge(FreightGateway.GetDrivers()); //Load controls this.Text = "Client Inbound Freight" + " (" + (!this.mAppt.IsIDNull() ? this.mAppt.ID.ToString() : "New") + (this.mIsTemplate ? " Template)" : ")"); this.lblID.Text = !this.mAppt.IsIDNull() ? this.mAppt.ID.ToString("00000000") : ""; this.dtpScheduleDate.MinDate = DateTime.MinValue; this.dtpScheduleDate.MaxDate = DateTime.Today.AddDays(30); this.dtpScheduleDate.Value = !this.mAppt.IsScheduleDateNull() ? this.mAppt.ScheduleDate : DateTime.Today; if (!this.mAppt.IsVendorNameNull()) { this.cboShipper.Text = this.mAppt.VendorName; } else { this.cboShipper.Text = ""; this.cboShipper.SelectedIndex = -1; } this.cboConsignee.Text = !this.mAppt.IsConsigneeNameNull() ? this.mAppt.ConsigneeName : ""; this.txtAmount.Text = !this.mAppt.IsAmountNull() ? this.mAppt.Amount.ToString() : "0"; this.cboAmountType.Text = !this.mAppt.IsAmountTypeNull() ? this.mAppt.AmountType : "Cartons"; this.cboFreightType.Text = !this.mAppt.IsFreightTypeNull() ? this.mAppt.FreightType : "Tsort"; this.dtpSortDate.MinDate = DateTime.MinValue; this.dtpSortDate.MaxDate = DateTime.MaxValue; if (!this.mAppt.IsSortDateNull()) { this.dtpSortDate.Value = this.mAppt.SortDate; } this.chkIsLiveUnload.Checked = !this.mAppt.IsIsLiveUnloadNull() ? this.mAppt.IsLiveUnload : false; this.dtpScheduledArrival.MinDate = DateTime.MinValue; this.dtpScheduledArrival.MaxDate = DateTime.MaxValue; if (!this.mAppt.IsScheduledArrivalNull()) { this.dtpScheduledArrival.Value = this.mAppt.ScheduledArrival; } else { this.dtpScheduledArrival.Value = this.dtpScheduleDate.Value; //Set time to 00:00:00 AM } this.txtTrailerNumber.Text = !this.mAppt.IsTrailerNumberNull() ? this.mAppt.TrailerNumber : ""; this.cboCarrier.Text = !this.mAppt.IsCarrierNameNull() ? this.mAppt.CarrierName : ""; this.cboDriver.Text = !this.mAppt.IsDriverNameNull() ? this.mAppt.DriverName : ""; this.dtpActualArrival.MinDate = DateTime.MinValue; this.dtpActualArrival.MaxDate = DateTime.MaxValue; if (!this.mAppt.IsActualArrivalNull()) { this.dtpActualArrival.Value = this.mAppt.ActualArrival; this.dtpActualArrival.Checked = true; } else { this.dtpActualArrival.Value = DateTime.Now; this.dtpActualArrival.Checked = false; } this.txtTDSNumber.Text = !this.mAppt.IsTDSNumberNull() ? this.mAppt.TDSNumber : ""; this.txtTDSCreatedBy.Text = !this.mAppt.IsTDSCreateUserIDNull() ? this.mAppt.TDSCreateUserID : ""; this.txtComments.Text = !this.mAppt.IsCommentsNull() ? this.mAppt.Comments : ""; } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); } finally { OnValidateForm(null, null); this.Cursor = Cursors.Default; } }