/// <summary> /// Handles the Click event of the m_ButtonAddNew control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void m_ButtonAddNew_Click(object sender, EventArgs e) { try { Shipping _shpppng = CurrentShipping; if (m_Shipping == null) { return; } //if ( m_ExternalCheckBox.Checked && CurrentShipping.PartnerTitle == null ) //{ // m_ExternalCheckBox.Checked = false; // //TODO must be localized http://cas_sp:11225/sites/awt/Lists/TaskList/DispForm.aspx?ID=3842 // Parent.Controls.Add( GlobalDefinitions.ErrorLiteralControl( "Partner not set only internal messages allowed." ) ); // return; //} ShippingComments _new = new ShippingComments() { Body = m_ShippingCommentsTextBox.Text, //ExternalComment = m_ExternalCheckBox.Checked && CurrentShipping.PartnerTitle != null, ShippingComments2PartnerTitle = CurrentShipping.PartnerTitle, ShippingComments2ShippingID = CurrentShipping, }; EDC.Comments.InsertOnSubmit(_new); EDC.SubmitChanges(); m_ShippingCommentsTextBox.Text = String.Empty; } catch (Exception ex) { Parent.Controls.Add(GlobalDefinitions.ErrorLiteralControl(ex.Message)); Anons.WriteEntry(EDC, "m_ShippingCommentsTextBox_TextChanged", ex.Message); } }
private void ShowActionResult(LocalStateMachineEngine.ActionResult _rslt) { if (_rslt.ActionSucceeded) { return; } this.Controls.Add(GlobalDefinitions.ErrorLiteralControl(_rslt.ActionException.Message)); }
private StateMachineEngine.ActionResult AddValidationMessages(List <string> _ve) { if (_ve.Count == 0) { return(StateMachineEngine.ActionResult.Success); } foreach (string item in _ve) { this.Controls.Add(GlobalDefinitions.ErrorLiteralControl(item)); } return(StateMachineEngine.ActionResult.NotValidated); }
private void ShowActionResult(GenericStateMachineEngine.ActionResult _rslt) { if (_rslt.LastActionResult == GenericStateMachineEngine.ActionResult.Result.Success) { return; } if (_rslt.LastActionResult == GenericStateMachineEngine.ActionResult.Result.Exception) { #if DEBUG string _format = CommonDefinitions.Convert2ErrorMessageFormat("Exception at: {0}/{1} of : {2}."); this.Controls.Add(GlobalDefinitions.ErrorLiteralControl(String.Format(_format, _rslt.ActionException.Source, At, _rslt.ActionException.Message))); #endif Anons.WriteEntry(EDC, _rslt.ActionException.Source, _rslt.ActionException.Message); } else { string _format = CommonDefinitions.Convert2ErrorMessageFormat("Validation error at: {0}/{1} of : {2}."); this.Controls.Add(GlobalDefinitions.ErrorLiteralControl(String.Format(_format, _rslt.ActionException.Source, At, _rslt.ActionException.Message))); } }
private void ExceptionCatched(string source, string message) { Anons.WriteEntry(EDC, source, message); this.Controls.Add(GlobalDefinitions.ErrorLiteralControl(message)); }
protected override void SMError(StateMachineEngine.InterfaceEvent _interfaceEvent) { Parent.Controls.Add(GlobalDefinitions.ErrorLiteralControl(String.Format("State machine error, in {0} the event {1} occured", Parent.m_ControlState.InterfaceState.ToString(), _interfaceEvent.ToString()))); }