仅从表的1个字段中减去mvc 4

时间:2013-08-16 18:51:19

标签: asp.net-mvc-4

我想从表bookinfo的字段available中减去“1”

[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();
}

我希望这些字段保存在数据库中,根据accessionNo

从另一个表中减去“1”

0 个答案:

没有答案