private void updateChatbox(CS_ChatBox_Info csInfor) { CS_ChatBox_Info newInfor = new CS_ChatBox_Info(); newInfor.Unread = false; db.Entry(newInfor).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }
public void addData(CS_ChatBox_Info cs) { CS_ChatBox_Info cscb = new CS_ChatBox_Info(); //cscb.Chat_Id = cs.Chat_Id; Ve sau id thi lam the nay nhe int id = new App_Auto_NumberController().GenID("CS_ChatBox_Info.Chat_Id"); cscb.Chat_Id = id; cscb.Request_Name = cs.Request_Name; cscb.Request_Content = cs.Request_Content; cscb.Request_Phone = cs.Request_Phone; cscb.Unread = true; cscb.Create_date = Convert.ToDateTime(DateTime.Now.ToShortDateString()); db.CS_ChatBox_Info.Add(cscb); db.SaveChanges(); //return Json(cscb); }