public void AddNewSalesReason(SalesReason reason)
 {
     if (SalesOrderHeaderSalesReason.All(y => y.SalesReason != reason))
     {
         var link = Container.NewTransientInstance <SalesOrderHeaderSalesReason>();
         link.SalesOrderHeader = this;
         link.SalesReason      = reason;
         Container.Persist(ref link);
         SalesOrderHeaderSalesReason.Add(link);
     }
     else
     {
         Container.WarnUser(string.Format("{0} already exists in Sales Reasons", reason.Name));
     }
 }
 public string ValidateAddNewSalesReason(SalesReason reason) {
     return SalesOrderHeaderSalesReason.Any(y => y.SalesReason == reason) ? string.Format("{0} already exists in Sales Reasons", reason.Name) : null;
 }
 public void AddNewSalesReason(SalesReason reason) {
     if (SalesOrderHeaderSalesReason.All(y => y.SalesReason != reason)) {
         var link = Container.NewTransientInstance<SalesOrderHeaderSalesReason>();
         link.SalesOrderHeader = this;
         link.SalesReason = reason;
         Container.Persist(ref link);
         SalesOrderHeaderSalesReason.Add(link);
     }
     else {
         Container.WarnUser(string.Format("{0} already exists in Sales Reasons", reason.Name));
     }
 }
        public void TestAction(SalesReason reason)
        {

        }
 public void TestAction(SalesReason reason)
 {
 }
 public string ValidateAddNewSalesReason(SalesReason reason)
 {
     return(SalesOrderHeaderSalesReason.Any(y => y.SalesReason == reason) ? string.Format("{0} already exists in Sales Reasons", reason.Name) : null);
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the SalesReasons EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSalesReasons(SalesReason salesReason)
 {
     base.AddObject("SalesReasons", salesReason);
 }
 /// <summary>
 /// Create a new SalesReason object.
 /// </summary>
 /// <param name="salesReasonID">Initial value of the SalesReasonID property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="reasonType">Initial value of the ReasonType property.</param>
 /// <param name="modifiedDate">Initial value of the ModifiedDate property.</param>
 public static SalesReason CreateSalesReason(global::System.Int32 salesReasonID, global::System.String name, global::System.String reasonType, global::System.DateTime modifiedDate)
 {
     SalesReason salesReason = new SalesReason();
     salesReason.SalesReasonID = salesReasonID;
     salesReason.Name = name;
     salesReason.ReasonType = reasonType;
     salesReason.ModifiedDate = modifiedDate;
     return salesReason;
 }