예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ClientScript.RegisterStartupScript(this.GetType(), "title", "<script>document.title='-'</script>");
     Label3.Style["Text-align"] = "left";
     string maBP = Request.QueryString[0].ToString();
     string ngayDau = Request.QueryString[1].ToString();
     string ngayCuoi = Request.QueryString[2].ToString();
     lbNgay.Text = "Từ ngày " + ngayDau + " đến ngày " + ngayCuoi;
     string[] split = ngayDau.Split(new Char[] { '/' });
     ngayDau = split[1].ToString() + "/" + split[0].ToString() + "/" + split[2].ToString();
     split = ngayCuoi.Split(new Char[] { '/' });
     ngayCuoi = split[1].ToString() + "/" + split[0].ToString() + "/" + split[2].ToString();
     Class1 ob = new Class1();
     GridView2.DataSource = ob.zShowThongKe(maBP, ngayDau, ngayCuoi);
     GridView2.DataBind();
     string st = "select * from Bophan where MaBP=" + maBP;            
     DataSet ds = ob.zSelect(st);
     lbBoPhan.Text = "Đơn vị : " + ds.Tables[0].Rows[0][1].ToString();
     lbHaNoi.Text = "Hà Nội, ngày " + DateTime.Today.Day + " tháng " + DateTime.Today.Month + " năm " + DateTime.Today.Year;
     maBP = "<script>window.print();</script>";
     ClientScript.RegisterStartupScript(this.GetType(), "windowKey", maBP);
 }
예제 #2
0
 protected void ddNgayCuoi_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!ddNgayCuoi.SelectedValue.StartsWith("1/1/1900"))
     {
         Class1 ob = new Class1();
         DataSet ds = ob.zShowThongKe(eBophan.Text, ddNgayDau.SelectedValue, ddNgayCuoi.SelectedValue);
         GridView2.DataSource = ds;
         GridView2.DataBind();
         GridView1.Visible = false;
         GridView2.Visible = true;
         lbThongKe.Visible = true;
     }
 }
예제 #3
0
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            eBophan.Text = DropDownList1.SelectedValue;
            Class1 ob = new Class1();
            if (GridView1.Visible == false)
            {
                if (!ddNgayCuoi.SelectedValue.StartsWith("1/1/1900"))
                {
                    GridView2.DataSource = ob.zShowThongKe(eBophan.Text, ddNgayDau.SelectedValue, ddNgayCuoi.SelectedValue);
                    GridView2.DataBind();
                }
            }
            else
            {
                if (!DropDownList1.SelectedValue.StartsWith("0"))
                {
                    GridView1.DataSource = ob.zShowGridView(eBophan.Text, eChonngay.Text);
                    GridView1.DataBind();
                    GridView1.EditIndex = -1;
                }
            }

            this_Month();
        }