protected void DoIt_Click(object sender, EventArgs e) { UpdateLabel(); List <Data> data = GetData(); Out1.DataSource = data; Out1.DataBind(); // Period.Visible = false; // phReport.Visible = true; }
protected void Page_Load(object sender, EventArgs e) { List <Data> datdoc = GetData1(); Out1.DataSource = datdoc; Out1.DataBind(); // List<Data> datdo = GetData(); // Out.DataSource = datdo; // Out.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { _role = CheckAccount(); Date.Text = DateTime.Now.ToLongDateString(); if (!string.IsNullOrEmpty(Request["t"])) { _type = int.Parse(Request["t"]); } if (!IsPostBack) { KOS.App_Code.ClearTemp clear = new App_Code.ClearTemp(Request); clear.DeleteOld(); UpdateLabel(); List <Data> data = GetData(); Out1.DataSource = data; Out1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(Request["zId"])) { // if (!string.IsNullOrEmpty(Request["zId"]) && !IsPostBack) Response.Redirect("~/About.aspx"); } _wz = Int32.Parse(Request["zId"]); // if (User.Identity.Name != "ODS14") { Treg.Visible = false; Tzak.Visible = false; } if (!IsPostBack) { App_Code.Base db = new App_Code.Base(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); DataTable data = db.GetEvent(_wz); if (data.Rows.Count < 1) { Response.Redirect("~/About.aspx"); } Id.Text = _wz.ToString(); Sourse.Text = data.Rows[0]["Sourse"].ToString(); // Text1.Text = data.Rows[0]["Sourse"].ToString(); IO.Text = data.Rows[0]["IO"].ToString(); DataId.Text = data.Rows[0]["DataId"].ToString(); dateReg = ((DateTime)data.Rows[0]["DataId"]); ZayavId.Text = data.Rows[0]["ZayavId"].ToString(); RegistrId.Text = data.Rows[0]["RegistrId"].ToString(); LiftId.Text = data.Rows[0]["LiftId"].ToString(); // TextBox4.Text = data.Rows[0]["LiftId"].ToString(); TypeId.Text = data.Rows[0]["TypeId"].ToString(); EventId.Text = data.Rows[0]["EventId"].ToString(); // Text.Text = data.Rows[0]["EventId"].ToString(); ToApp.Text = data.Rows[0]["ToApp"].ToString(); // Text2.Text = data.Rows[0]["ToApp"].ToString(); DateToApp.Text = data.Rows[0]["DateToApp"].ToString(); Who.Text = data.Rows[0]["Who"].ToString(); Comment.Text = data.Rows[0]["Comment"].ToString(); // Text5.Text = data.Rows[0]["Prim"].ToString(); Prim.Text = data.Rows[0]["Prim"].ToString(); DateWho.Text = data.Rows[0]["DateWho"].ToString(); // clos = ((DateTime)data.Rows[0]["DateWho"]); Date.Text = DateTime.Now.ToLongDateString(); string d = string.Empty; string d2 = string.Empty, t2 = string.Empty; TimeSpan pr = DateTime.Now - ((DateTime)data.Rows[0]["DataId"]); if (!(data.Rows[0]["DateWho"] is DBNull)) { d2 = ((DateTime)data.Rows[0]["DateWho"]).Date.ToString(); t2 = ((DateTime)data.Rows[0]["DateWho"]).TimeOfDay.ToString(); pr = ((DateTime)data.Rows[0]["DateWho"]) - ((DateTime)data.Rows[0]["DataId"]); } if (!(data.Rows[0]["DateToApp"] is DBNull)) { d = ((DateTime)data.Rows[0]["DateToApp"]).ToString(); } string prostoy = ((int)pr.TotalDays).ToString() + " дн. " + pr.Hours.ToString() + " час. " + pr.Minutes.ToString() + " мин."; Timing.Text = prostoy; DocName.Text = "документ"; //Год/месяц/день /* List<string> xx = new List<string>() { "Акт неисправности", "Акт внеплановых работ", "Платежное поручение", "Счет" }; * if (!IsPostBack) * { * DocName.DataSource = xx; * DocName.DataBind(); * DocName.SelectedIndex = 0; * } */ using (SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString())) { conn.Open(); SqlCommand cmd = new SqlCommand("select count(d.Id) from Documents d" + " where d.NumEvent=@id and d.Usr=@usr", conn); cmd.Parameters.AddWithValue("id", _wz); cmd.Parameters.AddWithValue("usr", User.Identity.Name); UsrDoc.Text = cmd.ExecuteScalar().ToString(); } List <Data> datadoc = GetData(); Out.DataSource = datadoc; Out.DataBind(); List <Data> datdoc = GetData1(); Out1.DataSource = datdoc; Out1.DataBind(); // DocPodp.Visible = true; } }