public IHttpActionResult PuttblInsuranceClaim(int id, tblInsuranceClaim tblInsuranceClaim) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tblInsuranceClaim.Cliamid) { return(BadRequest()); } db.Entry(tblInsuranceClaim).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!tblInsuranceClaimExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public dynamic UpdatePassword(string email, string password) { List <tblFarmer> far = db.tblFarmers.ToList(); List <tblBidder> bid = db.tblBidders.ToList(); foreach (var item in far) { if (item.FarmerEmail == email) { item.FarmerPassword = password; byte[] encData_byte = new byte[item.FarmerPassword.Length]; encData_byte = System.Text.Encoding.UTF8.GetBytes(item.FarmerPassword); string encodedpassword = Convert.ToBase64String(encData_byte); item.FarmerPassword = encodedpassword; db.Entry(item).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(Request.CreateResponse(HttpStatusCode.OK, "Valid")); } } foreach (var item in bid) { if (item.BidderEmail == email) { item.BidderPassword = password; db.Entry(item).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(Request.CreateResponse(HttpStatusCode.OK, "Valid")); } } return(Request.CreateResponse(HttpStatusCode.NotFound, "NotFound")); }