当前位置: 首页>>代码示例>>C#>>正文


C# execSQL.connectionClass.fillDataset方法代码示例

本文整理汇总了C#中execSQL.connectionClass.fillDataset方法的典型用法代码示例。如果您正苦于以下问题:C# execSQL.connectionClass.fillDataset方法的具体用法?C# execSQL.connectionClass.fillDataset怎么用?C# execSQL.connectionClass.fillDataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在execSQL.connectionClass的用法示例。


在下文中一共展示了execSQL.connectionClass.fillDataset方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            if (UserId < 1) Response.Redirect(DotNetNuke.Common.Globals.NavigateURL("Login"));
            execSQL.connectionClass ob = new execSQL.connectionClass();
            DataSet ds = ob.fillDataset("EXEC ChungNT.BC_getUsers 'ALL'");
            ddNguoiNhan.DataSource = ds.Tables[0];
            ddNguoiNhan.DataBind();
            ddDonVi.DataSource = ds.Tables[1];
            ddDonVi.DataBind();

            if (Request["reply"] != null) tbNguoiNhan.Text = Request["reply"];
            if (Request["forward"] != null)
                try
                {
                    lbForward.Text = Request["forward"];
                    string cmdText = string.Format("EXEC ChungNT.BC_getChiTiet {0}, {1}", lbForward.Text, UserId);
                    ds = ob.fillDataset(cmdText);
                    tbTieuDe.Text = ds.Tables[0].Rows[0][3].ToString();
                    tbNoiDung.Text = ds.Tables[0].Rows[0][4].ToString();
                    cmdText = string.Format("EXEC ChungNT.BC_getFiles {0}, {1}", lbForward.Text, UserId);
                    gvDinhKem.DataSource = ob.fillDataset(cmdText);
                    gvDinhKem.DataBind();

                    tbNoiDung.Enabled = false;
                    tbTieuDe.Enabled = false;
                    fileUpload.Enabled = false;
                    btThemFile.Visible = false;
                }
                catch { }
        }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:31,代码来源:BaoCao_Gui.ascx.cs

示例2: Load_Data

 private void Load_Data()
 {
     execSQL.connectionClass ob = new execSQL.connectionClass();
     lbNgayThang.Text = ob.dateFormat(tbNgayThang.Text);
     try
     {
         string cmd = string.Format("EXEC ChamCong.Reason_Select '{0}', {1}, '{2}'", lbMaDV.Text, dlNhanVien.SelectedValue, lbNgayThang.Text);
         gvChamCong.DataSource = ob.fillDataset(cmd).Tables[0];
         gvChamCong.DataBind();
         DataSet ds = ob.fillDataset("ChamCong.Type_Select");
         DropDownList dlLoai;
         foreach (GridViewRow dr in gvChamCong.Rows)
         {
             dlLoai = (DropDownList)dr.FindControl("dlLoai");
             dlLoai.DataSource = ds.Tables[0];
             dlLoai.DataBind();
             try
             {
                 dlLoai.SelectedValue = dr.Cells[2].Text;
             }
             catch { }
             dr.CssClass = dr.Cells[1].Text;
         }
     }
     catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
 }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:26,代码来源:Reason.ascx.cs

示例3: btCapNhat_Click

        protected void btCapNhat_Click(object sender, EventArgs e)
        {
            if (fileUpload.HasFile) btDinhKem_Click(sender, e);
            try
            {
                execSQL.connectionClass ob = new execSQL.connectionClass();
                string sql = string.Format("EXEC TrongTam.CongViec_Update 0, N'{0}', '{1}', '{2}', '{3}', '{4}', {5}",
                     tbTieuDe.Text, ob.dateFormat(tbBatDau.Text), ob.dateFormat(tbKetThuc.Text), ob.dateFormat(tbCanhBao.Text), lbChuTri.Text, UserId);
                DataSet ds = ob.fillDataset(sql);
                string newID = ds.Tables[0].Rows[0][1].ToString();
                int trongSo;
                TextBox txt_TrongSo, txt_BatDau, txt_KetThuc, txt_CanhBao, txt_NoiDung;
                CheckBox cbPhanCong;
                foreach (GridViewRow dr in gvPhanCong.Rows)
                {
                    cbPhanCong = (CheckBox)dr.FindControl("cbPhanCong");

                    txt_BatDau = (TextBox)dr.FindControl("tbBatDau");
                    if (txt_BatDau.Text == "") txt_BatDau.Text = tbBatDau.Text;
                    txt_KetThuc = (TextBox)dr.FindControl("tbKetThuc");
                    if (txt_KetThuc.Text == "") txt_KetThuc.Text = tbKetThuc.Text;
                    txt_CanhBao = (TextBox)dr.FindControl("tbCanhBao");
                    if (txt_CanhBao.Text == "") txt_CanhBao.Text = txt_KetThuc.Text;
                    txt_NoiDung = (TextBox)dr.FindControl("tbNoiDung");
                    sql = string.Format("EXEC TrongTam.CongViec_PhanCong {0}, N'{1}', '{2}', '{3}', '{4}', {5}, {6}, '{7}'",
                        newID, txt_NoiDung.Text, ob.dateFormat(txt_BatDau.Text), ob.dateFormat(txt_KetThuc.Text), dr.Cells[0].Text, UserId,
                        cbPhanCong.Checked ? 3 : 0,
                        ob.dateFormat(txt_CanhBao.Text));
                    ob.fillDataset(sql);
                }
                Response.Redirect(hlQuayLai.NavigateUrl);
            }
            catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình cập nhật. " + ex.Message; }
        }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:34,代码来源:CongViec_ThemMoi_TN.ascx.cs

示例4: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            if (UserId < 0) Response.Redirect(DotNetNuke.Common.Globals.NavigateURL("Login"));

            hlChamDiem_Ban.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "BAN", "mid/" + ModuleId);
            hlDuyetTB.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "DUYET", "mid/" + ModuleId);
            hlPhucTra.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "PHUCTRA", "mid/" + ModuleId);

            execSQL.connectionClass ob = new execSQL.connectionClass(); 
            try
            {
                string sql = string.Format("SELECT VHDN.Quyen_CheckUser(2, {0})", UserId);
                DataSet ds = ob.fillDataset(sql);
                hlChamDiem_Ban.Visible = ds.Tables[0].Rows[0][0].ToString() == "1";
                hlDuyetTB.Visible = ds.Tables[0].Rows[0][0].ToString() == "1";
                sql = string.Format("SELECT VHDN.Quyen_CheckUser(1, {0})", UserId);
                ds = ob.fillDataset(sql);
                hlChamDiem_Ban.Visible = ds.Tables[0].Rows[0][0].ToString() == "1";
                hlPhucTra.Visible = ds.Tables[0].Rows[0][0].ToString() == "1";
            }
            catch { }

            tbThoiGian.Text = DateTime.Today.ToString("dd/MM/yyyy");
            lbThoiGian.Text = ob.dateFormat(tbThoiGian.Text);
            Load_Data();
        }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:27,代码来源:VHDN_2016.ascx.cs

示例5: Load_Data

        private void Load_Data()
        {
            try
            {
                execSQL.connectionClass ob = new execSQL.connectionClass();
                string sql = string.Format("EXEC ChungNT.cv_spCongVan_HanPheDuyet_TongHop {0}, {1}, {2}", UserId, cbQuaHan.Checked ? 1 : 0, dlThucHien.SelectedValue);
                DataSet ds = ob.fillDataset(sql);
                gvCongVan.DataSource = ds.Tables[0];
                gvCongVan.DataBind();

                DataSet dsTemp;
                GridView gvThucHien;
                HyperLink hlFile;
                foreach (GridViewRow dr in gvCongVan.Rows)
                {
                    sql = string.Format("EXEC ChungNT.cv_spCongVan_HanPheDuyet_ChiTiet {0}, {1}", dr.Cells[0].Text, dlThucHien.SelectedValue);
                    dsTemp = ob.fillDataset(sql);
                    gvThucHien = (GridView)dr.FindControl("gvThucHien");
                    gvThucHien.DataSource = dsTemp.Tables[0];
                    gvThucHien.DataBind();

                    try
                    {
                        hlFile = (HyperLink)dr.FindControl("hlDinhKem");
                        hlFile.NavigateUrl = ds.Tables[1].Rows[0][0].ToString();
                        hlFile.Text = ds.Tables[1].Rows[0][1].ToString();
                    }
                    catch { }
                }
                lbError.Text = string.Format("Danh sách <b>{0}</b> công văn", ds.Tables[0].Rows.Count);
            }
            catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
        }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:33,代码来源:CV_HanPheDuyet_TongHop.ascx.cs

示例6: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            if (UserId > 0)
                try
                {
                    execSQL.connectionClass ob = new execSQL.connectionClass();
                    string sql = string.Format("EXEC TrongTam.CV_Tree '', '', 0, {0}", UserId);
                    DataSet ds = ob.fillDataset(sql);
                    int quaHan = 0, canhBao = 0, hoanThanh = 0;
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        if (dr[1].ToString().StartsWith("<span class=\"QuaHan"))
                            quaHan++;
                        if (dr[1].ToString().StartsWith("<span class=\"CanhBao"))
                            canhBao++;
                        if (dr[1].ToString().StartsWith("<span class=\"HoanThanh"))
                            hoanThanh++;
                    }
                    lbQuaHan.Text = quaHan.ToString();
                    lbCanhBao.Text = canhBao.ToString();
                    lbHoanThanh.Text = hoanThanh.ToString();
                    lbDangTH.Text = (ds.Tables[0].Rows.Count - quaHan - canhBao - hoanThanh).ToString();

                    sql = "select ChungNT.DNN_Link('CongViec_TrongTam', '') LinkCV";
                    ds = ob.fillDataset(sql);
                    hlTrongTam.NavigateUrl = ds.Tables[0].Rows[0][0].ToString().Replace("ctl//", "");
                }
                catch { }
        }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:30,代码来源:CongViec_ThongKe.ascx.cs

示例7: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack) return;
     execSQL.connectionClass ob = new execSQL.connectionClass();
     string cmdText = string.Format("EXEC bc_getUsersByDonvi @userID={0}, @maDV=0", UserId);
     cmdText = "EXEC bc_getUsersByDonvi @userID=" + UserId;
     DataSet ds = ob.fillDataset(cmdText);
     ddDonVi.DataSource = ds.Tables[1];
     ddDonVi.DataBind();
     ddNguoiNhan.DataSource = ds.Tables[0];
     ddNguoiNhan.DataBind();
     //if (UserId > 0)
     //{
     //    ddNguoiNhan.DataSource = ob.fillDataset(cmdText);
     //    ddNguoiNhan.DataTextField = "DisplayName";
     //    ddNguoiNhan.DataValueField = "Username";
     //    ddNguoiNhan.DataBind();
     //}
     if (Request["reply"] != null)
     {
         tbNguoiNhan.Text = Request["reply"];
     }
     if (Request["forward"] != null)
     {
         cmdText = string.Format("EXEC bc_getsChiTietBC @userName='{0}', @idBC={1}", UserInfo.Username, Request["forward"]);
         ds = ob.fillDataset(cmdText);
         try
         {
             tbTieuDe.Text = ds.Tables[0].Rows[0][4].ToString();
             tbNoiDung.Text = ds.Tables[0].Rows[0][5].ToString();
             tbDinhKem.Text = ds.Tables[0].Rows[0][6].ToString();
         }
         catch { }
     }
 }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:35,代码来源:bcGuiBaoCao.ascx.cs

示例8: Load_Data

        private void Load_Data()
        {
            try
            {
                string sql = string.Format("EXEC VHDN.BangDiem_Select_CaNhan 1, {0}, '{1}'", Request["ID"], Request["DT"]);
                execSQL.connectionClass ob = new execSQL.connectionClass(); 
                DataSet ds = ob.fillDataset(sql);
                gvData.DataSource = ds.Tables[0];
                gvData.DataBind();

                int diemC, diem, diemTB, diemPT;
                diemC = 0; diem = 0; diemTB = 0; diemPT = 0;
                foreach (DataRow dr in ds.Tables[0].Rows)
                    try
                    {
                        diemC += int.Parse(dr["DiemChuan"].ToString());
                        diem += int.Parse(dr["Diem"].ToString());
                        diemTB += int.Parse(dr["DiemTB"].ToString());
                        diemPT += int.Parse(dr["DiemPT"].ToString());
                    }
                    catch { }
                gvData.FooterRow.CssClass = "group";
                gvData.FooterRow.Cells[1].Text = "Tổng cộng :";
                gvData.FooterRow.Cells[2].Text = diemC.ToString();
                gvData.FooterRow.Cells[3].Text = diem.ToString();
                gvData.FooterRow.Cells[4].Text = diemTB.ToString();
                gvData.FooterRow.Cells[5].Text = diemPT.ToString();

                sql = string.Format("EXEC VHDN.TongHop_TieuDe {0}, '{1}'", Request["ID"], Request["DT"]);
                ds = ob.fillDataset(sql);
                lbThang.Text = ds.Tables[0].Rows[0][0].ToString();
                lbBan.Text = ds.Tables[1].Rows[0][0].ToString();
            }
            catch { }
        }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:35,代码来源:VHDN_2016_Ban_Print.aspx.cs

示例9: Load_Data

 private void Load_Data()
 {
     try
     {
         execSQL.connectionClass ob = new execSQL.connectionClass();
         string sql = string.Format("EXEC ChungNT.cv_spCongVan_NgayHetHan_TongHop {0}, {1}, N'{2}', {3}",
             UserId, dlTrangThai.SelectedValue, dlPhongBan.SelectedItem.Text, dlSapXep.SelectedValue);
         DataSet ds = ob.fillDataset(sql);
         gvCongVan.DataSource = ds.Tables[0];
         gvCongVan.DataBind();
         lbError.Text = string.Format("Danh sách <b>{0}</b> công văn", ds.Tables[0].Rows.Count);
         TreeView tree;
         TreeNode node;
         TreeNode child;
         HyperLink hlFile;
         string txt;
         foreach (GridViewRow dr in gvCongVan.Rows)
         {
             sql = "EXEC ChungNT.cv_spCongVan_NgayHetHan_ChiTiet " + dr.Cells[0].Text;
             ds = ob.fillDataset(sql);
             tree = (TreeView)dr.FindControl("tvThucHien");
             int i = 0;
             int j = 0;
             while (i < ds.Tables[0].Rows.Count)
                 try
                 {
                     if (ds.Tables[0].Rows[i]["SX"].ToString() == "3")
                     {
                         txt = string.Format("<span class='{0}'>{1}{2}</span>", ds.Tables[0].Rows[i]["Class_HH"].ToString(),
                             ds.Tables[0].Rows[i]["DisplayName"].ToString(), ds.Tables[0].Rows[i]["Ngay_HH"].ToString());
                         node = new TreeNode(txt);
                         node.SelectAction = TreeNodeSelectAction.Expand;
                         j = i + 1;
                         while (j < ds.Tables[0].Rows.Count && ds.Tables[0].Rows[j]["SX"].ToString() != "3")
                         {
                             txt = string.Format("<span class='{0}'>{1}{2}</span>", ds.Tables[0].Rows[j]["Class_HH"].ToString(),
                                 ds.Tables[0].Rows[j]["Ngay_GQ"].ToString(), ds.Tables[0].Rows[j]["DisplayName"].ToString());
                             child = new TreeNode(txt);
                             child.SelectAction = TreeNodeSelectAction.None;
                             node.ChildNodes.Add(child);
                             j++;
                         }
                         tree.Nodes.Add(node);
                         i = j;
                     }
                     else i++;
                 }
                 catch { }
             try
             {
                 hlFile = (HyperLink)dr.FindControl("hlDinhKem");
                 hlFile.NavigateUrl = ds.Tables[1].Rows[0][0].ToString();
                 hlFile.Text = ds.Tables[1].Rows[0][1].ToString();
             }
             catch { }
         }
     }
     catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
 }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:59,代码来源:CongVan_NgayHetHan_TongHop.ascx.cs

示例10: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack) return;
     string cmdText = string.Format("EXEC bc_getsChiTietBC @userName='{0}', @idBC={1}", UserInfo.Username, Request["idBC"]);
     execSQL.connectionClass ob = new execSQL.connectionClass();
     DataSet ds = ob.fillDataset(cmdText);
     try
     {
         hlChuyen.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "GuiBC", "mid/" + ModuleId + "/forward/" + ds.Tables[0].Rows[0][0].ToString());
         hlTraLoi.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "GuiBC", "mid/" + ModuleId + "/reply/" + ds.Tables[0].Rows[0][2].ToString());
         lbUserName.Text = ds.Tables[0].Rows[0][3].ToString();
         lbTieuDe.Text = ds.Tables[0].Rows[0][4].ToString();
         lbNoiDung.Text = ds.Tables[0].Rows[0][5].ToString();
         lbThoiGian.Text = "vào lúc " + ds.Tables[0].Rows[0][7].ToString();
     }
     catch (Exception ex) { lbTieuDe.Text = ex.Message; }
     // Tạo liên kết đến file đính kèm
     lbDinhKem.Text = "";
     string[] split = ds.Tables[0].Rows[0][6].ToString().Split(',');
     foreach (string s in split)
     {
         try
         {
             cmdText = "EXEC bc_getsFile " + int.Parse(s);
             if (lbDinhKem.Text.Length > 0) lbDinhKem.Text += "<br />";
             lbDinhKem.Text += string.Format("[+] <a href='{0}/DesktopModules/cntBaoCao/fileview.aspx?ID={1}' target='_blank'>{2}</a>",
               Request.ApplicationPath, int.Parse(s), ob.fillDataset(cmdText).Tables[0].Rows[0][0].ToString());                   
         }
         catch
         {
             if (lbDinhKem.Text.Length > 0) lbDinhKem.Text += "<br />";
             lbDinhKem.Text += string.Format("[+] <a href='{0}' target='_blank'>{0}</a>", s);
         }
     }
     // Hiện tên nhãn
     if (ds.Tables[0].Rows[0][1].ToString() == "$$$")
     {
         lbNhan.Text = "";
         lbNguoiGui.Text = "Gửi đến";
         btSave.Visible = false;
         ddNhan.Visible = false;
     }
     else
     {
         lbNhan.Text = ds.Tables[0].Rows[0][1].ToString();
         lbNguoiGui.Text = "Gửi từ";
         ddNhan.Visible = true;
         btSave.Visible = true;
         cmdText = "EXEC bc_getsNhan @userID=" + UserId;
         ds = ob.fillDataset(cmdText);
         DataRow dr = ds.Tables[0].NewRow();
         dr[0] = "0";
         dr[1] = "Chọn danh mục";
         ds.Tables[0].Rows.InsertAt(dr, 0);
         ddNhan.DataSource = ds;
         ddNhan.DataBind();
     }
 }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:58,代码来源:bcChiTietBC.ascx.cs

示例11: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;

            try
            {
                string nam = Request["Y"];
                string tuan = Request["W"];
                string maDV = Request["DV"];
                lbThang.Text = tuan;
                lbNam.Text = nam;

                execSQL.connectionClass ob = new execSQL.connectionClass(); 
                string cmd = string.Format("EXEC BaoCao.DonVi_Select '{0}'", maDV);
                DataSet ds = ob.fillDataset(cmd);
                lbDonVi.Text = ds.Tables[0].Rows[0][1].ToString();
                lbKyHieu.Text = ds.Tables[0].Rows[0][2].ToString();
                lbDiaDanh.Text = ds.Tables[0].Rows[0][3].ToString();
                lbCapTren.Text = ds.Tables[0].Rows[0][4].ToString();
                if (maDV.Length == 9) lbNoiNhan.Text = lbCapTren.Text.ToUpper().Replace("CÔNG TY ĐIỆN LỰC", "PC");
                lbNgayThang.Text = string.Format("{0} tháng {1} năm {2}", DateTime.Today.Day, DateTime.Today.Month, DateTime.Today.Year);

                cmd = string.Format("EXEC BaoCao.Tuan_Select '{0}', {1}, {2}", maDV, nam, tuan);
                ds = ob.fillDataset(cmd);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    lbChuTri.Text = dr[2].ToString();
                    lbChucVu.Text = dr[3].ToString();
                    lbCongViec.Text = dr[4].ToString();
                    lbKeHoach.Text = dr[5].ToString();
                    lbDotXuat.Text = dr[6].ToString();
                    lbBienBan.Text = dr[7].ToString();
                    lbLanhDao.Text = dr[8].ToString();
                    lbCanBo.Text = dr[9].ToString();
                    lbTongPCT.Text = dr[10].ToString();
                    lbPCT.Text = dr[11].ToString();
                    lbTongLCT.Text = dr[12].ToString();
                    lbLCT.Text = dr[13].ToString();
                    lbViPham.Text = dr[14].ToString();
                    lbGiamThuong.Text = dr[15].ToString();
                    lbCatThuong.Text = dr[16].ToString();
                    lbKyLuat.Text = dr[17].ToString();
                    lbHuanLuyen.Text = dr[18].ToString();
                    lbLyThuyet.Text = dr[19].ToString();
                    lbThucHanh.Text = dr[20].ToString();
                    lbHLLai.Text = dr[21].ToString();
                    lbBanDau.Text = dr[22].ToString();
                    lbKienNghi.Text = dr[23].ToString().Replace("\r\n", "<br />");
                    lbThoiGian.Text = dr[30].ToString();
                }

                ClientScript.RegisterStartupScript(this.GetType(), "print", "<script>window.print();</script>");
            }
            catch { }
        }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:56,代码来源:BCTuan_ChiTiet.aspx.cs

示例12: Load_Data

        private void Load_Data()
        {
            try
            {
                execSQL.connectionClass ob = new execSQL.connectionClass();
                string sql = string.Format("EXEC ChungNT.cv_spCongVan_NgayHetHan_TongHop '{0}', '{1}', {2}, '{3}'",
                    ob.dateFormat(tbTuNgay.Text), ob.dateFormat(tbDenNgay.Text), dlLanhDao.SelectedValue, dlPhongBan.SelectedValue);
                DataSet ds = ob.fillDataset(sql);
                gvCongVan.DataSource = ds.Tables[0];
                gvCongVan.DataBind();
                lbError.Text = string.Format("Danh sách <b>{0}</b> công văn", ds.Tables[0].Rows.Count);
                TreeView tree;
                TreeNode node;
                TreeNode child;
                string txt;
                foreach (GridViewRow dr in gvCongVan.Rows)
                    try
                    {
                        tree = (TreeView)dr.FindControl("tvThucHien");
                        sql = "EXEC ChungNT.cv_spCongVan_NgayHetHan_ChiTiet " + dr.Cells[0].Text;
                        ds = ob.fillDataset(sql);
                        dr.CssClass = ds.Tables[1].Rows[0][0].ToString();

                        int i = 0;
                        int j = 0;
                        while (i < ds.Tables[0].Rows.Count)
                            try
                            {
                                if (ds.Tables[0].Rows[i]["SX"].ToString() == "3")
                                {
                                    txt = string.Format("<span class='{0}'>{1}{2}</span>", ds.Tables[0].Rows[i]["Class_HH"].ToString(),
                                        ds.Tables[0].Rows[i]["DisplayName"].ToString(), ds.Tables[0].Rows[i]["Ngay_HH"].ToString());
                                    node = new TreeNode(txt);
                                    node.SelectAction = TreeNodeSelectAction.Expand;
                                    j = i + 1;
                                    while (j < ds.Tables[0].Rows.Count && ds.Tables[0].Rows[j]["SX"].ToString() != "3")
                                    {
                                        txt = string.Format("<span class='{0}'>{1}{2}</span>", ds.Tables[0].Rows[j]["Class_HH"].ToString(),
                                            ds.Tables[0].Rows[j]["Ngay_GQ"].ToString(), ds.Tables[0].Rows[j]["DisplayName"].ToString());
                                        child = new TreeNode(txt);
                                        child.SelectAction = TreeNodeSelectAction.None;
                                        node.ChildNodes.Add(child);
                                        j++;
                                    }
                                    tree.Nodes.Add(node);
                                    i = j;
                                }
                                else i++;
                                //tree.ExpandAll();
                            }
                            catch { }
                    }
                    catch { }
            }
            catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
        }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:56,代码来源:WebUserControl1.ascx.cs

示例13: Load_CongViec

        private void Load_CongViec()
        {
            try
            {
                execSQL.connectionClass ob = new execSQL.connectionClass();

                string sql = string.Format("EXEC TrongTam.CongViec_Select {0}, {1}", lbID.Text, UserId);
                DataSet ds = ob.fillDataset(sql);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    lbID.Text = ds.Tables[0].Rows[0]["ID"].ToString();
                    tbTieuDe.Text = ds.Tables[0].Rows[0]["TieuDe"].ToString();
                    tbBatDau.Text = ds.Tables[0].Rows[0]["BatDau"].ToString();
                    tbKetThuc.Text = ds.Tables[0].Rows[0]["KetThuc"].ToString();
                    tbCanhBao.Text = ds.Tables[0].Rows[0]["CanhBao"].ToString();
                    lbChuTri.Text = ds.Tables[0].Rows[0]["ChuTri"].ToString();
                    lbError.Text = string.Format("Cập nhật lần cuối: {0}, {1}", ds.Tables[0].Rows[0]["DisplayName"].ToString(), ds.Tables[0].Rows[0]["DateS"].ToString());
                    btCapNhat.Text = "Cập nhật";
                }
                else
                {
                    lbChuTri.Text = UserInfo.Profile.GetPropertyValue("MaDonVi");
                    btCapNhat.Text = "Thêm mới";
                }

                sql = string.Format("EXEC TrongTam.CongViec_PhanCong_Select {0}, {1}", lbID.Text, UserId);
                ds = ob.fillDataset(sql);
                gvPhanCong.DataSource = ds.Tables[0];
                gvPhanCong.DataBind();
                foreach (GridViewRow dr in gvPhanCong.Rows)
                {
                    if (dr.Cells[2].Text == "0") dr.CssClass = "ChuaPC";
                    if (dr.Cells[1].Text == "1") dr.CssClass = "ChuTri";
                }

                Load_DinhKem();
                Load_ThucHien();

                sql = string.Format("EXEC TrongTam.CongViec_CheckRole {0}, {1}", lbID.Text, UserId);
                ds = ob.fillDataset(sql);
                gvPhanCong.Columns[5].Visible = ds.Tables[0].Rows[0]["SELECT"].ToString() == "1" && lbID.Text == "0";
                bool canEdit = ds.Tables[0].Rows[0]["SELECT"].ToString() == "1" || ds.Tables[0].Rows[0]["EDIT"].ToString() == "1";
                btThemPC.Visible = canEdit;
                fileUpload.Visible = canEdit;
                btDinhKem.Visible = canEdit;
                gvDinhKem.Columns[3].Visible = canEdit;
                btCapNhat.Enabled = canEdit;
                bool canDo = ds.Tables[0].Rows[0]["EDIT"].ToString() == "1" || ds.Tables[0].Rows[0]["DO"].ToString() == "1";
                gvThucHien.Columns[8].Visible = canDo;
                btThucHien.Enabled = canDo;
            }
            catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
        }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:53,代码来源:CongViec_CapNhat_TN.ascx.cs

示例14: Load_CongViec

        private void Load_CongViec()
        {
            string cv = Request["ID"] == null ? "0" : Request["ID"];
            try
            {
                execSQL.connectionClass ob = new execSQL.connectionClass();
                string sql = string.Format("EXEC TrongTam.CongViec_Select {0}, {1}", cv, UserId);
                DataSet ds = ob.fillDataset(sql);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    lbTieuDe.Text = ds.Tables[0].Rows[0]["TieuDe"].ToString();
                    lbBatDau.Text = ds.Tables[0].Rows[0]["BatDau"].ToString();
                    lbKetThuc.Text = ds.Tables[0].Rows[0]["KetThuc"].ToString();
                    lbCanhBao.Text = ds.Tables[0].Rows[0]["CanhBao"].ToString();
                    lbError.Text = string.Format("Cập nhật lần cuối: {0}, {1}", ds.Tables[0].Rows[0]["DisplayName"].ToString(), ds.Tables[0].Rows[0]["DateS"].ToString());
                }
                else lbError.Text = "Không tìm thấy công việc";

                gvPhanCong.DataSource = ds.Tables[2];
                gvPhanCong.DataBind();
                foreach (GridViewRow dr in gvPhanCong.Rows)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                        if (dr.Cells[2].Text == "0")
                            dr.CssClass = "ChuaPC";
                    if (dr.Cells[1].Text == "1") dr.CssClass = "ChuTri";
                }

                sql = string.Format("EXEC TrongTam.CongViec_DinhKem_Select {0}, {1}", cv, UserId);
                gvDinhKem.DataSource = ob.fillDataset(sql).Tables[0];
                gvDinhKem.DataBind();

                ds = ob.fillDataset("EXEC TrongTam.CongViec_ThucHien_Select " + cv);
                gvThucHien.DataSource = ds.Tables[0];
                gvThucHien.DataBind();
                string lastDV = "";
                int i = 0;
                foreach (GridViewRow dr in gvThucHien.Rows)
                    if (dr.Cells[1].Text == lastDV)
                    {
                        dr.Cells[3].Text = "";
                        dr.Cells[4].Text = "";
                    }
                    else
                    {
                        lastDV = dr.Cells[1].Text;
                        i++;
                        dr.Cells[3].Text = i.ToString();
                        if (dr.Cells[2].Text == "1") dr.CssClass = "ChuTri2";
                    }
            }
            catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
        }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:53,代码来源:CongViec_ChiTiet.ascx.cs

示例15: GridView1_RowCommand

 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Change")
         if (UserInfo.IsInRole("TRUONGPHONG") || UserInfo.IsInRole("PHOPHONG"))
         {
             execSQL.connectionClass ob = new execSQL.connectionClass(); 
             ob.fillDataset(string.Format("EXEC bcPlan_setPhanQuyen {0}, '{1}'", GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text,
                 UserInfo.Profile.GetPropertyValue("MaDonVi")));
             GridView1.DataSource = ob.fillDataset("EXEC bcPlan_getPhanQuyen " + UserId);
             GridView1.DataBind();
         }
 }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:12,代码来源:plan_role.ascx.cs


注:本文中的execSQL.connectionClass.fillDataset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。