PageRenderTime 467ms CodeModel.GetById 462ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/managers/ProjectEdit.aspx.cs

http://github.com/gmhawash/SSR
C# | 37 lines | 31 code | 6 blank | 0 comment | 0 complexity | 46a6df49bc2fc8f662ab0c86eae87d57 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Web;
 5using System.Web.UI;
 6using System.Web.UI.WebControls;
 7using TrackerTableAdapters;
 8
 9public partial class managers_Default2 : ZaytonaClasses.ZPage
10{
11    protected void Page_Load(object sender, EventArgs e)
12    {
13
14    }
15    protected void InsertButton_Click(object sender, EventArgs e)
16    {
17      DeptsTableAdapter dta = new DeptsTableAdapter();
18      DropDownList dept = FormView1.FindControl("Dept") as DropDownList;
19      var d = dta.GetDeptByDescription(dept.Text);
20
21      GroupsTableAdapter gta = new GroupsTableAdapter();
22      DropDownList group = FormView1.FindControl("Group") as DropDownList;
23      var g = gta.GetGroupByName(group.Text);
24
25      ProjectsTableAdapter ta = new ProjectsTableAdapter();
26      TextBox tb = FormView1.FindControl("NameTextBox") as TextBox;
27      CheckBox cb = FormView1.FindControl("ActiveCheckBox") as CheckBox;
28      ta.Insert(Guid.NewGuid(), tb.Text, cb.Checked, d[0].Id, g[0].Id);
29      GoBack();
30    }
31
32    protected void Cancel_Click(object sender, EventArgs e)
33    {
34      GoBack();
35    }
36
37}