public void Updateleave(int posid, int casualleave, int sickleave) { var obj = context.tblPositionLeavetypes.Find(posid); obj.CasualLeave = casualleave; obj.SickLeave = sickleave; context.Entry(obj).State = EntityState.Modified; }
public void update2(int Applicationid, int Marks) { var obj = context.tblApplicants.Find(Applicationid); obj.Marks = Marks; obj.TestStatus = "Pass"; context.Entry(obj).State = EntityState.Modified; }
public IHttpActionResult PutDesignation(int id, Designation designation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != designation.Id) { return(BadRequest()); } db.Entry(designation).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!DesignationExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public void Update(int roleid, int adminid, int userid) { var user = context.tblUsers.Find(userid); user.RoleId = roleid; user.IsActive = 1; user.AdminId = adminid; context.Entry(user).State = EntityState.Modified; }
public IHttpActionResult PutEmployee(int id, Employee employee) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != employee.Id) { return(BadRequest()); } db.Entry(employee.Addresses.ElementAt(0)).State = EntityState.Modified; foreach (EmployeesEducationQualification employeeEducationQualification in employee.EmployeesEducationQualifications) { if (employeeEducationQualification.Id == 0) { db.Entry(employeeEducationQualification).State = EntityState.Added; } else { db.Entry(employeeEducationQualification).State = EntityState.Modified; } } db.Entry(employee).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!EmployeeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public void itemqtydelivered(int Prdocno, int itemid, int qty) { var obj = context.tblDocDetails.Where(x => x.DocumentNo == Prdocno && x.ItemId == itemid).FirstOrDefault(); obj.DeliveredQuantity = qty; obj.RemainingQuantity = obj.Quantity - qty; context.Entry(obj).State = EntityState.Modified; }
public void updateseats(int posid, int sid, int positionid, int structid) { var obj = context.tblVacancies.Where(x => x.PositionId == positionid); context.Entry(obj).State = EntityState.Modified; }