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)); }
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)); }
static void Main(string[] args) { TypeFee tfee = new TypeFee(); AdminFee addfee = new AdminFee(); tfee.adminFees = (AdminFee)addfee; tfee.adminFees.dollar = addfee.dollar; }
public async Task <ActionResult> DeleteConfirmed(int id) { AdminFee adminFee = await db.AdminFees.FindAsync(id); db.AdminFees.Remove(adminFee); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <IHttpActionResult> GetAdminFee(int id) { AdminFee adminFee = await db.AdminFees.FindAsync(id); if (adminFee == null) { return(NotFound()); } return(Ok(adminFee)); }
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"); }
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)); }
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)); }
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)); }
// 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)); }
// 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)); }
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()); }
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)); }