Ejemplo n.º 1
0
        protected void Load_BC()
        {
            if (lbID.Text == "0")
            {
                Load_LoaiBC();
                tbThoiGian.Text = DateTime.Today.ToString("dd/MM/yyyy");
                execSQL.connectionClass ob = new execSQL.connectionClass();
                class_QLDA ob2 = new class_QLDA();
                gvDinhKem.DataSource = ob2.file_list("0", lbTempID.Text);
                gvDinhKem.DataBind();

                btXoa.Visible = false;
                btDonVi.Visible = false;
            }
            else
                try
                {
                    string cmd = string.Format("exec DA_BC_getBaoCao {0}, {1}", lbID.Text, UserId);
                    execSQL.connectionClass ob = new execSQL.connectionClass();
                    class_QLDA ob2 = new class_QLDA();
                    DataSet ds = ob.fillDataset(cmd);
                    lbID.Text = ds.Tables[0].Rows[0][0].ToString();
                    ddNhomBC.SelectedValue = ds.Tables[0].Rows[0][1].ToString();

                    Load_LoaiBC();

                    ddLoaiBC.SelectedValue = ds.Tables[0].Rows[0][2].ToString();
                    tbTenBC.Text = ds.Tables[0].Rows[0][3].ToString();
                    tbThoiGian.Text = DateTime.Parse(ds.Tables[0].Rows[0][4].ToString()).ToString("dd/MM/yyyy");
                    lbError.Text = string.Format("{0}, {1}", ds.Tables[0].Rows[0][5].ToString(), DateTime.Parse(ds.Tables[0].Rows[0][6].ToString()).ToString("HH:mm dd/MM/yyyy"));

                    btDonVi.Visible = (ds.Tables[0].Rows[0][1].ToString() == "0");
                    cmd = string.Format("EXEC DA_BC_checkBC {0}, {1}", lbID.Text, UserId);
                    ds = ob.fillDataset(cmd);
                    btCapNhat.Visible = ds.Tables[0].Rows[0][0].ToString() == "1";
                    btXoa.Visible = ds.Tables[0].Rows[0][0].ToString() == "1";
                    btFileUpload.Visible = ds.Tables[0].Rows[0][0].ToString() == "1";

                    gvDinhKem.DataSource = ob2.file_list(lbID.Text, "").Tables[0];
                    gvDinhKem.DataBind();
                }
                catch { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu"; }
        }
 protected void Load_BC()
 {
     try
     {
         string cmdTxt = string.Format("exec DA_BC_getDuAn {0}, '{1}'", lbID.Text, lbDV.Text);
         execSQL.connectionClass ob = new execSQL.connectionClass();
         class_QLDA ob2 = new class_QLDA();
         DataSet ds = ob.fillDataset(cmdTxt);
         lbID.Text = ds.Tables[0].Rows[0][0].ToString();
         lbLoaiBC.Text = ds.Tables[0].Rows[0][1].ToString();
         lbBaoCao.Text = ds.Tables[0].Rows[0][2].ToString();
         lbThoiGian.Text = DateTime.Parse(ds.Tables[0].Rows[0][3].ToString()).ToString("dd/MM/yyyy");
         lbDonVi.Text = ds.Tables[0].Rows[0][4].ToString();
         gvBaoCao.DataSource = ds.Tables[1];
         gvBaoCao.DataBind();
         gvDinhKem.DataSource = ob2.file_list(lbID.Text, lbDV.Text).Tables[0];
         gvDinhKem.DataBind();
         lbError.Text = "";
     }
     catch { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu"; }
 }