コード例 #1
0
    protected void Payment()
    {
        //PaymentDue
        int y = int.Parse(GetAdID().ToString());
        int AdGeneralID = GetAdGeneralAdID();
        Guid userid = Guid.Parse(GetUserID().ToString());
        var context = new AdDatabaseModel.AdDatabaseEntities();
        AdDatabaseModel.AdvertiserPaymentDue updatepayment =
            (from ad in context.AdvertiserPaymentDues where ad.AdID == AdGeneralID && ad.AdvertiserID == userid select ad).FirstOrDefault();

        if (updatepayment == null)
        {
            var advertiserPaymentDue = new AdDatabaseModel.AdvertiserPaymentDue
            {
                AdvertiserID = GetUserID(),
                PaymentDueID = Admanagment.Helpers.Utility.GetPaymentID(),
                AdID = AdGeneralID,
                AdAmount = PaymentDue(),
                Date = DateTime.Now.Date,
                CurrencyCode = "USA",
                PaymentDue = PaymentDue(),
                Status = Resources.Resource.Pending.ToString(CultureInfo.InvariantCulture),
                PaymentProcess = false
            };
            context.AddToAdvertiserPaymentDues(advertiserPaymentDue);
            context.SaveChanges();
        }else
        {
             updatepayment.Date = DateTime.Now.Date;
            updatepayment.AdAmount = PaymentDue();
            updatepayment.PaymentDue = PaymentDue();
         context.SaveChanges();
        }
    }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the AdvertiserPaymentDues EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToAdvertiserPaymentDues(AdvertiserPaymentDue advertiserPaymentDue)
 {
     base.AddObject("AdvertiserPaymentDues", advertiserPaymentDue);
 }
コード例 #3
0
 protected void Payment()
 {
     //PaymentDue
     var context = new AdDatabaseModel.AdDatabaseEntities();
     var advertiserPaymentDue = new AdDatabaseModel.AdvertiserPaymentDue
     {
         AdvertiserID = GetUserID(),
         PaymentDueID = Admanagment.Helpers.Utility.GetPaymentID(),
         AdID = GetTempAdID(),
         AdAmount = PaymentDue(),
         Date = DateTime.Now.Date,
         CurrencyCode = "USA",
         PaymentDue = PaymentDue()
     };
     context.AddToAdvertiserPaymentDues(advertiserPaymentDue);
     context.SaveChanges();
 }
コード例 #4
0
 /// <summary>
 /// Create a new AdvertiserPaymentDue object.
 /// </summary>
 /// <param name="paymentDueID">Initial value of the PaymentDueID property.</param>
 /// <param name="adID">Initial value of the AdID property.</param>
 /// <param name="adAmount">Initial value of the AdAmount property.</param>
 /// <param name="date">Initial value of the Date property.</param>
 /// <param name="currencyCode">Initial value of the CurrencyCode property.</param>
 /// <param name="paymentDue">Initial value of the PaymentDue property.</param>
 public static AdvertiserPaymentDue CreateAdvertiserPaymentDue(global::System.Int32 paymentDueID, global::System.Int32 adID, global::System.Double adAmount, global::System.DateTime date, global::System.String currencyCode, global::System.Double paymentDue)
 {
     AdvertiserPaymentDue advertiserPaymentDue = new AdvertiserPaymentDue();
     advertiserPaymentDue.PaymentDueID = paymentDueID;
     advertiserPaymentDue.AdID = adID;
     advertiserPaymentDue.AdAmount = adAmount;
     advertiserPaymentDue.Date = date;
     advertiserPaymentDue.CurrencyCode = currencyCode;
     advertiserPaymentDue.PaymentDue = paymentDue;
     return advertiserPaymentDue;
 }
コード例 #5
0
    protected void Payment()
    {
        //PaymentDue
        int y = int.Parse(GetAdID().ToString());
        Guid userid = Guid.Parse(GetUserID().ToString());
        var context = new AdDatabaseModel.AdDatabaseEntities();
        AdDatabaseModel.AdvertiserPaymentDue updatepayment =
            (from ad in context.AdvertiserPaymentDues where ad.AdID == y && ad.AdvertiserID == userid select ad).FirstOrDefault();

        if (updatepayment == null)
        {
            var advertiserPaymentDue = new AdDatabaseModel.AdvertiserPaymentDue
            {
                AdvertiserID = GetUserID(),
                PaymentDueID = Admanagment.Helpers.Utility.GetPaymentID(),
                AdID = y,
                AdAmount = PaymentDue(),
                Date = DateTime.Now.Date,
                CurrencyCode = "USA",
                PaymentDue = PaymentDue()
            };
            context.AddToAdvertiserPaymentDues(advertiserPaymentDue);
            context.SaveChanges();
        }else
        {
             updatepayment.Date = DateTime.Now.Date;
            updatepayment.AdAmount = PaymentDue();
            updatepayment.PaymentDue = PaymentDue();
         context.SaveChanges();
        }
    }