I want to do subtract "1" from table bookinfo
's field available
[HttpPost]
public ActionResult issuebook(string type, string accessionno, string bookname, string issuedate, string duedate, string id)
{
tblIssuedbook issuebook = new tblIssuedbook();
issuebook.AccessionNo = accessionno;
issuebook.Name = bookname;
issuebook.IssueDate = issuedate;
issuebook.DueDate = duedate;
issuebook.Type = type;
issuebook.MemberId = id;
db.tblIssuedbooks.Add(issuebook);
db.SaveChanges();
Bookinfo b = new Bookinfo();
return view();
}
I want when these field are saved in the db to subtract "1" from another table according to the accessionNo