protected void btnAddUser_Click(object sender, EventArgs e) { using (var db = new Classes.DAL()) { User u = new User(txtName.Text, txtSurname.Text, DropDownListGender.SelectedIndex,txtMail.Text); db.AddUser(u); Response.Redirect("adminUsers.aspx"); } }
protected void btnAddCompany_Click(object sender, EventArgs e) { using (var db = new Classes.DAL()) { //Вот, не могу понять какие аргументы вернее какие типы ставить Company c = new Company(txtName.Text, txtDescription.Text, txtLocation.Text, txtRepAccount.Text, txtActivity.Text); db.AddCompany(c); Response.Redirect("adminCompanies.aspx"); } }
protected void btnAddActivity_Click(object sender, EventArgs e) { using (var db = new Classes.DAL()) { //Вот, не могу понять какие аргументы вернее какие типы ставить Activity a = new Activity(txtName.Text, txtDescription.Text, txtDateStart.Text, txtDateEnd.Text); db.AddActivity(a); Response.Redirect("adminActivity.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { using (var db = new Classes.DAL()) { string rows = "<table>"; rows += "<tr><td><strong>ID</strong></td><td><strong>Name</strong></td><td><strong>Company</strong></td><td><td><strong>Description</strong></td><td><strong>Start Date</strong></td><td><strong>End Date</strong></td></tr>"; var allActivities = from a in db.Activities select a; foreach (var item in allActivities) { rows += "<tr>"; rows += "<td>" + item.ID.ToString() + "</td>"; rows += "<td>" + item.Description + "</td>"; rows += "<td>" + item.StartDate + "</td>"; rows += "<td>" + item.EndDate+ "</td>"; rows += "</tr>"; } } }
protected void Page_Load(object sender, EventArgs e) { using (var db = new Classes.DAL()) { string rows = "<table>"; rows += "<tr><td><strong>ID</strong></td><td><strong>Name</strong></td><td><strong>Description</strong></td><td><strong>Location</strong></td><td><strong>Representor Account</strong></td><td><strong>Activity</strong></td></tr>"; var allCompanies = from c in db.Companies select c; foreach (var item in allCompanies) { rows += "<tr>"; rows += "<td>" + item.ID.ToString() + "</td>"; rows += "<td>" + item.Name + "</td>"; rows += "<td>" + item.Description + "</td>"; rows += "<td>" + item.Location + "</td>"; rows += "<td>" + item.RepresentorAccount + "</td>"; rows += "<td>" + item.Activities + "</td>"; rows += "</tr>"; } rows += "</table>"; companiesTable.InnerHtml = rows; } }
protected void Page_Load(object sender, EventArgs e) { using (var db = new Classes.DAL()) { string rows = "<table>"; rows += "<tr><td><strong>ID</strong></td><td><strong>Name</strong></td><td><strong>Surname</strong></td><td><strong>Mail</strong></td><td><strong>Gender</strong></td></tr>"; var allUsers = from u in db.Users select u; foreach (var item in allUsers) { rows += "<tr>"; rows += "<td>" + item.ID.ToString() + "</td>"; rows += "<td>" + item.Name + "</td>"; rows += "<td>" + item.Surname + "</td>"; rows += "<td>" + item.Gender + "</td>"; rows += "<td>" + item.Mail + "</td>"; rows += "</tr>"; } rows += "</table>"; usersTable.InnerHtml = rows; } }