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); }
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); } }
/// <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; }
public void DetachPaymentType(PaymentType obj) { db.PaymentTypes.Detach(obj); }
/// <summary> /// Deprecated Method for adding a new object to the PaymentTypes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToPaymentTypes(PaymentType paymentType) { base.AddObject("PaymentTypes", paymentType); }