protected void bt_newPrivateMessage_Click(object sender, EventArgs e) { //Session["login"] = "******"; MP msg = new MP(); msg.TxtMP = tb_newPrivateMessage.Text; msg.DateMP = DateTime.Now; msg.IdUser = Utilisateur.GetByLogin(Session["login"].ToString()).IdUser; msg.IdContact = int.Parse(ddl_selectUser.SelectedValue); SupbookEntities ctx = new SupbookEntities(); ctx.MPs.AddObject(msg); ctx.SaveChanges(); }
public static List <Wall> GetAll(List <Utilisateur> Users) { List <int> listID = new List <int>(); foreach (var item in Users) { listID.Add(item.IdUser); } using (SupbookEntities ctx = new SupbookEntities()) { var query = from a in ctx.Walls where listID.Contains(a.IdUser.Value) select a; return(query.ToList()); } }
protected void Page_Load(object sender, EventArgs e) { bdd = new SupbookEntities(); }