コード例 #1
0
ファイル: DataManager.cs プロジェクト: rymbln/Spec_Soft
 public int AddPaymentType(PaymentType obj)
 {
     obj.DateUpdate = DateTime.Now;
     obj.DateAdd = DateTime.Now;
     obj.Suser = System.Web.Security.Membership.GetUser().ToString();
     db.PaymentTypes.AddObject(obj);
     db.SaveChanges();
     return (obj.PaymentTypeID);
 }
コード例 #2
0
ファイル: DataManager.cs プロジェクト: rymbln/Spec_Soft
 public dbActionResult EditPaymentType(PaymentType obj)
 {
     try
     {
         obj.DateUpdate = DateTime.Now;
         obj.Suser = System.Web.Security.Membership.GetUser().ToString();
         db.PaymentTypes.Attach(obj);
         db.ObjectStateManager.ChangeObjectState(obj, EntityState.Modified);
         db.SaveChanges();
         dbActionResult returnObj = new dbActionResult();
         returnObj.intResult = obj.PaymentTypeID;
         returnObj.exConcur = null;
         returnObj.exData = null;
         return (returnObj);
     }
     catch (OptimisticConcurrencyException ex)
     {
         dbActionResult returnObj = new dbActionResult();
         returnObj.intResult = -1;
         returnObj.exConcur = ex;
         returnObj.exData = null;
         return (returnObj);
     }
     catch (DataException ex)
     {
         dbActionResult returnObj = new dbActionResult();
         returnObj.intResult = -2;
         returnObj.exConcur = null;
         returnObj.exData = ex;
         return (returnObj);
     }
 }
コード例 #3
0
 /// <summary>
 /// Create a new PaymentType object.
 /// </summary>
 /// <param name="paymentTypeID">Initial value of the PaymentTypeID property.</param>
 public static PaymentType CreatePaymentType(global::System.Int32 paymentTypeID)
 {
     PaymentType paymentType = new PaymentType();
     paymentType.PaymentTypeID = paymentTypeID;
     return paymentType;
 }
コード例 #4
0
ファイル: DataManager.cs プロジェクト: rymbln/Spec_Soft
 public void DetachPaymentType(PaymentType obj)
 {
     db.PaymentTypes.Detach(obj);
 }
コード例 #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the PaymentTypes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPaymentTypes(PaymentType paymentType)
 {
     base.AddObject("PaymentTypes", paymentType);
 }