コード例 #1
0
        public async Task <IHttpActionResult> PutAdminFee(int id, AdminFee adminFee)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != adminFee.PaymentID)
            {
                return(BadRequest());
            }

            db.Entry(adminFee).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AdminFeeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
コード例 #2
0
        public async Task <IHttpActionResult> PostAdminFee(AdminFee adminFee)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.AdminFees.Add(adminFee);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (AdminFeeExists(adminFee.PaymentID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = adminFee.PaymentID }, adminFee));
        }
コード例 #3
0
        static void Main(string[] args)
        {
            TypeFee  tfee   = new TypeFee();
            AdminFee addfee = new AdminFee();

            tfee.adminFees        = (AdminFee)addfee;
            tfee.adminFees.dollar = addfee.dollar;
        }
コード例 #4
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            AdminFee adminFee = await db.AdminFees.FindAsync(id);

            db.AdminFees.Remove(adminFee);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
コード例 #5
0
        public async Task <IHttpActionResult> GetAdminFee(int id)
        {
            AdminFee adminFee = await db.AdminFees.FindAsync(id);

            if (adminFee == null)
            {
                return(NotFound());
            }

            return(Ok(adminFee));
        }
コード例 #6
0
        public void _PayAdminFees(int id, AuctionRegistration reg)
        {
            AdminFee fees = new AdminFee
            {
                PaymentID          = reg.id,
                ProofOfPaymentPath = "none",
                DateOfPayment      = DateTime.Now,
                Amount             = 150
            };

            APILibrary.APIMethods.APIPost <Deposit>(fees, "AdminFees");
        }
コード例 #7
0
        public async Task <ActionResult> Edit([Bind(Include = "PaymentID,ProofOfPaymentPath,DateOfPayment,Amount")] AdminFee adminFee)
        {
            if (ModelState.IsValid)
            {
                db.Entry(adminFee).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.PaymentID = new SelectList(db.AuctionRegistrations, "id", "BuyerId", adminFee.PaymentID);
            return(View((object)adminFee));
        }
コード例 #8
0
        public async Task <ActionResult> Create([Bind(Include = "PaymentID,ProofOfPaymentPath,DateOfPayment")] AdminFee adminFee)
        {
            if (ModelState.IsValid)
            {
                db.AdminFees.Add(adminFee);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.PaymentID = new SelectList(db.AuctionRegistrations, "id", "BuyerId", adminFee.PaymentID);
            return(View(adminFee));
        }
コード例 #9
0
        public async Task <IHttpActionResult> DeleteAdminFee(int id)
        {
            AdminFee adminFee = await db.AdminFees.FindAsync(id);

            if (adminFee == null)
            {
                return(NotFound());
            }

            db.AdminFees.Remove(adminFee);
            await db.SaveChangesAsync();

            return(Ok(adminFee));
        }
コード例 #10
0
        // GET: AdminFees/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AdminFee adminFee = await db.AdminFees.FindAsync(id);

            if (adminFee == null)
            {
                return(HttpNotFound());
            }
            return(View((object)adminFee));
        }
コード例 #11
0
        // GET: AdminFees/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AdminFee adminFee = await db.AdminFees.FindAsync(id);

            if (adminFee == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PaymentID = new SelectList(db.AuctionRegistrations, "id", "BuyerId", adminFee.PaymentID);
            return(View((object)adminFee));
        }
コード例 #12
0
        public ActionResult Return(string id)
        {
            string[] s = id.Split('-');
            int      i = 0;

            if (id.Contains("-5000"))
            {
                try
                {
                    Deposit dep = new Deposit
                    {
                        BuyerID              = User.Identity.GetUserId(),
                        DateOfPayment        = DateTime.Now,
                        Paid                 = true,
                        DepositReturned      = false,
                        ProofOfPaymentPath   = "none",
                        ProofOfReturnPayment = "none",
                        Amount               = 5000
                    };
                    APILibrary.APIMethods.APIPost <Deposit>(dep, "Deposits");
                }
                catch { }
            }

            if (s[0] != "")
            {
                i = Convert.ToInt32(s[0]);

                try
                {
                    AdminFee fees = new AdminFee
                    {
                        PaymentID          = i,
                        ProofOfPaymentPath = "none",
                        DateOfPayment      = DateTime.Now,
                        Amount             = 150
                    };
                    APILibrary.APIMethods.APIPost <AdminFee>(fees, "AdminFees");
                    AuctionRegistration AR = APILibrary.APIMethods.APIGet <AuctionRegistration>(i.ToString(), "AuctionRegistrations");
                    return(View(AR));
                }
                catch { }
            }
            return(View());
        }
コード例 #13
0
        public async Task <IHttpActionResult> GetAdminFee(int id)
        {
            AdminFee adminFee = await db.AdminFees.FindAsync(id);

            if (adminFee == null)
            {
                return(NotFound());
            }

            AdminFeeNoR newAdd = new AdminFeeNoR()
            {
                Amount             = adminFee.Amount,
                DateOfPayment      = adminFee.DateOfPayment,
                PaymentID          = adminFee.PaymentID,
                ProofOfPaymentPath = adminFee.ProofOfPaymentPath,
                // AuctionRegistration = fee.AuctionRegistration
            };

            return(Ok(adminFee));
        }