private void OnDragDrop(object sender, System.Windows.Forms.DragEventArgs e) { //Event handler for dropping onto the grid try { DataObject oData = (DataObject)e.Data; if (oData.GetDataPresent(DataFormats.StringFormat, true)) { for (int i = 0; i < this.mTemplates.ClientInboundScheduleTable.Rows.Count; i++) { if (this.mTemplates.ClientInboundScheduleTable[i].Selected == true) { DispatchDataset.ClientInboundScheduleTableRow appointment = new DispatchDataset().ClientInboundScheduleTable.NewClientInboundScheduleTableRow(); appointment.ItemArray = this.mTemplates.ClientInboundScheduleTable[i].ItemArray; appointment.CreateUserID = Environment.UserName; appointment.Created = DateTime.Now; switch (this.cboSchedule.SelectedItem.ToString()) { case "Today": appointment.ScheduleDate = DateTime.Today; break; case "Advanced": appointment.ScheduleDate = DateTime.Today.AddDays(1); break; } appointment.ScheduledArrival = appointment.ScheduleDate.Date + appointment.ScheduledArrival.TimeOfDay; appointment.IsTemplate = false; FreightGateway.AddClientInboundFreight(appointment); } } Refresh(); } } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Warning); } }
public void OnAutoRefreshCompleted(object sender, RunWorkerCompletedEventArgs e) { // try { DispatchDataset ds = null; if (this.InvokeRequired) { this.Invoke(new RunWorkerCompletedEventHandler(OnAutoRefreshCompleted), new object[] { sender, e }); } else { ds = (DispatchDataset)e.Result; if (this.grdSchedule.ActiveCell == null || !this.grdSchedule.ActiveCell.IsInEditMode) { reportStatus(new StatusEventArgs("Refreshing Load Tenders...")); this.mGridSvc.CaptureState(); lock (this.mSchedule) { this.mSchedule.Clear(); this.mSchedule.Merge(ds); } this.mGridSvc.RestoreState(); } } } catch { } }
public bool Export(string exportFile, DispatchDataset requests) { //Export pickup requests to the specified file bool exported = false; StreamWriter writer = null; try { //Validate file is unique //if(File.Exists(exportFile)) throw new Exception("Export file " + exportFile + " already exists. "); //Create the new file and save pickup requests writer = new StreamWriter(new FileStream(exportFile, FileMode.Create, FileAccess.ReadWrite)); writer.BaseStream.Seek(0, SeekOrigin.Begin); for (int j = 0; j < requests.PickupLogTable.Rows.Count; j++) { string order = formatOrderRecord(requests.PickupLogTable[j]); if (order.Length > 0) { writer.WriteLine(order); } } writer.Flush(); exported = true; } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException(ex.Message, ex); } finally { if (writer != null) { writer.Close(); } } return(exported); }
private void OnScheduleKeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter && this.grdSchedule.ActiveRow != null) { this.grdSchedule.ActiveRow.Update(); e.Handled = true; } else if (e.Control && e.KeyCode == Keys.C) { Cursor.Current = Cursors.WaitCursor; if (this.grdSchedule.ActiveRow != null) { int id = int.Parse(this.grdSchedule.ActiveRow.Cells["ID"].Value.ToString()); DataRow[] appointments = this.mSchedule.ClientInboundScheduleTable.Select("ID=" + id); Clipboard.SetData(DataFormats.Serializable, appointments[0].ItemArray); } } else if (e.Control && e.KeyCode == Keys.V) { if (this.cboSchedule.SelectedItem.ToString() == "Today" || this.cboSchedule.SelectedItem.ToString() == "Advanced") { Cursor.Current = Cursors.WaitCursor; object o = Clipboard.GetData(DataFormats.Serializable); if (o != null) { Cursor.Current = Cursors.WaitCursor; object[] os = (object[])o; DispatchDataset.ClientInboundScheduleTableRow appointment = new DispatchDataset().ClientInboundScheduleTable.NewClientInboundScheduleTableRow(); appointment.ItemArray = os; appointment.CreateUserID = Environment.UserName; appointment.Created = DateTime.Now; switch (this.cboSchedule.SelectedItem.ToString()) { case "Today": appointment.ScheduleDate = DateTime.Today; break; case "Advanced": appointment.ScheduleDate = DateTime.Today.AddDays(1); break; } appointment.ScheduledArrival = appointment.ScheduleDate.Date + appointment.ScheduledArrival.TimeOfDay; FreightGateway.AddClientInboundFreight(appointment); Refresh(); } } } else if (e.KeyCode == Keys.Delete) { if (this.csCancel.Enabled) { Cancel(); } } } catch (ArgumentException aex) { App.ReportError(new ApplicationException("Not a valid appointment.", aex), true); } catch (Exception ex) { App.ReportError(ex, false, LogLevel.Warning); } finally { Cursor.Current = Cursors.Default; } }
private void refreshBlog(DispatchDataset ds) { //Update the Blog- resultset is ordered by Date ASC if (ds.BlogTable[ds.BlogTable.Rows.Count - 1].Date.CompareTo(this.mLastBlogUpdate) > 0) { this.mLastBlogUpdate = ds.BlogTable[ds.BlogTable.Rows.Count - 1].Date; this.txtBlog.Clear(); for (int i = 0; i < ds.BlogTable.Rows.Count; i++) { string entry = ds.BlogTable[i].Date.ToString("MM/dd/yyyy hh:mm tt") + " [" + ds.BlogTable[i].UserID + "]\r\n" + ds.BlogTable[i].Comment + "\r\n"; this.txtBlog.AppendText(entry); this.txtBlog.AppendText("\r\n"); } } }
public void OnAutoRefreshCompleted(object sender, RunWorkerCompletedEventArgs e) { // try { DispatchDataset ds = null; if (this.InvokeRequired) { this.Invoke(new RunWorkerCompletedEventHandler(OnAutoRefreshCompleted), new object[] { sender, e }); } else { ds = (DispatchDataset)e.Result; lock (this.txtBlog) { refreshBlog(ds); } } } catch { } }
public PickupRequest ReadPickup(int requestID) { //Read an existing pickup request PickupRequest request = null; try { // DataSet ds = new DispatchGateway().GetPickupRequest(requestID); if (ds != null) { DispatchDataset _request = new DispatchDataset(); _request.Merge(ds); if (_request.PickupLogTable.Rows.Count > 0) { request = new PickupRequest(_request.PickupLogTable[0]); } } } catch (Exception ex) { throw new FaultException <DispatchFault>(new DispatchFault(ex.Message), "Service Error"); } return(request); }
private void OnBlogKeyUp(object sender, KeyEventArgs e) { //Event handler for new blog entry Cursor.Current = Cursors.WaitCursor; try { if (e.KeyCode == Keys.Enter) { BlogEntry entry = new BlogEntry(); entry.Date = DateTime.Now; entry.Comment = this.txtComment.Text; entry.UserID = Environment.UserName; if (FreightGateway.AddBlogEntry(entry)) { this.txtComment.Clear(); lock (this.txtBlog) { DispatchDataset ds = FreightGateway.ViewBlog(); refreshBlog(ds); } } } } catch (Exception ex) { App.ReportError(ex, false, LogLevel.Warning); } finally { Cursor.Current = Cursors.Default; } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.btnOk = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); this.txtDestinationLoc = new System.Windows.Forms.TextBox(); this.mDestinations = new Argix.DispatchDataset(); this.txtOriginLoc = new System.Windows.Forms.TextBox(); this.mOrigins = new Argix.DispatchDataset(); this.txtDropEmptyTrailerNumber = new System.Windows.Forms.TextBox(); this._lblDropEmptyTrailerNumber = new System.Windows.Forms.Label(); this.grpGate = new System.Windows.Forms.GroupBox(); this.dtpActualArrival = new System.Windows.Forms.DateTimePicker(); this.txtTDSNumber = new System.Windows.Forms.TextBox(); this._lblTDSNumber = new System.Windows.Forms.Label(); this._lblActualDeparture = new System.Windows.Forms.Label(); this.dtpActualDeparture = new System.Windows.Forms.DateTimePicker(); this._lblActualArrival = new System.Windows.Forms.Label(); this._lblDeparture = new System.Windows.Forms.Label(); this._lblScheduledArrival = new System.Windows.Forms.Label(); this.dtpScheduledDeparture = new System.Windows.Forms.DateTimePicker(); this.dtpScheduledArrival = new System.Windows.Forms.DateTimePicker(); this.dtpScheduleDate = new System.Windows.Forms.DateTimePicker(); this.lblID = new System.Windows.Forms.Label(); this._lblID = new System.Windows.Forms.Label(); this._lblScheduleDate = new System.Windows.Forms.Label(); this._lblDestination = new System.Windows.Forms.Label(); this.cboDestination = new System.Windows.Forms.ComboBox(); this._lblComments = new System.Windows.Forms.Label(); this.grpDispatch = new System.Windows.Forms.GroupBox(); this.cboDriver = new System.Windows.Forms.ComboBox(); this.mDrivers = new Argix.DispatchDataset(); this.cboCarrier = new System.Windows.Forms.ComboBox(); this.mCarriers = new Argix.DispatchDataset(); this._lblCarrier = new System.Windows.Forms.Label(); this._lblDriver = new System.Windows.Forms.Label(); this.chkConfirmed = new System.Windows.Forms.CheckBox(); this.txtTrailerNumber = new System.Windows.Forms.TextBox(); this._lblTrailerNumber = new System.Windows.Forms.Label(); this.txtComments = new System.Windows.Forms.TextBox(); this._lblOrigin = new System.Windows.Forms.Label(); this.cboOrigin = new System.Windows.Forms.ComboBox(); this.cboAmountType = new System.Windows.Forms.ComboBox(); this.txtAmount = new System.Windows.Forms.TextBox(); this._lblAmount = new System.Windows.Forms.Label(); this._lblOf = new System.Windows.Forms.Label(); this.cboFreightType = new System.Windows.Forms.ComboBox(); this.chkIsLiveUnload = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.mDestinations)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.mOrigins)).BeginInit(); this.grpGate.SuspendLayout(); this.grpDispatch.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.mDrivers)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.mCarriers)).BeginInit(); this.SuspendLayout(); // // btnOk // this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnOk.Location = new System.Drawing.Point(589, 385); this.btnOk.Name = "btnOk"; this.btnOk.Size = new System.Drawing.Size(96, 24); this.btnOk.TabIndex = 15; this.btnOk.Text = "&Ok"; this.btnOk.UseVisualStyleBackColor = true; this.btnOk.Click += new System.EventHandler(this.OnCommandClick); // // btnCancel // this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.Location = new System.Drawing.Point(691, 385); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(96, 24); this.btnCancel.TabIndex = 0; this.btnCancel.Text = "&Cancel"; this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.Click += new System.EventHandler(this.OnCommandClick); // // txtDestinationLoc // this.txtDestinationLoc.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.mDestinations, "LocationTable.Location", true, System.Windows.Forms.DataSourceUpdateMode.Never)); this.txtDestinationLoc.Location = new System.Drawing.Point(112, 132); this.txtDestinationLoc.MaxLength = 100; this.txtDestinationLoc.Name = "txtDestinationLoc"; this.txtDestinationLoc.Size = new System.Drawing.Size(275, 20); this.txtDestinationLoc.TabIndex = 5; // // mDestinations // this.mDestinations.DataSetName = "DispatchDataset"; this.mDestinations.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // txtOriginLoc // this.txtOriginLoc.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.mOrigins, "LocationTable.Location", true, System.Windows.Forms.DataSourceUpdateMode.Never)); this.txtOriginLoc.Location = new System.Drawing.Point(112, 76); this.txtOriginLoc.MaxLength = 100; this.txtOriginLoc.Name = "txtOriginLoc"; this.txtOriginLoc.Size = new System.Drawing.Size(275, 20); this.txtOriginLoc.TabIndex = 3; // // mOrigins // this.mOrigins.DataSetName = "DispatchDataset"; this.mOrigins.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // txtDropEmptyTrailerNumber // this.txtDropEmptyTrailerNumber.Location = new System.Drawing.Point(112, 259); this.txtDropEmptyTrailerNumber.MaxLength = 15; this.txtDropEmptyTrailerNumber.Name = "txtDropEmptyTrailerNumber"; this.txtDropEmptyTrailerNumber.Size = new System.Drawing.Size(100, 20); this.txtDropEmptyTrailerNumber.TabIndex = 11; // // _lblDropEmptyTrailerNumber // this._lblDropEmptyTrailerNumber.Location = new System.Drawing.Point(6, 259); this._lblDropEmptyTrailerNumber.Name = "_lblDropEmptyTrailerNumber"; this._lblDropEmptyTrailerNumber.Size = new System.Drawing.Size(100, 16); this._lblDropEmptyTrailerNumber.TabIndex = 172; this._lblDropEmptyTrailerNumber.Text = "Drop Empty Trailer#"; this._lblDropEmptyTrailerNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // grpGate // this.grpGate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.grpGate.Controls.Add(this.dtpActualArrival); this.grpGate.Controls.Add(this.txtTDSNumber); this.grpGate.Controls.Add(this._lblTDSNumber); this.grpGate.Controls.Add(this._lblActualDeparture); this.grpGate.Controls.Add(this.dtpActualDeparture); this.grpGate.Controls.Add(this._lblActualArrival); this.grpGate.Controls.Add(this._lblDeparture); this.grpGate.Controls.Add(this._lblScheduledArrival); this.grpGate.Controls.Add(this.dtpScheduledDeparture); this.grpGate.Controls.Add(this.dtpScheduledArrival); this.grpGate.Location = new System.Drawing.Point(430, 186); this.grpGate.Name = "grpGate"; this.grpGate.Size = new System.Drawing.Size(350, 150); this.grpGate.TabIndex = 13; this.grpGate.TabStop = false; this.grpGate.Text = "Departure/Arrival"; // // dtpActualArrival // this.dtpActualArrival.Checked = false; this.dtpActualArrival.CustomFormat = "hh:mm tt"; this.dtpActualArrival.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dtpActualArrival.Location = new System.Drawing.Point(213, 75); this.dtpActualArrival.Name = "dtpActualArrival"; this.dtpActualArrival.ShowCheckBox = true; this.dtpActualArrival.ShowUpDown = true; this.dtpActualArrival.Size = new System.Drawing.Size(100, 20); this.dtpActualArrival.TabIndex = 3; // // txtTDSNumber // this.txtTDSNumber.Location = new System.Drawing.Point(213, 115); this.txtTDSNumber.MaxLength = 15; this.txtTDSNumber.Name = "txtTDSNumber"; this.txtTDSNumber.Size = new System.Drawing.Size(100, 20); this.txtTDSNumber.TabIndex = 4; // // _lblTDSNumber // this._lblTDSNumber.Location = new System.Drawing.Point(111, 117); this._lblTDSNumber.Name = "_lblTDSNumber"; this._lblTDSNumber.Size = new System.Drawing.Size(75, 14); this._lblTDSNumber.TabIndex = 205; this._lblTDSNumber.Text = "TDS#"; this._lblTDSNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblActualDeparture // this._lblActualDeparture.Location = new System.Drawing.Point(5, 49); this._lblActualDeparture.Name = "_lblActualDeparture"; this._lblActualDeparture.Size = new System.Drawing.Size(75, 16); this._lblActualDeparture.TabIndex = 141; this._lblActualDeparture.Text = "Scheduled"; this._lblActualDeparture.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // dtpActualDeparture // this.dtpActualDeparture.Checked = false; this.dtpActualDeparture.CustomFormat = "hh:mm tt"; this.dtpActualDeparture.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dtpActualDeparture.Location = new System.Drawing.Point(86, 75); this.dtpActualDeparture.Name = "dtpActualDeparture"; this.dtpActualDeparture.ShowCheckBox = true; this.dtpActualDeparture.ShowUpDown = true; this.dtpActualDeparture.Size = new System.Drawing.Size(100, 20); this.dtpActualDeparture.TabIndex = 2; // // _lblActualArrival // this._lblActualArrival.Location = new System.Drawing.Point(5, 75); this._lblActualArrival.Name = "_lblActualArrival"; this._lblActualArrival.Size = new System.Drawing.Size(75, 16); this._lblActualArrival.TabIndex = 143; this._lblActualArrival.Text = "Actual"; this._lblActualArrival.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblDeparture // this._lblDeparture.Location = new System.Drawing.Point(86, 26); this._lblDeparture.Name = "_lblDeparture"; this._lblDeparture.Size = new System.Drawing.Size(100, 16); this._lblDeparture.TabIndex = 163; this._lblDeparture.Text = "Depart"; this._lblDeparture.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // _lblScheduledArrival // this._lblScheduledArrival.Location = new System.Drawing.Point(213, 26); this._lblScheduledArrival.Name = "_lblScheduledArrival"; this._lblScheduledArrival.Size = new System.Drawing.Size(100, 16); this._lblScheduledArrival.TabIndex = 161; this._lblScheduledArrival.Text = "Arrive"; this._lblScheduledArrival.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // dtpScheduledDeparture // this.dtpScheduledDeparture.CustomFormat = "hh:mm tt"; this.dtpScheduledDeparture.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dtpScheduledDeparture.Location = new System.Drawing.Point(86, 48); this.dtpScheduledDeparture.Name = "dtpScheduledDeparture"; this.dtpScheduledDeparture.ShowUpDown = true; this.dtpScheduledDeparture.Size = new System.Drawing.Size(100, 20); this.dtpScheduledDeparture.TabIndex = 0; this.dtpScheduledDeparture.ValueChanged += new System.EventHandler(this.OnScheduleChanged); // // dtpScheduledArrival // this.dtpScheduledArrival.CustomFormat = "hh:mm tt"; this.dtpScheduledArrival.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dtpScheduledArrival.Location = new System.Drawing.Point(213, 49); this.dtpScheduledArrival.Name = "dtpScheduledArrival"; this.dtpScheduledArrival.ShowUpDown = true; this.dtpScheduledArrival.Size = new System.Drawing.Size(100, 20); this.dtpScheduledArrival.TabIndex = 1; this.dtpScheduledArrival.ValueChanged += new System.EventHandler(this.OnScheduleChanged); // // dtpScheduleDate // this.dtpScheduleDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; this.dtpScheduleDate.Location = new System.Drawing.Point(112, 18); this.dtpScheduleDate.Name = "dtpScheduleDate"; this.dtpScheduleDate.Size = new System.Drawing.Size(100, 20); this.dtpScheduleDate.TabIndex = 1; this.dtpScheduleDate.ValueChanged += new System.EventHandler(this.OnScheduleDateChanged); // // lblID // this.lblID.Location = new System.Drawing.Point(627, 18); this.lblID.Name = "lblID"; this.lblID.Size = new System.Drawing.Size(100, 16); this.lblID.TabIndex = 167; this.lblID.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // _lblID // this._lblID.Location = new System.Drawing.Point(521, 18); this._lblID.Name = "_lblID"; this._lblID.Size = new System.Drawing.Size(100, 15); this._lblID.TabIndex = 164; this._lblID.Text = "Trip#"; this._lblID.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblScheduleDate // this._lblScheduleDate.Location = new System.Drawing.Point(6, 18); this._lblScheduleDate.Name = "_lblScheduleDate"; this._lblScheduleDate.Size = new System.Drawing.Size(100, 15); this._lblScheduleDate.TabIndex = 165; this._lblScheduleDate.Text = "Schedule Date"; this._lblScheduleDate.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblDestination // this._lblDestination.Location = new System.Drawing.Point(6, 107); this._lblDestination.Name = "_lblDestination"; this._lblDestination.Size = new System.Drawing.Size(100, 16); this._lblDestination.TabIndex = 166; this._lblDestination.Text = "Destination"; this._lblDestination.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // cboDestination // this.cboDestination.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; this.cboDestination.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboDestination.DataSource = this.mDestinations; this.cboDestination.DisplayMember = "LocationTable.Name"; this.cboDestination.Location = new System.Drawing.Point(112, 107); this.cboDestination.Name = "cboDestination"; this.cboDestination.Size = new System.Drawing.Size(275, 21); this.cboDestination.TabIndex = 4; this.cboDestination.ValueMember = "LocationTable.Name"; this.cboDestination.TextChanged += new System.EventHandler(this.OnValidateForm); // // _lblComments // this._lblComments.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this._lblComments.Location = new System.Drawing.Point(6, 301); this._lblComments.Name = "_lblComments"; this._lblComments.Size = new System.Drawing.Size(100, 16); this._lblComments.TabIndex = 160; this._lblComments.Text = "Comments"; this._lblComments.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // grpDispatch // this.grpDispatch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.grpDispatch.Controls.Add(this.cboDriver); this.grpDispatch.Controls.Add(this.cboCarrier); this.grpDispatch.Controls.Add(this._lblCarrier); this.grpDispatch.Controls.Add(this._lblDriver); this.grpDispatch.Controls.Add(this.chkConfirmed); this.grpDispatch.Location = new System.Drawing.Point(430, 51); this.grpDispatch.Name = "grpDispatch"; this.grpDispatch.Size = new System.Drawing.Size(350, 125); this.grpDispatch.TabIndex = 12; this.grpDispatch.TabStop = false; this.grpDispatch.Text = "Dispatch"; // // cboDriver // this.cboDriver.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cboDriver.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; this.cboDriver.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboDriver.DataSource = this.mDrivers; this.cboDriver.DisplayMember = "DriverTable.Description"; this.cboDriver.FormattingEnabled = true; this.cboDriver.Location = new System.Drawing.Point(87, 52); this.cboDriver.Name = "cboDriver"; this.cboDriver.Size = new System.Drawing.Size(253, 21); this.cboDriver.TabIndex = 1; this.cboDriver.ValueMember = "DriverTable.Description"; // // mDrivers // this.mDrivers.DataSetName = "DispatchDataset"; this.mDrivers.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // cboCarrier // this.cboCarrier.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cboCarrier.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; this.cboCarrier.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboCarrier.DataSource = this.mCarriers; this.cboCarrier.DisplayMember = "CarrierTable.Description"; this.cboCarrier.FormattingEnabled = true; this.cboCarrier.Location = new System.Drawing.Point(87, 25); this.cboCarrier.Name = "cboCarrier"; this.cboCarrier.Size = new System.Drawing.Size(253, 21); this.cboCarrier.TabIndex = 0; this.cboCarrier.ValueMember = "CarrierTable.Description"; // // mCarriers // this.mCarriers.DataSetName = "DispatchDataset"; this.mCarriers.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // _lblCarrier // this._lblCarrier.Location = new System.Drawing.Point(6, 25); this._lblCarrier.Name = "_lblCarrier"; this._lblCarrier.Size = new System.Drawing.Size(75, 16); this._lblCarrier.TabIndex = 148; this._lblCarrier.Text = "Carrier"; this._lblCarrier.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblDriver // this._lblDriver.Location = new System.Drawing.Point(6, 51); this._lblDriver.Name = "_lblDriver"; this._lblDriver.Size = new System.Drawing.Size(75, 16); this._lblDriver.TabIndex = 137; this._lblDriver.Text = "Driver"; this._lblDriver.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // chkConfirmed // this.chkConfirmed.Location = new System.Drawing.Point(87, 88); this.chkConfirmed.Name = "chkConfirmed"; this.chkConfirmed.Size = new System.Drawing.Size(80, 16); this.chkConfirmed.TabIndex = 2; this.chkConfirmed.Text = "Confirmed?"; // // txtTrailerNumber // this.txtTrailerNumber.Location = new System.Drawing.Point(112, 233); this.txtTrailerNumber.MaxLength = 15; this.txtTrailerNumber.Name = "txtTrailerNumber"; this.txtTrailerNumber.Size = new System.Drawing.Size(100, 20); this.txtTrailerNumber.TabIndex = 9; // // _lblTrailerNumber // this._lblTrailerNumber.Location = new System.Drawing.Point(6, 233); this._lblTrailerNumber.Name = "_lblTrailerNumber"; this._lblTrailerNumber.Size = new System.Drawing.Size(100, 16); this._lblTrailerNumber.TabIndex = 115; this._lblTrailerNumber.Text = "Trailer#"; this._lblTrailerNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // txtComments // this.txtComments.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.txtComments.Location = new System.Drawing.Point(112, 301); this.txtComments.MaxLength = 100; this.txtComments.Name = "txtComments"; this.txtComments.Size = new System.Drawing.Size(300, 20); this.txtComments.TabIndex = 14; // // _lblOrigin // this._lblOrigin.Location = new System.Drawing.Point(6, 51); this._lblOrigin.Name = "_lblOrigin"; this._lblOrigin.Size = new System.Drawing.Size(100, 16); this._lblOrigin.TabIndex = 162; this._lblOrigin.Text = "Origin"; this._lblOrigin.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // cboOrigin // this.cboOrigin.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; this.cboOrigin.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboOrigin.DataSource = this.mOrigins; this.cboOrigin.DisplayMember = "LocationTable.Name"; this.cboOrigin.Location = new System.Drawing.Point(112, 51); this.cboOrigin.Name = "cboOrigin"; this.cboOrigin.Size = new System.Drawing.Size(275, 21); this.cboOrigin.TabIndex = 2; this.cboOrigin.ValueMember = "LocationTable.Name"; this.cboOrigin.TextChanged += new System.EventHandler(this.OnValidateForm); // // cboAmountType // this.cboAmountType.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; this.cboAmountType.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboAmountType.Items.AddRange(new object[] { "Cartons", "Mixed", "Pallets", "Trailer" }); this.cboAmountType.Location = new System.Drawing.Point(168, 186); this.cboAmountType.MaxDropDownItems = 5; this.cboAmountType.Name = "cboAmountType"; this.cboAmountType.Size = new System.Drawing.Size(75, 21); this.cboAmountType.TabIndex = 7; this.cboAmountType.TextChanged += new System.EventHandler(this.OnValidateForm); // // txtAmount // this.txtAmount.Location = new System.Drawing.Point(112, 186); this.txtAmount.MaxLength = 5; this.txtAmount.Name = "txtAmount"; this.txtAmount.Size = new System.Drawing.Size(50, 20); this.txtAmount.TabIndex = 6; this.txtAmount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.txtAmount.TextChanged += new System.EventHandler(this.OnValidateForm); // // _lblAmount // this._lblAmount.Location = new System.Drawing.Point(6, 189); this._lblAmount.Name = "_lblAmount"; this._lblAmount.Size = new System.Drawing.Size(100, 15); this._lblAmount.TabIndex = 175; this._lblAmount.Text = "Amount"; this._lblAmount.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblOf // this._lblOf.Location = new System.Drawing.Point(274, 189); this._lblOf.Name = "_lblOf"; this._lblOf.Size = new System.Drawing.Size(20, 18); this._lblOf.TabIndex = 176; this._lblOf.Text = "of"; this._lblOf.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // cboFreightType // this.cboFreightType.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; this.cboFreightType.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboFreightType.Items.AddRange(new object[] { "Empty", "Mixed", "PCS" }); this.cboFreightType.Location = new System.Drawing.Point(297, 186); this.cboFreightType.MaxDropDownItems = 5; this.cboFreightType.Name = "cboFreightType"; this.cboFreightType.Size = new System.Drawing.Size(90, 21); this.cboFreightType.TabIndex = 8; this.cboFreightType.TextChanged += new System.EventHandler(this.OnValidateForm); // // chkIsLiveUnload // this.chkIsLiveUnload.Location = new System.Drawing.Point(272, 238); this.chkIsLiveUnload.Name = "chkIsLiveUnload"; this.chkIsLiveUnload.Size = new System.Drawing.Size(106, 15); this.chkIsLiveUnload.TabIndex = 10; this.chkIsLiveUnload.Text = "Live Unload?"; // // dlgBBBTrip // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(794, 421); this.Controls.Add(this.chkIsLiveUnload); this.Controls.Add(this.cboFreightType); this.Controls.Add(this._lblOf); this.Controls.Add(this.cboAmountType); this.Controls.Add(this.txtAmount); this.Controls.Add(this._lblAmount); this.Controls.Add(this.txtDestinationLoc); this.Controls.Add(this.txtOriginLoc); this.Controls.Add(this.txtDropEmptyTrailerNumber); this.Controls.Add(this._lblDropEmptyTrailerNumber); this.Controls.Add(this.grpGate); this.Controls.Add(this.txtTrailerNumber); this.Controls.Add(this._lblTrailerNumber); this.Controls.Add(this.dtpScheduleDate); this.Controls.Add(this.lblID); this.Controls.Add(this._lblID); this.Controls.Add(this._lblScheduleDate); this.Controls.Add(this._lblDestination); this.Controls.Add(this.cboDestination); this.Controls.Add(this._lblComments); this.Controls.Add(this.grpDispatch); this.Controls.Add(this.txtComments); this.Controls.Add(this._lblOrigin); this.Controls.Add(this.cboOrigin); this.Controls.Add(this.btnOk); this.Controls.Add(this.btnCancel); this.Cursor = System.Windows.Forms.Cursors.Default; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "dlgBBBTrip"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "BBB Trip"; this.Load += new System.EventHandler(this.OnFormLoad); ((System.ComponentModel.ISupportInitialize)(this.mDestinations)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.mOrigins)).EndInit(); this.grpGate.ResumeLayout(false); this.grpGate.PerformLayout(); this.grpDispatch.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.mDrivers)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.mCarriers)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
private void OnItemClick(object sender, System.EventArgs e) { dlgLoadTender dlg = null; DispatchDataset.LoadTenderLogTableRow entry = null; int id = 0; try { ToolStripItem item = (ToolStripItem)sender; switch (item.Name) { case "csNew": entry = new DispatchDataset().LoadTenderLogTable.NewLoadTenderLogTableRow(); entry.ScheduleDate = DateTime.Today.AddDays(1); dlg = new dlgLoadTender(entry); dlg.Font = this.Font; if (dlg.ShowDialog(this) == DialogResult.OK) { //Validate that a similiar load tender doesn't exist //TODO: ScheduleDate, Vendor, Amount, Weight FreightGateway.CreateLoadTenderEntry(entry); } break; case "csOpen": id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); DispatchDataset.LoadTenderLogTableRow _entry = (DispatchDataset.LoadTenderLogTableRow) this.mSchedule.LoadTenderLogTable.Select("ID=" + id)[0]; entry = new DispatchDataset().LoadTenderLogTable.NewLoadTenderLogTableRow(); entry.ItemArray = _entry.ItemArray; dlg = new dlgLoadTender(entry); dlg.Font = this.Font; if (dlg.ShowDialog(this) == DialogResult.OK) { FreightGateway.UpdateLoadTenderEntry(entry); Refresh(); } break; case "csClone": id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); entry = (DispatchDataset.LoadTenderLogTableRow) this.mSchedule.LoadTenderLogTable.Select("ID=" + id)[0]; DispatchDataset.LoadTenderLogTableRow clone = new DispatchDataset().LoadTenderLogTable.NewLoadTenderLogTableRow(); clone.ScheduleDate = DateTime.Today.AddDays(1); break; if (!entry.IsClientNull()) { clone.Client = entry.Client; } if (!entry.IsClientNumberNull()) { clone.ClientNumber = entry.ClientNumber; } if (!entry.IsVendorNumberNull()) { clone.VendorNumber = entry.VendorNumber; } if (!entry.IsVendorNameNull()) { clone.VendorName = entry.VendorName; } if (!entry.IsVendorAddressLine1Null()) { clone.VendorAddressLine1 = entry.VendorAddressLine1; } if (!entry.IsVendorAddressLine2Null()) { clone.VendorAddressLine2 = entry.VendorAddressLine2; } if (!entry.IsVendorCityNull()) { clone.VendorCity = entry.VendorCity; } if (!entry.IsVendorStateNull()) { clone.VendorState = entry.VendorState; } if (!entry.IsVendorZipNull()) { clone.VendorZip = entry.VendorZip; } if (!entry.IsVendorZipNull()) { clone.VendorZip4 = entry.VendorZip4; } if (!entry.IsWindowOpenNull()) { clone.WindowOpen = entry.WindowOpen; } if (!entry.IsWindowCloseNull()) { clone.WindowClose = entry.WindowClose; } if (!entry.IsDescriptionNull()) { clone.Description = entry.Description; } if (!entry.IsAmountNull()) { clone.Amount = entry.Amount; } if (!entry.IsAmountTypeNull()) { clone.AmountType = entry.AmountType; } if (!entry.IsWeightNull()) { clone.Weight = entry.Weight; } if (!entry.IsCommentsNull()) { clone.Comments = entry.Comments; } dlg = new dlgLoadTender(clone); dlg.Font = this.Font; if (dlg.ShowDialog(this) == DialogResult.OK) { //TODO: ScheduleDate, Vendor, Amount, Weight //TODO FreightGateway.CreateLoadTenderEntry(entry); } break; case "csCancel": id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); if (MessageBox.Show(this, "Are you sure you want to cancel load tender " + id.ToString() + "?", App.Product, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { FreightGateway.CancelLoadTenderEntry(id, DateTime.Now, Environment.UserName); Refresh(); } break; case "csTender": //Tender (attach image file) an existing load OpenFileDialog dlgOpen = new OpenFileDialog(); dlgOpen.AddExtension = true; dlgOpen.Filter = "All Files (*.*) | *.*"; dlgOpen.FilterIndex = 0; dlgOpen.Title = "Select Load Tender to Attach..."; dlgOpen.FileName = ""; if (dlgOpen.ShowDialog(this) == DialogResult.OK) { this.Cursor = Cursors.WaitCursor; string fileName = new System.IO.FileInfo(dlgOpen.FileName).Name; FileStream fsa = null; BinaryReader reader = null; try { id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); LoadTender lt = new LoadTender(); lt.Filename = dlgOpen.SafeFileName; fsa = new FileStream(dlgOpen.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read); reader = new BinaryReader(fsa); lt.File = reader.ReadBytes((int)fsa.Length); bool tendered = FreightGateway.TenderLoadTenderEntry(id, lt); MessageBox.Show(this, "Load Tender entry " + id.ToString() + " was tendered.", App.Product, MessageBoxButtons.OK, MessageBoxIcon.Information); Refresh(); } finally { if (reader != null) { reader.Close(); } if (fsa != null) { fsa.Close(); } } } break; case "csViewTender": //Open the load tender for the selected quote int number = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["LoadTenderNumber"].Value); LoadTender loadTender = FreightGateway.GetLoadTender(number); string file = App.Config.TempFolder + loadTender.Filename; try { System.IO.File.Delete(file); } catch { } FileStream fso = null; BinaryWriter writer = null; try { fso = new FileStream(file, FileMode.OpenOrCreate, FileAccess.Write); writer = new BinaryWriter(fso); writer.Write(loadTender.File); writer.Flush(); } finally { if (writer != null) { writer.Close(); } if (fso != null) { fso.Close(); } } System.Diagnostics.Process.Start(file); break; case "csScheduleTrip": id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); entry = (DispatchDataset.LoadTenderLogTableRow) this.mSchedule.LoadTenderLogTable.Select("ID=" + id)[0]; DispatchDataset.BBBScheduleTableRow trip = new DispatchDataset().BBBScheduleTable.NewBBBScheduleTableRow(); trip.Created = DateTime.Now; trip.CreateUserID = Environment.UserName; trip.ScheduleDate = entry.ScheduleDate; //trip.OriginLocationID = entry.VendorNumber; trip.Origin = entry.VendorName.Trim(); trip.OriginLocation = entry.VendorCity.Trim() + ", " + entry.VendorState.Trim(); trip.DestinationLocationID = 100000532000000053; trip.Destination = "ARGIX LOGISTICS NATIONAL"; trip.DestinationLocation = "JAMESBURG, NJ"; trip.CarrierName = "ARGIX"; trip.DriverName = ""; trip.Confirmed = false; trip.TrailerNumber = ""; trip.DropEmptyTrailerNumber = ""; trip.IsLiveUnload = !entry.IsFullTrailer; trip.Amount = entry.Amount; trip.AmountType = entry.AmountType; trip.FreightType = "PCS"; trip.TDSNumber = ""; trip.ScheduledDeparture = DateTime.MinValue.AddHours(11); trip.ScheduledArrival = DateTime.MinValue.AddHours(11); trip.Comments = entry.Comments; trip.IsTemplate = false; dlgBBBTrip dlgcif = new dlgBBBTrip(trip); dlgcif.Font = this.Font; if (dlgcif.ShowDialog(this) == DialogResult.OK) { FreightGateway.ScheduleLoadTenderEntry(id, trip); Refresh(); } break; case "csSchedulePickup": id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); entry = (DispatchDataset.LoadTenderLogTableRow) this.mSchedule.LoadTenderLogTable.Select("ID=" + id)[0]; DispatchDataset.PickupLogTableRow request = new DispatchDataset().PickupLogTable.NewPickupLogTableRow(); request.Created = DateTime.Now; request.CreateUserID = Environment.UserName; request.ScheduleDate = entry.ScheduleDate; request.CallerName = "PCS Load Tender"; request.ClientNumber = entry.ClientNumber; request.Client = entry.Client; request.ShipperNumber = ""; //entry.VendorNumber Needs to be a Roadshow AccountID- let user select; request.Shipper = entry.VendorName; request.ShipperAddress = entry.VendorAddressLine1 + "\r\n" + entry.VendorAddressLine2 + "\r\n" + entry.VendorCity + ", " + entry.VendorState + " " + entry.VendorZip; request.ShipperPhone = entry.ContactPhone; request.WindowOpen = entry.WindowOpen; request.WindowClose = entry.WindowClose; request.Amount = entry.Amount; request.AmountType = entry.AmountType; request.FreightType = "PCS"; request.Weight = entry.Weight; request.OrderType = "R"; request.Comments = entry.Comments; request.TerminalNumber = "0001"; request.Terminal = "ARGIX LOGISTICS RIDGEFIELD"; request.IsTemplate = false; dlgPickupRequest dlgpr = new dlgPickupRequest(request); dlgpr.Font = this.Font; if (dlgpr.ShowDialog(this) == DialogResult.OK) { FreightGateway.ScheduleLoadTenderEntry(id, request); } break; case "csSearch": break; case "csRefresh": Refresh(); break; } } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); } finally { setUserServices(); this.Cursor = Cursors.Default; } }
private void OnItemClick(object sender, System.EventArgs e) { dlgClientInboundFreight dlg = null; DispatchDataset.ClientInboundScheduleTableRow appointment = null; int id = 0; try { ToolStripItem item = (ToolStripItem)sender; switch (item.Name) { case "csNew": appointment = new DispatchDataset().ClientInboundScheduleTable.NewClientInboundScheduleTableRow(); switch (this.cboSchedule.SelectedItem.ToString()) { case "Today": appointment.ScheduleDate = DateTime.Today; break; case "Advanced": appointment.ScheduleDate = DateTime.Today.AddDays(1); break; } appointment.ConsigneeName = "ARGIX LOGISTICS NATIONAL"; appointment.CarrierName = "ARGIX"; appointment.IsTemplate = false; dlg = new dlgClientInboundFreight(appointment); dlg.Font = this.Font; if (dlg.ShowDialog(this) == DialogResult.OK) { FreightGateway.AddClientInboundFreight(appointment); Refresh(); } break; case "csOpen": id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); DispatchDataset.ClientInboundScheduleTableRow _freight = (DispatchDataset.ClientInboundScheduleTableRow) this.mSchedule.ClientInboundScheduleTable.Select("ID=" + id)[0]; appointment = new DispatchDataset().ClientInboundScheduleTable.NewClientInboundScheduleTableRow(); appointment.ItemArray = _freight.ItemArray; dlg = new dlgClientInboundFreight(appointment); dlg.Font = this.Font; if (dlg.ShowDialog(this) == DialogResult.OK) { FreightGateway.ChangeClientInboundFreight(appointment); Refresh(); } break; case "csClone": id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); appointment = (DispatchDataset.ClientInboundScheduleTableRow) this.mSchedule.ClientInboundScheduleTable.Select("ID=" + id)[0]; DispatchDataset.ClientInboundScheduleTableRow clone = new DispatchDataset().ClientInboundScheduleTable.NewClientInboundScheduleTableRow(); switch (this.cboSchedule.SelectedItem.ToString()) { case "Today": clone.ScheduleDate = DateTime.Today; break; case "Advanced": clone.ScheduleDate = DateTime.Today.AddDays(1); break; } clone.VendorName = appointment.VendorName; clone.ConsigneeName = appointment.ConsigneeName; clone.ScheduledArrival = clone.ScheduleDate.Date + appointment.ScheduledArrival.TimeOfDay; if (!appointment.IsAmountNull()) { clone.Amount = appointment.Amount; } if (!appointment.IsAmountTypeNull()) { clone.AmountType = appointment.AmountType; } if (!appointment.IsFreightTypeNull()) { clone.FreightType = appointment.FreightType; } if (!appointment.IsCommentsNull()) { clone.Comments = appointment.Comments; } clone.IsTemplate = false; dlg = new dlgClientInboundFreight(clone); dlg.Font = this.Font; if (dlg.ShowDialog(this) == DialogResult.OK) { FreightGateway.AddClientInboundFreight(clone); Refresh(); } break; case "csCancel": Cancel(); break; case "csRefresh": Refresh(); break; case "csTempNew": appointment = new DispatchDataset().ClientInboundScheduleTable.NewClientInboundScheduleTableRow(); appointment.ConsigneeName = "ARGIX LOGISTICS NATIONAL"; appointment.IsTemplate = true; dlg = new dlgClientInboundFreight(appointment, true); dlg.Font = this.Font; if (dlg.ShowDialog(this) == DialogResult.OK) { FreightGateway.AddClientInboundFreight(appointment); Refresh(); } break; case "csTempOpen": id = Convert.ToInt32(this.grdTemplates.ActiveRow.Cells["ID"].Value); DispatchDataset.ClientInboundScheduleTableRow _template = (DispatchDataset.ClientInboundScheduleTableRow) this.mTemplates.ClientInboundScheduleTable.Select("ID=" + id)[0]; appointment = new DispatchDataset().ClientInboundScheduleTable.NewClientInboundScheduleTableRow(); appointment.ItemArray = _template.ItemArray; dlg = new dlgClientInboundFreight(appointment, true); dlg.Font = this.Font; if (dlg.ShowDialog(this) == DialogResult.OK) { FreightGateway.ChangeClientInboundFreight(appointment); Refresh(); } break; case "csTempCancel": id = Convert.ToInt32(this.grdTemplates.ActiveRow.Cells["ID"].Value); if (MessageBox.Show(this, "Are you sure you want to cancel appointment template " + id.ToString() + "?", App.Product, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { FreightGateway.CancelClientInboundFreight(id, DateTime.Now, Environment.UserName); Refresh(); } break; case "csTempLoad": for (int i = 0; i < this.mTemplates.ClientInboundScheduleTable.Rows.Count; i++) { if (this.mTemplates.ClientInboundScheduleTable[i].Selected == true) { appointment = new DispatchDataset().ClientInboundScheduleTable.NewClientInboundScheduleTableRow(); appointment.ItemArray = this.mTemplates.ClientInboundScheduleTable[i].ItemArray; appointment.CreateUserID = Environment.UserName; appointment.Created = DateTime.Now; switch (this.cboSchedule.SelectedItem.ToString()) { case "Today": appointment.ScheduleDate = DateTime.Today; break; case "Advanced": appointment.ScheduleDate = DateTime.Today.AddDays(1); break; } appointment.ScheduledArrival = appointment.ScheduleDate.Date + appointment.ScheduledArrival.TimeOfDay; appointment.IsTemplate = false; FreightGateway.AddClientInboundFreight(appointment); } } Refresh(); break; case "csTempRefresh": Refresh(); break; } } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); } finally { setUserServices(); this.Cursor = Cursors.Default; } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.txtTDSCreatedBy = new System.Windows.Forms.TextBox(); this._lblTDSCreatedBy = new System.Windows.Forms.Label(); this.txtTDSNumber = new System.Windows.Forms.TextBox(); this._lblTDSNumber = new System.Windows.Forms.Label(); this.chkIsLiveUnload = new System.Windows.Forms.CheckBox(); this._lblSortDate = new System.Windows.Forms.Label(); this.dtpSortDate = new System.Windows.Forms.DateTimePicker(); this.dtpActualArrival = new System.Windows.Forms.DateTimePicker(); this._lblActualArrival = new System.Windows.Forms.Label(); this._lblShipper = new System.Windows.Forms.Label(); this.dtpScheduledArrival = new System.Windows.Forms.DateTimePicker(); this._lblScheduledArrival = new System.Windows.Forms.Label(); this._lblComments = new System.Windows.Forms.Label(); this._lblAmount = new System.Windows.Forms.Label(); this.txtAmount = new System.Windows.Forms.TextBox(); this.cboAmountType = new System.Windows.Forms.ComboBox(); this.txtComments = new System.Windows.Forms.TextBox(); this._lblConsignee = new System.Windows.Forms.Label(); this._lblID = new System.Windows.Forms.Label(); this.btnOk = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); this.lblID = new System.Windows.Forms.Label(); this.dtpScheduleDate = new System.Windows.Forms.DateTimePicker(); this._lblScheduleDate = new System.Windows.Forms.Label(); this.cboShipper = new System.Windows.Forms.ComboBox(); this.mLocations = new Argix.DispatchDataset(); this.cboConsignee = new System.Windows.Forms.ComboBox(); this.mConsignees = new Argix.DispatchDataset(); this.grpDispatch = new System.Windows.Forms.GroupBox(); this.cboDriver = new System.Windows.Forms.ComboBox(); this.mDrivers = new Argix.DispatchDataset(); this.cboCarrier = new System.Windows.Forms.ComboBox(); this.mCarriers = new Argix.DispatchDataset(); this._lblCarrier = new System.Windows.Forms.Label(); this._lblDriver = new System.Windows.Forms.Label(); this.chkConfirmed = new System.Windows.Forms.CheckBox(); this.grpGate = new System.Windows.Forms.GroupBox(); this.txtTrailerNumber = new System.Windows.Forms.TextBox(); this._lblTrailerNumber = new System.Windows.Forms.Label(); this._lblOf = new System.Windows.Forms.Label(); this.cboFreightType = new System.Windows.Forms.ComboBox(); ((System.ComponentModel.ISupportInitialize)(this.mLocations)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.mConsignees)).BeginInit(); this.grpDispatch.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.mDrivers)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.mCarriers)).BeginInit(); this.grpGate.SuspendLayout(); this.SuspendLayout(); // // txtTDSCreatedBy // this.txtTDSCreatedBy.Location = new System.Drawing.Point(90, 83); this.txtTDSCreatedBy.Name = "txtTDSCreatedBy"; this.txtTDSCreatedBy.Size = new System.Drawing.Size(106, 20); this.txtTDSCreatedBy.TabIndex = 2; // // _lblTDSCreatedBy // this._lblTDSCreatedBy.Location = new System.Drawing.Point(5, 83); this._lblTDSCreatedBy.Name = "_lblTDSCreatedBy"; this._lblTDSCreatedBy.Size = new System.Drawing.Size(80, 14); this._lblTDSCreatedBy.TabIndex = 155; this._lblTDSCreatedBy.Text = "TDS By"; this._lblTDSCreatedBy.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // txtTDSNumber // this.txtTDSNumber.Location = new System.Drawing.Point(90, 57); this.txtTDSNumber.Name = "txtTDSNumber"; this.txtTDSNumber.Size = new System.Drawing.Size(106, 20); this.txtTDSNumber.TabIndex = 1; // // _lblTDSNumber // this._lblTDSNumber.Location = new System.Drawing.Point(5, 57); this._lblTDSNumber.Name = "_lblTDSNumber"; this._lblTDSNumber.Size = new System.Drawing.Size(80, 14); this._lblTDSNumber.TabIndex = 153; this._lblTDSNumber.Text = "TDS#"; this._lblTDSNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // chkIsLiveUnload // this.chkIsLiveUnload.Location = new System.Drawing.Point(253, 184); this.chkIsLiveUnload.Name = "chkIsLiveUnload"; this.chkIsLiveUnload.Size = new System.Drawing.Size(106, 15); this.chkIsLiveUnload.TabIndex = 7; this.chkIsLiveUnload.Text = "Live Unload?"; // // _lblSortDate // this._lblSortDate.Location = new System.Drawing.Point(5, 141); this._lblSortDate.Name = "_lblSortDate"; this._lblSortDate.Size = new System.Drawing.Size(100, 14); this._lblSortDate.TabIndex = 150; this._lblSortDate.Text = "Sort Date"; this._lblSortDate.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // dtpSortDate // this.dtpSortDate.Checked = false; this.dtpSortDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; this.dtpSortDate.Location = new System.Drawing.Point(110, 141); this.dtpSortDate.Name = "dtpSortDate"; this.dtpSortDate.ShowCheckBox = true; this.dtpSortDate.Size = new System.Drawing.Size(125, 20); this.dtpSortDate.TabIndex = 6; // // dtpActualArrival // this.dtpActualArrival.Checked = false; this.dtpActualArrival.CustomFormat = "hh:mm tt"; this.dtpActualArrival.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dtpActualArrival.Location = new System.Drawing.Point(91, 25); this.dtpActualArrival.Name = "dtpActualArrival"; this.dtpActualArrival.ShowCheckBox = true; this.dtpActualArrival.ShowUpDown = true; this.dtpActualArrival.Size = new System.Drawing.Size(100, 20); this.dtpActualArrival.TabIndex = 0; // // _lblActualArrival // this._lblActualArrival.Location = new System.Drawing.Point(5, 25); this._lblActualArrival.Name = "_lblActualArrival"; this._lblActualArrival.Size = new System.Drawing.Size(80, 16); this._lblActualArrival.TabIndex = 148; this._lblActualArrival.Text = "Actual Arrival"; this._lblActualArrival.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblShipper // this._lblShipper.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._lblShipper.Location = new System.Drawing.Point(5, 51); this._lblShipper.Name = "_lblShipper"; this._lblShipper.Size = new System.Drawing.Size(100, 16); this._lblShipper.TabIndex = 142; this._lblShipper.Text = "Shipper"; this._lblShipper.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // dtpScheduledArrival // this.dtpScheduledArrival.Checked = false; this.dtpScheduledArrival.CustomFormat = "hh:mm tt"; this.dtpScheduledArrival.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dtpScheduledArrival.Location = new System.Drawing.Point(110, 182); this.dtpScheduledArrival.Name = "dtpScheduledArrival"; this.dtpScheduledArrival.ShowUpDown = true; this.dtpScheduledArrival.Size = new System.Drawing.Size(100, 20); this.dtpScheduledArrival.TabIndex = 8; this.dtpScheduledArrival.ValueChanged += new System.EventHandler(this.OnValidateForm); // // _lblScheduledArrival // this._lblScheduledArrival.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._lblScheduledArrival.Location = new System.Drawing.Point(5, 182); this._lblScheduledArrival.Name = "_lblScheduledArrival"; this._lblScheduledArrival.Size = new System.Drawing.Size(100, 16); this._lblScheduledArrival.TabIndex = 131; this._lblScheduledArrival.Text = "Sched Arrival"; this._lblScheduledArrival.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblComments // this._lblComments.Location = new System.Drawing.Point(5, 240); this._lblComments.Name = "_lblComments"; this._lblComments.Size = new System.Drawing.Size(100, 15); this._lblComments.TabIndex = 129; this._lblComments.Text = "Comments"; this._lblComments.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblAmount // this._lblAmount.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._lblAmount.Location = new System.Drawing.Point(5, 111); this._lblAmount.Name = "_lblAmount"; this._lblAmount.Size = new System.Drawing.Size(100, 15); this._lblAmount.TabIndex = 125; this._lblAmount.Text = "Amount"; this._lblAmount.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // txtAmount // this.txtAmount.Location = new System.Drawing.Point(110, 109); this.txtAmount.Name = "txtAmount"; this.txtAmount.Size = new System.Drawing.Size(40, 20); this.txtAmount.TabIndex = 4; this.txtAmount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.txtAmount.TextChanged += new System.EventHandler(this.OnValidateForm); // // cboAmountType // this.cboAmountType.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; this.cboAmountType.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboAmountType.Items.AddRange(new object[] { "Cartons", "Mixed", "Pallets", "Trailer" }); this.cboAmountType.Location = new System.Drawing.Point(155, 109); this.cboAmountType.MaxDropDownItems = 5; this.cboAmountType.Name = "cboAmountType"; this.cboAmountType.Size = new System.Drawing.Size(75, 21); this.cboAmountType.TabIndex = 5; this.cboAmountType.TextChanged += new System.EventHandler(this.OnValidateForm); // // txtComments // this.txtComments.Location = new System.Drawing.Point(110, 240); this.txtComments.Name = "txtComments"; this.txtComments.Size = new System.Drawing.Size(250, 20); this.txtComments.TabIndex = 10; this.txtComments.TextChanged += new System.EventHandler(this.OnValidateForm); // // _lblConsignee // this._lblConsignee.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._lblConsignee.Location = new System.Drawing.Point(5, 77); this._lblConsignee.Name = "_lblConsignee"; this._lblConsignee.Size = new System.Drawing.Size(100, 16); this._lblConsignee.TabIndex = 126; this._lblConsignee.Text = "Consignee"; this._lblConsignee.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblID // this._lblID.Location = new System.Drawing.Point(521, 17); this._lblID.Name = "_lblID"; this._lblID.Size = new System.Drawing.Size(100, 15); this._lblID.TabIndex = 122; this._lblID.Text = "Appt#"; this._lblID.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // btnOk // this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnOk.Location = new System.Drawing.Point(540, 290); this.btnOk.Name = "btnOk"; this.btnOk.Size = new System.Drawing.Size(96, 24); this.btnOk.TabIndex = 13; this.btnOk.Text = "&Ok"; this.btnOk.UseVisualStyleBackColor = true; this.btnOk.Click += new System.EventHandler(this.OnCommandClick); // // btnCancel // this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.Location = new System.Drawing.Point(642, 290); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(96, 24); this.btnCancel.TabIndex = 0; this.btnCancel.Text = "&Cancel"; this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.Click += new System.EventHandler(this.OnCommandClick); // // lblID // this.lblID.Location = new System.Drawing.Point(627, 17); this.lblID.Name = "lblID"; this.lblID.Size = new System.Drawing.Size(100, 16); this.lblID.TabIndex = 143; this.lblID.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // dtpScheduleDate // this.dtpScheduleDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; this.dtpScheduleDate.Location = new System.Drawing.Point(110, 17); this.dtpScheduleDate.Name = "dtpScheduleDate"; this.dtpScheduleDate.Size = new System.Drawing.Size(100, 20); this.dtpScheduleDate.TabIndex = 1; this.dtpScheduleDate.ValueChanged += new System.EventHandler(this.OnScheduleDateChanged); // // _lblScheduleDate // this._lblScheduleDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._lblScheduleDate.Location = new System.Drawing.Point(5, 17); this._lblScheduleDate.Name = "_lblScheduleDate"; this._lblScheduleDate.Size = new System.Drawing.Size(100, 15); this._lblScheduleDate.TabIndex = 169; this._lblScheduleDate.Text = "Schedule Date"; this._lblScheduleDate.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // cboShipper // this.cboShipper.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; this.cboShipper.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboShipper.DataSource = this.mLocations; this.cboShipper.DisplayMember = "LocationTable.Name"; this.cboShipper.Location = new System.Drawing.Point(110, 51); this.cboShipper.Name = "cboShipper"; this.cboShipper.Size = new System.Drawing.Size(250, 21); this.cboShipper.TabIndex = 2; this.cboShipper.ValueMember = "LocationTable.Name"; this.cboShipper.TextChanged += new System.EventHandler(this.OnValidateForm); // // mLocations // this.mLocations.DataSetName = "DispatchDataset"; this.mLocations.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // cboConsignee // this.cboConsignee.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; this.cboConsignee.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboConsignee.DataSource = this.mConsignees; this.cboConsignee.DisplayMember = "LocationTable.Name"; this.cboConsignee.Location = new System.Drawing.Point(110, 77); this.cboConsignee.Name = "cboConsignee"; this.cboConsignee.Size = new System.Drawing.Size(250, 21); this.cboConsignee.TabIndex = 3; this.cboConsignee.ValueMember = "LocationTable.Name"; this.cboConsignee.TextChanged += new System.EventHandler(this.OnValidateForm); // // mConsignees // this.mConsignees.DataSetName = "DispatchDataset"; this.mConsignees.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // grpDispatch // this.grpDispatch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.grpDispatch.Controls.Add(this.cboDriver); this.grpDispatch.Controls.Add(this.cboCarrier); this.grpDispatch.Controls.Add(this._lblCarrier); this.grpDispatch.Controls.Add(this._lblDriver); this.grpDispatch.Controls.Add(this.chkConfirmed); this.grpDispatch.Location = new System.Drawing.Point(396, 51); this.grpDispatch.Name = "grpDispatch"; this.grpDispatch.Size = new System.Drawing.Size(342, 100); this.grpDispatch.TabIndex = 11; this.grpDispatch.TabStop = false; this.grpDispatch.Text = "Dispatch"; // // cboDriver // this.cboDriver.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cboDriver.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; this.cboDriver.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboDriver.DataSource = this.mDrivers; this.cboDriver.DisplayMember = "DriverTable.Description"; this.cboDriver.FormattingEnabled = true; this.cboDriver.Location = new System.Drawing.Point(90, 51); this.cboDriver.Name = "cboDriver"; this.cboDriver.Size = new System.Drawing.Size(241, 21); this.cboDriver.TabIndex = 2; this.cboDriver.ValueMember = "DriverTable.Description"; // // mDrivers // this.mDrivers.DataSetName = "DispatchDataset"; this.mDrivers.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // cboCarrier // this.cboCarrier.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cboCarrier.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; this.cboCarrier.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboCarrier.DataSource = this.mCarriers; this.cboCarrier.DisplayMember = "CarrierTable.Description"; this.cboCarrier.FormattingEnabled = true; this.cboCarrier.Location = new System.Drawing.Point(90, 25); this.cboCarrier.Name = "cboCarrier"; this.cboCarrier.Size = new System.Drawing.Size(241, 21); this.cboCarrier.TabIndex = 0; this.cboCarrier.ValueMember = "CarrierTable.Description"; // // mCarriers // this.mCarriers.DataSetName = "DispatchDataset"; this.mCarriers.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // _lblCarrier // this._lblCarrier.Location = new System.Drawing.Point(5, 25); this._lblCarrier.Name = "_lblCarrier"; this._lblCarrier.Size = new System.Drawing.Size(80, 16); this._lblCarrier.TabIndex = 148; this._lblCarrier.Text = "Carrier"; this._lblCarrier.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblDriver // this._lblDriver.Location = new System.Drawing.Point(5, 51); this._lblDriver.Name = "_lblDriver"; this._lblDriver.Size = new System.Drawing.Size(80, 16); this._lblDriver.TabIndex = 137; this._lblDriver.Text = "Driver"; this._lblDriver.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // chkConfirmed // this.chkConfirmed.Location = new System.Drawing.Point(90, 77); this.chkConfirmed.Name = "chkConfirmed"; this.chkConfirmed.Size = new System.Drawing.Size(80, 16); this.chkConfirmed.TabIndex = 4; this.chkConfirmed.Text = "Confirmed?"; // // grpGate // this.grpGate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.grpGate.Controls.Add(this.dtpActualArrival); this.grpGate.Controls.Add(this._lblActualArrival); this.grpGate.Controls.Add(this.txtTDSNumber); this.grpGate.Controls.Add(this.txtTDSCreatedBy); this.grpGate.Controls.Add(this._lblTDSNumber); this.grpGate.Controls.Add(this._lblTDSCreatedBy); this.grpGate.Location = new System.Drawing.Point(396, 157); this.grpGate.Name = "grpGate"; this.grpGate.Size = new System.Drawing.Size(342, 109); this.grpGate.TabIndex = 12; this.grpGate.TabStop = false; this.grpGate.Text = "Arrival"; // // txtTrailerNumber // this.txtTrailerNumber.Location = new System.Drawing.Point(110, 214); this.txtTrailerNumber.Name = "txtTrailerNumber"; this.txtTrailerNumber.Size = new System.Drawing.Size(100, 20); this.txtTrailerNumber.TabIndex = 9; // // _lblTrailerNumber // this._lblTrailerNumber.Location = new System.Drawing.Point(5, 214); this._lblTrailerNumber.Name = "_lblTrailerNumber"; this._lblTrailerNumber.Size = new System.Drawing.Size(100, 15); this._lblTrailerNumber.TabIndex = 176; this._lblTrailerNumber.Text = "Trailer#"; this._lblTrailerNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // _lblOf // this._lblOf.Location = new System.Drawing.Point(241, 109); this._lblOf.Name = "_lblOf"; this._lblOf.Size = new System.Drawing.Size(20, 18); this._lblOf.TabIndex = 177; this._lblOf.Text = "of"; this._lblOf.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // cboFreightType // this.cboFreightType.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; this.cboFreightType.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.cboFreightType.Items.AddRange(new object[] { "ISA", "BBB-PCS", "Tsort" }); this.cboFreightType.Location = new System.Drawing.Point(270, 109); this.cboFreightType.MaxDropDownItems = 5; this.cboFreightType.Name = "cboFreightType"; this.cboFreightType.Size = new System.Drawing.Size(90, 21); this.cboFreightType.TabIndex = 202; this.cboFreightType.TextChanged += new System.EventHandler(this.OnValidateForm); // // dlgClientInboundFreight // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(744, 322); this.Controls.Add(this.cboFreightType); this.Controls.Add(this._lblOf); this.Controls.Add(this.txtTrailerNumber); this.Controls.Add(this._lblTrailerNumber); this.Controls.Add(this.grpGate); this.Controls.Add(this.grpDispatch); this.Controls.Add(this.cboConsignee); this.Controls.Add(this.dtpSortDate); this.Controls.Add(this.cboShipper); this.Controls.Add(this._lblSortDate); this.Controls.Add(this.dtpScheduleDate); this.Controls.Add(this._lblScheduleDate); this.Controls.Add(this.lblID); this.Controls.Add(this.btnOk); this.Controls.Add(this.chkIsLiveUnload); this.Controls.Add(this.btnCancel); this.Controls.Add(this._lblID); this.Controls.Add(this._lblConsignee); this.Controls.Add(this._lblShipper); this.Controls.Add(this.txtComments); this.Controls.Add(this.cboAmountType); this.Controls.Add(this.dtpScheduledArrival); this.Controls.Add(this.txtAmount); this.Controls.Add(this._lblScheduledArrival); this.Controls.Add(this._lblAmount); this.Controls.Add(this._lblComments); this.Cursor = System.Windows.Forms.Cursors.Default; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "dlgClientInboundFreight"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Client Inbound Freight"; this.Load += new System.EventHandler(this.OnFormLoad); ((System.ComponentModel.ISupportInitialize)(this.mLocations)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.mConsignees)).EndInit(); this.grpDispatch.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.mDrivers)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.mCarriers)).EndInit(); this.grpGate.ResumeLayout(false); this.grpGate.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
private void OnItemClick(object sender, System.EventArgs e) { dlgTrailerEntry dlg = null; DispatchDataset.TrailerLogTableRow entry = null; int id = 0; try { ToolStripItem item = (ToolStripItem)sender; switch (item.Name) { case "csNew": entry = new DispatchDataset().TrailerLogTable.NewTrailerLogTableRow(); entry.ScheduleDate = DateTime.Today; entry.InboundDate = DateTime.Now; entry.IsTemplate = false; dlg = new dlgTrailerEntry(entry); dlg.Font = this.Font; if (dlg.ShowDialog(this) == DialogResult.OK) { FreightGateway.AddTrailerEntry(entry); Refresh(); } break; case "csOpen": id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); DispatchDataset.TrailerLogTableRow _entry = (DispatchDataset.TrailerLogTableRow) this.mSchedule.TrailerLogTable.Select("ID=" + id)[0]; entry = new DispatchDataset().TrailerLogTable.NewTrailerLogTableRow(); entry.ItemArray = _entry.ItemArray; dlg = new dlgTrailerEntry(entry); dlg.Font = this.Font; if (dlg.ShowDialog(this) == DialogResult.OK) { FreightGateway.ChangeTrailerEntry(entry); Refresh(); } break; case "csClone": id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); entry = (DispatchDataset.TrailerLogTableRow) this.mSchedule.TrailerLogTable.Select("ID=" + id)[0]; DispatchDataset.TrailerLogTableRow clone = new DispatchDataset().TrailerLogTable.NewTrailerLogTableRow(); entry.ScheduleDate = DateTime.Today; entry.InboundDate = DateTime.Now; if (!entry.IsInboundCarrierNull()) { clone.InboundCarrier = entry.InboundCarrier; } if (!entry.IsInboundDriverNameNull()) { clone.InboundDriverName = entry.InboundDriverName; } if (!entry.IsCommentsNull()) { clone.Comments = entry.Comments; } dlg = new dlgTrailerEntry(clone); dlg.Font = this.Font; if (dlg.ShowDialog(this) == DialogResult.OK) { FreightGateway.AddTrailerEntry(clone); Refresh(); } break; case "csCancel": id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); FreightGateway.CancelTrailerEntry(id, DateTime.Now, Environment.UserName); Refresh(); break; case "csRefresh": Refresh(); break; case "csTempNew": break; case "csTempOpen": break; case "csTempLoad": break; case "csTempRefresh": break; } } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Error); } finally { setUserServices(); this.Cursor = Cursors.Default; } }