/// <summary> /// Saves the Linear event properties. /// </summary> /// <returns>save the LinearEvent Properties</returns> private bool SaveLinearEventProperties() { try { this.Cursor = Cursors.WaitCursor; LinearEventData linearEventData = new LinearEventData(); LinearEventData.SaveFSLinearEventTypeRow dr = linearEventData.SaveFSLinearEventType.NewSaveFSLinearEventTypeRow(); dr.EventID = this.keyId; dr.Start = Convert.ToDecimal(this.StartTextBox.Text); dr.StartLabel = this.StartLabelTextBox.Text; dr.End = Convert.ToDecimal(this.EndTextBox.Text); dr.EndLabel = this.EndLabelTextBox.Text; dr.Comment = this.CommentTextBox.Text; linearEventData.SaveFSLinearEventType.Rows.Add(dr); DataSet tempDataSet = new DataSet("Root"); tempDataSet.Tables.Add(linearEventData.SaveFSLinearEventType.Copy()); tempDataSet.Tables[0].TableName = "Table"; this.form8052Control.WorkItem.SaveLinearEventType(tempDataSet.GetXml(), TerraScanCommon.UserId); return(true); } catch (Exception ex) { ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm); return(false); } finally { this.Cursor = Cursors.Default; } }
/// <summary> /// Gets the Linear Event Properties /// </summary> /// <param name="eventId">The event id.</param> /// <returns>returns dataset contains Linear Event Properties</returns> public static LinearEventData GetLinearEventType(int eventId) { LinearEventData linearEventData = new LinearEventData(); Hashtable ht = new Hashtable(); ht.Add("@EventID", eventId); Utility.LoadDataSet(linearEventData.GetFSLinearEventType, "f8052_pcget_FSLinearEventType", ht); return(linearEventData); }
/// <summary> /// Gets the linear event properties. /// </summary> /// <param name="eventId">The event id.</param> private void GetLinearEventProperties(int eventId) { this.Cursor = Cursors.WaitCursor; decimal startValue; decimal endValue; decimal result; try { this.linearEventTypeDataSet = this.form8052Control.WorkItem.GetLinearEventType(eventId); if (this.linearEventTypeDataSet.GetFSLinearEventType.Rows.Count > 0) { this.StartTextBox.Text = this.linearEventTypeDataSet.GetFSLinearEventType.Rows[0][this.linearEventTypeDataSet.GetFSLinearEventType.StartColumn].ToString(); this.StartLabelTextBox.Text = this.linearEventTypeDataSet.GetFSLinearEventType.Rows[0][this.linearEventTypeDataSet.GetFSLinearEventType.StartLabelColumn].ToString(); this.EndTextBox.Text = this.linearEventTypeDataSet.GetFSLinearEventType.Rows[0][this.linearEventTypeDataSet.GetFSLinearEventType.EndColumn].ToString(); this.EndLabelTextBox.Text = this.linearEventTypeDataSet.GetFSLinearEventType.Rows[0][this.linearEventTypeDataSet.GetFSLinearEventType.EndLabelColumn].ToString(); this.DistTextBox.Text = this.linearEventTypeDataSet.GetFSLinearEventType.Rows[0][this.linearEventTypeDataSet.GetFSLinearEventType.DistColumn].ToString(); this.CommentTextBox.Text = this.linearEventTypeDataSet.GetFSLinearEventType.Rows[0][this.linearEventTypeDataSet.GetFSLinearEventType.CommentColumn].ToString(); if (string.IsNullOrEmpty(this.linearEventTypeDataSet.GetFSLinearEventType.Rows[0][this.linearEventTypeDataSet.GetFSLinearEventType.LengthColumn].ToString())) { this.Line1RightEndLabel.Text = "0"; } else { this.Line1RightEndLabel.Text = this.linearEventTypeDataSet.GetFSLinearEventType.Rows[0][this.linearEventTypeDataSet.GetFSLinearEventType.LengthColumn].ToString(); decimal.TryParse(this.StartTextBox.Text, out startValue); decimal.TryParse(this.EndTextBox.Text, out endValue); //startValue = this.StartTextBox.Text; //endValue = this.EndTextBox.Text; result = endValue - startValue; if (result == 1) { this.Line1RightEndLabel.Location = new System.Drawing.Point(740, 74); } else { this.Line1RightEndLabel.Location = new System.Drawing.Point(736, 74); } //this.InputFileDetailPictureBox.Location = new System.Drawing.Point(370, 0); } this.Line1LeftEndLabel.Text = "0"; this.Line2LeftEndLabel.Text = this.StartTextBox.Text; this.Line2RightEndLabel.Text = this.EndTextBox.Text; this.SealCoatLabel.Text = this.linearEventTypeDataSet.GetFSLinearEventType.Rows[0][this.linearEventTypeDataSet.GetFSLinearEventType.EventTypeColumn].ToString(); } else { this.LinearEventPanel.Enabled = false; this.Line2Visibility(false); } // Issue Fix - Line2 Visible when Start = End = 0 // -- Starts Here Minor Change decimal startPoint; decimal endPoint; Decimal.TryParse(this.StartTextBox.Text, out startPoint); startPoint = decimal.Floor(startPoint); Decimal.TryParse(this.EndTextBox.Text, out endPoint); endPoint = decimal.Floor(endPoint); if (string.IsNullOrEmpty(this.StartTextBox.Text) || string.IsNullOrEmpty(this.EndTextBox.Text) || string.IsNullOrEmpty(this.Line1RightEndLabel.Text)) { this.Line2Visibility(false); } else if ((startPoint = endPoint) == 0) { this.Line2Visibility(false); } else if (Convert.ToDecimal(this.StartTextBox.Text) == Convert.ToDecimal(this.EndTextBox.Text)) { ////this.Line2LeftEndLabel.Visible = true; ////this.Line2RightEndLabel.Visible = true; ////this.SealCoatLabel.Visible = true; ////this.Line2Panel.Visible = true; ////this.Line2EndLabel.Visible = true; ////this.Line2StartLabel.Visible = true; ////this.pictureBox3.Visible = true; ////this.pictureBox1.Visible = false; this.Line2Visibility(true); this.pictureBox1.Visible = false; } else { this.Line2Visibility(true); } //-- Ends Here } catch (Exception ex) { ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm); } finally { this.Cursor = Cursors.Default; } }