/// <summary>
 /// Create a new ReturnReason object.
 /// </summary>
 /// <param name="code">Initial value of the Code property.</param>
 public static ReturnReason CreateReturnReason(global::System.Int32 code)
 {
     ReturnReason returnReason = new ReturnReason();
     returnReason.Code = code;
     return returnReason;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the ReturnReasons EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToReturnReasons(ReturnReason returnReason)
 {
     base.AddObject("ReturnReasons", returnReason);
 }
 public override bool CanAccept(object parameter)
 {
     if(string.IsNullOrWhiteSpace(ReturnReasonName))
     {
         return false;
     }
     string name = ReturnReasonName.Trim();
     ReturnReason = BusinessContext.Instance.Model.ReturnReasons.FirstOrDefault(r => r.Name == name);
     if(ReturnReason == null)
     {
         ReturnReason = new ReturnReason(Terminal.Instance.Code) {Name = name};
     }
     return base.CanAccept(parameter);
 }