protected void Page_Load(object sender, EventArgs e) { PDMLastContainer pdm = new PDMLastContainer(); GridView1.DataSource = (from o in pdm.LoginSet select o).ToList(); GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { PDMLastContainer pdm = new PDMLastContainer(); GridView1.DataSource = (from o in pdm.RoomsSet select o).ToList(); GridView1.DataBind(); } }
protected void Button1_Click(object sender, EventArgs e) { PDMLastContainer newLogin = new PDMLastContainer(); Login log = new Login(); log.Id = Guid.NewGuid(); log.NameLogin = TextBox1.Text.Trim(); log.FIOLogin = TextBox2.Text.Trim(); log.Password = TextBox3.Text.Trim(); newLogin.LoginSet.Add(log); newLogin.SaveChanges(); Response.Redirect("List.aspx"); }
protected void Button2_Click(object sender, EventArgs e) { Guid LogID = new Guid(Session["LoginID"].ToString()); PDMLastContainer pdmRooms = new PDMLastContainer(); Rooms room = new Rooms(); room.Id = Guid.NewGuid(); room.NumberRooms = TextBox1.Text.Trim(); room.ResponsobleRooms = "Ответственный"; Login user = (from u in pdmRooms.LoginSet where u.Id == LogID select u).First(); pdmRooms.SaveChanges(); Response.Redirect("Rooms.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { PDMLastContainer pdmEnter = new PDMLastContainer(); Login LogEnter = new Login(); string log = TextBox1.Text.Trim(); string pas = TextBox2.Text.Trim(); Session["login"] = log; int y = (from u in pdmEnter.LoginSet where ((u.NameLogin == log) && (u.Password == pas)) select u).Count(); if (y == 1) { Response.Redirect("Rooms.aspx"); } else { Response.Redirect("List.aspx"); // Label1.Text = "Не правильный Login или Password"; } }