// PUT: odata/Status(5) public IHttpActionResult Put([FromODataUri] byte key, Delta <Status> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Status status = db.Status.Find(key); if (status == null) { return(NotFound()); } patch.Put(status); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!StatusExists(key)) { return(NotFound()); } else { throw; } } return(Updated(status)); }
// PUT: odata/Bills(5) public IHttpActionResult Put([FromODataUri] int key, Delta <Bill> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } Bill bill = db.Bills.Find(key); if (bill == null) { return(NotFound()); } patch.Put(bill); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!BillExists(key)) { return(NotFound()); } else { throw; } } return(Updated(bill)); }
// PUT: odata/GSTPercentages(5) public IHttpActionResult Put([FromODataUri] int key, Delta <GSTPercentage> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } GSTPercentage gSTPercentage = db.GSTPercentages.Find(key); if (gSTPercentage == null) { return(NotFound()); } patch.Put(gSTPercentage); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!GSTPercentageExists(key)) { return(NotFound()); } else { throw; } } return(Updated(gSTPercentage)); }
// PUT: odata/EmployeeDetails(5) public IHttpActionResult Put([FromODataUri] short key, Delta <EmployeeDetail> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } EmployeeDetail employeeDetail = db.EmployeeDetails.Find(key); if (employeeDetail == null) { return(NotFound()); } patch.Put(employeeDetail); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!EmployeeDetailExists(key)) { return(NotFound()); } else { throw; } } return(Updated(employeeDetail)); }
// PUT: odata/MaterialInventories(5) public IHttpActionResult Put([FromODataUri] int key, Delta <MaterialInventory> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } MaterialInventory materialInventory = db.MaterialInventories.Find(key); if (materialInventory == null) { return(NotFound()); } patch.Put(materialInventory); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MaterialInventoryExists(key)) { return(NotFound()); } else { throw; } } return(Updated(materialInventory)); }
// PUT: odata/ReorderRequireds(5) public IHttpActionResult Put([FromODataUri] int key, Delta <ReorderRequired> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } ReorderRequired reorderRequired = db.ReorderRequireds.Find(key); if (reorderRequired == null) { return(NotFound()); } patch.Put(reorderRequired); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ReorderRequiredExists(key)) { return(NotFound()); } else { throw; } } return(Updated(reorderRequired)); }
protected void Page_Load(object sender, EventArgs e) { try { EphraimTradersEntities db = new EphraimTradersEntities(); ept.Models.OnlinePaymentDetail objOnlinePaymentDetails = new OnlinePaymentDetail(); if (Request["amount"] != null) { objOnlinePaymentDetails.amount = Convert.ToDecimal(Request["amount"]); } if (Request["buyer"] != null) { objOnlinePaymentDetails.email = Request["buyer"].ToString(); } if (Request["buyer_name"] != null) { objOnlinePaymentDetails.name = Request["buyer_name"].ToString(); } if (Request["buyer_phone"] != null) { objOnlinePaymentDetails.phone = Request["buyer_phone"].ToString(); } if (Request["currency"] != null) { objOnlinePaymentDetails.currency = Request["currency"].ToString(); } if (Request["fees"] != null) { objOnlinePaymentDetails.Fees = Convert.ToDecimal(Request["fees"]); } if (Request["mac"] != null) { objOnlinePaymentDetails.MAC = Request["mac"].ToString(); } if (Request["longurl"] != null) { objOnlinePaymentDetails.LongUrl = Request["longurl"].ToString(); } if (Request["payment_id"] != null) { objOnlinePaymentDetails.InstamojoPaymentId = Request["payment_id"].ToString(); } if (Request["payment_request_id"] != null) { objOnlinePaymentDetails.RequestId = Request["payment_request_id"].ToString(); } if (Request["purpose"] != null) { objOnlinePaymentDetails.description = Request["purpose"].ToString(); } if (Request["shorturl"] != null) { objOnlinePaymentDetails.ShortUrl = Request["shorturl"].ToString(); } if (Request["status"] != null) { objOnlinePaymentDetails.Status = Request["status"].ToString(); } objOnlinePaymentDetails.CreatedBy = Request["buyer"].ToString(); objOnlinePaymentDetails.CreatedOn = DateTime.Now; db.OnlinePaymentDetails.Add(objOnlinePaymentDetails); db.SaveChanges(); } catch (Exception ex) { writelog(ex.Message); } }