protected void Page_Load(object sender, EventArgs e) { _role = CheckAccount(); if (!IsPostBack) { using (SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString())) { conn.Open(); Bind(conn, "select IdU from Lifts group by IdU", IdU); Bind(conn, "select IdM from Lifts group by IdM", IdM); Bind(conn, "select IdL from Lifts group by IdL", IdL); Bind(conn, "select Ttx from Ttx where TtxTitleId=1 group by Ttx", Address); Bind(conn, "select TpId from [Plan] group by TpId order by TpId", WorkType); List <Data> done = new List <Data>() { new Data() { Title = "выполнено" }, new Data() { Title = "не выполнено" } }; Done.DataSource = done; Done.DataBind(); Calendar.SelectedDate = new DateTime(2017, 1, 1); CalendarEnd.SelectedDate = DateTime.Now.Date; if (_role == "Worker") { ph1.Visible = false; ph2.Visible = false; } } } using (SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString())) { conn.Open(); BindWorker(conn); } }
protected void Page_Load(object sender, EventArgs e) { CheckAccount(); if (!IsPostBack) { using (SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString())) { conn.Open(); Bind(conn, "select IdU from Lifts group by IdU", IdU); Bind(conn, "select IdM from Lifts group by IdM", IdM); Bind(conn, "select IdL from Lifts group by IdL", IdL); Bind(conn, "select Ttx from Ttx where TtxTitleId=1 group by Ttx", Address); List <Data> data = new List <Data>(); data.Add(new Data() { Title = "1" }); data.Add(new Data() { Title = "2" }); Category.DataSource = data; Category.DataBind(); data = new List <Data>(); data.Add(new Data() { Title = "устранено" }); data.Add(new Data() { Title = "не устранено" }); Done.DataSource = data; Done.DataBind(); Start.SelectedDate = new DateTime(2016, 1, 1); End.SelectedDate = DateTime.Now.Date; } } }