private void Load_NguoiNhan()
        {
            try
            {
                string sql = "EXEC EOFFICE_NPC.ChungNT.ThongBao_DonVi_Select @ID, @noiSoan";
                SqlParameter[] pa = new SqlParameter[2];
                pa[0] = new SqlParameter("@ID", lbID.Text);
                pa[1] = new SqlParameter("@noiSoan", lbDonVi.Text);
                execSQL.connectionClass ob = new execSQL.connectionClass();
                DataSet ds = ob.bindDataset(sql, pa);
                DataView dv = ds.Tables[1].DefaultView;
                TreeNode nodePC, nodeDL;
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    nodePC = new TreeNode();
                    nodePC.Value = dr["MaDonViQL"].ToString();
                    nodePC.Text = dr["TenDonViQL"].ToString();
                    nodePC.SelectAction = TreeNodeSelectAction.None;
                    dv.RowFilter = string.Format("MaDonViQL = '{0}'", dr["MaDonViQL"].ToString());
                    foreach (DataRowView dr2 in dv)
                    {
                        nodeDL = new TreeNode();
                        nodeDL.Value = dr2.Row["MaDonVi"].ToString();
                        nodeDL.Text = dr2.Row["TenDonVi"].ToString();
                        nodeDL.SelectAction = TreeNodeSelectAction.None;
                        nodeDL.ShowCheckBox = true;
                        nodeDL.Checked = dr["MaDonViQL"].ToString() == "A00";
                        nodePC.ChildNodes.Add(nodeDL);
                    }
                    tvNguoiNhan.Nodes.Add(nodePC);
                }
                tvNguoiNhan.CollapseAll();

                // Danh sach NHOM
                sql = "EXEC EOFFICE_NPC.ChungNT.ThongBao_Nhom_Select @userID";
                pa = new SqlParameter[1];
                pa[0] = new SqlParameter("@userID", UserId);
                ds = ob.bindDataset(sql, pa);
                nodePC = new TreeNode();
                nodePC.Value = "A00";
                nodePC.Text = "Danh sách nhóm";
                nodePC.SelectAction = TreeNodeSelectAction.None;
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    nodeDL = new TreeNode();
                    nodeDL.Value = dr["ID"].ToString();
                    nodeDL.Text = string.Format("{0} ({1} đơn vị)", dr["TenNhom"].ToString(), dr["SoLuong"].ToString());
                    nodeDL.SelectAction = TreeNodeSelectAction.None;
                    nodeDL.ShowCheckBox = true;
                    nodePC.ChildNodes.Add(nodeDL);
                }
                tvNhom.Nodes.Add(nodePC);
                tvNhom.ExpandAll();
            }
            catch { }
        }
        private void Load_Data()
        {
            try
            {
                string sql = "EXEC LuuTru.CaNhan_CapHoSo_Select @userID, 1";
                SqlParameter[] pa = new SqlParameter[1];
                pa[0] = new SqlParameter("@userID", UserId);
                execSQL.connectionClass ob = new execSQL.connectionClass();
                dlCapHS.DataSource = ob.bindDataset(sql, pa).Tables[0];
                dlCapHS.DataBind();

                sql = "EXEC LuuTru.CaNhan_CongVan_Select @IDCapSo, @UserID";
                pa = new SqlParameter[2];
                pa[0] = new SqlParameter("@IDCapSo", Request["ID"]);
                pa[1] = new SqlParameter("@UserID", UserId);
                DataSet ds = ob.bindDataset(sql, pa);
                if (ds.Tables[0].Rows.Count == 0)
                {
                    lbError.Text = "Không tìm thấy công văn";
                    btLuu.Enabled = false;
                }
                else
                {
                    lbMaCV.Text = ds.Tables[0].Rows[0][0].ToString();
                    lbIDCapSo.Text = ds.Tables[0].Rows[0][1].ToString();
                    lbSo.Text = ds.Tables[0].Rows[0][2].ToString();
                    lbSoCT.Text = ds.Tables[0].Rows[0][3].ToString();
                    lbNgay.Text = ds.Tables[0].Rows[0][4].ToString();
                    lbNoiGui.Text = ds.Tables[0].Rows[0][5].ToString();
                    lbTrichYeu.Text = ds.Tables[0].Rows[0][6].ToString();
                    lbButPheLD.Text = ds.Tables[0].Rows[0][7].ToString();
                    try
                    {
                        dlCapHS.SelectedValue = ds.Tables[0].Rows[0][8].ToString();
                    }
                    catch { }
                    if (ds.Tables[0].Rows[0][8].ToString() != "0")
                        lbError.Text = "Công văn này đã được lưu vào hồ sơ";
                    else
                        lbError.Text = "";
                    btLuu.Enabled = true;
                }
            }
            catch (Exception ex)
            {
                lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message;
                btLuu.Enabled = false;
            }
        }
        public void load_data(string tbSearch)
        {
            tvLuuTru.Nodes.Clear();
            try
            {
                string sql = "EXEC LuuTru.CaNhan_Tree @userID, @search";
                SqlParameter[] pa = new SqlParameter[2];
                pa[0] = new SqlParameter("@userID", UserId);
                pa[1] = new SqlParameter("@search", tbSearch);
                execSQL.connectionClass ob = new execSQL.connectionClass();
                DataSet ds = ob.bindDataset(sql, pa);
                DataView dvChild = ds.Tables[4].DefaultView;
                TreeNode nParent, nChild;
                foreach (DataRow dr in ds.Tables[1].Rows)
                {
                    nParent = add_childNode(dr["IDHoSo"].ToString(), dr["TenHoSo"].ToString(), ds.Tables[2], ds.Tables[3]);

                    dvChild.RowFilter = "ParentID = " + dr["IDHoSo"].ToString();
                    foreach (DataRowView v in dvChild)
                    {
                        nChild = add_childNode(v.Row["IDHoSo"].ToString(), v.Row["TenHoSo"].ToString(), ds.Tables[2], ds.Tables[3]);
                        nParent.ChildNodes.Add(nChild);
                    }

                    tvLuuTru.Nodes.Add(nParent);
                }
                tvLuuTru.ExpandAll();
                tvLuuTru.ShowCheckBoxes = TreeNodeTypes.None;
                btXoa.Visible = false;
                btChon.Text = "Xóa";
            }
            catch (Exception ex) { Response.Write(ex.Message); }
        }
        protected void btLuu_Click(object sender, EventArgs e)
        {
            try
            {
                execSQL.connectionClass ob = new execSQL.connectionClass();
                string sql, hosoID;
                DataSet ds;
                if (lbThem.Text == "THEM")
                {
                    sql = "EXEC LuuTru.CaNhan_CapHoSo_Update 0, @TenHoSo, @NguoiTao, 1, 0";
                    SqlParameter[] pa = new SqlParameter[2];
                    pa[0] = new SqlParameter("@TenHoSo", tbCapHS.Text);
                    pa[1] = new SqlParameter("@NguoiTao", UserId);
                    ds = ob.bindDataset(sql, pa);
                    hosoID = ds.Tables[0].Rows[0][1].ToString();
                }
                else hosoID = dlCapHS.SelectedValue;

                sql = "EXEC LuuTru.CaNhan_CongVan_Luu @MaCV, @HoSo, @IDCapSo";
                SqlParameter[] para = new SqlParameter[3];
                para[0] = new SqlParameter("@MaCV", lbMaCV.Text);
                para[1] = new SqlParameter("@HoSo", hosoID);
                para[2] = new SqlParameter("@IDCapSo", lbIDCapSo.Text);
                ds = ob.bindDataset(sql, para);
                if (ds.Tables[0].Rows[0][0].ToString() == "1")
                {
                    lbError.Text = "Lưu công văn thành công";
                    btLuu.Enabled = false;
                }
                else lbError.Text = "Không thể lưu công văn";
            }
            catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình ghi dữ liệu. " + ex.Message; }
        }
        private void Load_Data()
        {
            try
            {
                string sent = Request["SENT"] == null ? "2" : Request["SENT"];
                lbTieuDe.Text = sent == "2" ? "THÔNG BÁO TRỰC TIẾP" : sent == "1" ? hlThongBaoGui.Text : hlThongBaoDen.Text;

                string sql = "EXEC EOFFICE_NPC.ChungNT.ThongBao_NoiDung_Get @userID, @userDV, @sent, @search";
                SqlParameter[] pa = new SqlParameter[4];
                pa[0] = new SqlParameter("@userID", UserId);
                pa[1] = new SqlParameter("@userDV", UserInfo.Profile.GetPropertyValue("MaDonVi"));
                pa[2] = new SqlParameter("@sent", sent);
                pa[3] = new SqlParameter("@search", tbNoiDung.Text);
                execSQL.connectionClass ob = new execSQL.connectionClass();
                DataSet ds = ob.bindDataset(sql, pa);
                DataColumn dc = new DataColumn("Link");
                ds.Tables[0].Columns.Add(dc);
                ds.Tables[0].AcceptChanges();
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    dr.BeginEdit();
                    dr["Link"] = DotNetNuke.Common.Globals.NavigateURL(TabId, "SOAN", "mid/" + ModuleId, "ID/" + dr["ID"].ToString());
                    dr.EndEdit();
                }
                gvThongBao.DataSource = ds.Tables[0];
                gvThongBao.DataBind();
                foreach (GridViewRow dr in gvThongBao.Rows)
                    if (dr.Cells[0].Text == "0")
                        dr.CssClass = "new";
            }
            catch (Exception ex) { Response.Write("Có lỗi trong quá trình đọc dữ liệu. " + ex.Message); }
        }
 private void load_all()
 {
     try
     {
         string sql = "EXEC ChungNT.ThongBao_Nhom_Select @userID";
         SqlParameter[] pa = new SqlParameter[1];
         pa[0] = new SqlParameter("@userID", UserId);
         execSQL.connectionClass ob = new execSQL.connectionClass();
         gvData.DataSource = ob.bindDataset(sql, pa).Tables[0];
         gvData.DataBind();
     }
     catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
 }
 protected void btChiaSe_Click(object sender, EventArgs e)
 {
     try
     {
         string sql = "EXEC LuuTru.CaNhan_ChiaSe @userID, @username, @hsID";
         SqlParameter[] pa = new SqlParameter[3];
         pa[0] = new SqlParameter("@userID", UserId);
         pa[1] = new SqlParameter("@username", tbNguoiNhan.Text);
         pa[2] = new SqlParameter("@hsID", dlHoSo.SelectedValue);
         execSQL.connectionClass ob = new execSQL.connectionClass();
         DataSet ds = ob.bindDataset(sql, pa);
         lbError.Text = string.Format("Chia sẻ thành công <b>{0}</b> tài liệu", ds.Tables[0].Rows[0][0].ToString());
     }
     catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
 }
 private void load_data()
 {
     try
     {
         string sql = "EXEC LuuTru.CaNhan_CapHoSo_Select @userID, 2";
         SqlParameter[] pa = new SqlParameter[1];
         pa[0] = new SqlParameter("@userID", UserId);
         execSQL.connectionClass ob = new execSQL.connectionClass();
         DataSet ds = ob.bindDataset(sql, pa);
         gvData.DataSource = ds.Tables[0];
         gvData.DataBind();
         dlHoSo.DataSource = ds.Tables[1];
         dlHoSo.DataBind();
     }
     catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack) return;
     hlThoat.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId);
     try
     {
         string sql = "EXEC LuuTru.CaNhan_CapHoSo_Select @userID, 1";
         SqlParameter[] pa = new SqlParameter[1];
         pa[0] = new SqlParameter("@userID", UserId);
         execSQL.connectionClass ob = new execSQL.connectionClass();
         DataSet ds = ob.bindDataset(sql, pa);
         dlHoSo.DataSource = ds.Tables[0];
         dlHoSo.DataBind();
     }
     catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
 }
Exemplo n.º 10
0
 protected void btLuu_Click(object sender, EventArgs e)
 {
     if (fileUpload.HasFile)
         try
         {
             // UPLOAD FILE
             string fileName = DateTime.Now.ToString("yyMMdd_HHmmss_") + UserId + fileUpload.FileName.Remove(0, fileUpload.FileName.LastIndexOf("."));
             string savePath = DateTime.Today.ToString("yyyy-MM");
             string filePath = Server.MapPath(@"DesktopModules\PHLT\") + savePath;
             if (!Directory.Exists(filePath))
                 Directory.CreateDirectory(filePath);
             filePath = filePath + @"\" + fileName;
             savePath = Request.ApplicationPath + "/DesktopModules/PHLT/" + savePath + "/" + fileName;
             fileUpload.SaveAs(filePath);
             // CAP HS
             execSQL.connectionClass ob = new execSQL.connectionClass();
             string sql, hosoID;
             DataSet ds;
             if (lbThem.Text == "THEM")
             {
                 sql = "EXEC LuuTru.CaNhan_CapHoSo_Update 0, @TenHoSo, @NguoiTao, 1, 0";
                 SqlParameter[] pa = new SqlParameter[2];
                 pa[0] = new SqlParameter("@TenHoSo", tbCapHS.Text);
                 pa[1] = new SqlParameter("@NguoiTao", UserId);
                 ds = ob.bindDataset(sql, pa);
                 hosoID = ds.Tables[0].Rows[0][1].ToString();
             }
             else hosoID = dlCapHS.SelectedValue;
             // VAN BAN
             sql = string.Format("EXEC LuuTru.CaNhan_VanBan_Update 0, N'{0}', '{1}', N'{2}', N'{3}', N'{4}', '{5}', N'{6}', {7}, {8}, 0",
                 tbKyHieu.Text, ob.dateFormat(tbNgayThang.Text), tbNoiSoan.Text, tbMoTa.Text, tbGhiChu.Text,
                 savePath, fileUpload.FileName, hosoID, UserId);
             ds = ob.fillDataset(sql);
             if (ds.Tables[0].Rows[0][0].ToString() == "1")
             {
                 lbError.Text = "Lưu văn bản thành công";
                 btLuu.Enabled = false;
             }
             else lbError.Text = "Không thể lưu văn bản";
         }
         catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình ghi dữ liệu. " + ex.Message; }
     else lbError.Text = "Chưa có file đính kèm";
 }
Exemplo n.º 11
0
        private DataSet tim_kiem(string key)
        {
            string maDV = UserInfo.Profile.GetPropertyValue("MaDonVi");

            execSQL.connectionClass ob = new execSQL.connectionClass();
            string sql = @"EXEC dbo.CV_spCongVanDen_Search @USerID, @MaDonVi, @MaDonViQL, -1, @Nam, -1, -1, 
            @TuSo, @TuSo, @TuNgay, @TuNgay, @KyHieu, -1, -1, @MaNoiGoi, NULL, NULL, @TrichYeu, 0, 0, -1, -1";
            SqlParameter[] pa = new SqlParameter[9];
            if (dlLoaiCV.SelectedValue == "1")
            {
                pa[0] = new SqlParameter("@USerID", UserId);
                pa[1] = new SqlParameter("@MaDonVi", maDV);
                pa[2] = new SqlParameter("@MaDonViQL", maDV.Substring(0, maDV.Length - 3));
                pa[3] = new SqlParameter("@Nam", dlNam.SelectedValue);
                pa[4] = new SqlParameter("@TuSo", tbSo.Text);
                if (tbNgay.Text == "")
                    pa[5] = new SqlParameter("@TuNgay", "NULL");
                else
                    pa[5] = new SqlParameter("@TuNgay", ob.dateFormat(tbNgay.Text));
                pa[6] = new SqlParameter("@KyHieu", tbKyHieu.Text);
                pa[7] = new SqlParameter("@MaNoiGoi", dlNoiSoan.SelectedValue);
                pa[8] = new SqlParameter("@TrichYeu", key);
            }
            else
            {
                sql = @"EXEC dbo.CV_spCongVanDi_Search @USerID, @MaDonVi, @MaDonViQL, -1, @Nam, -1, -1, 
                @TuSo, @TuSo, @TuNgay, @TuNgay, @KyHieu, -1, @MaNoiSoanThao, @TrichYeu, 0, 0, -1, -1";
                pa[0] = new SqlParameter("@USerID", UserId);
                pa[1] = new SqlParameter("@MaDonVi", maDV);
                pa[2] = new SqlParameter("@MaDonViQL", maDV.Substring(0, maDV.Length - 3));
                pa[3] = new SqlParameter("@Nam", dlNam.SelectedValue);
                pa[4] = new SqlParameter("@TuSo", tbSo.Text);
                if (tbNgay.Text == "")
                    pa[5] = new SqlParameter("@TuNgay", "NULL");
                else
                    pa[5] = new SqlParameter("@TuNgay", ob.dateFormat(tbNgay.Text));
                pa[6] = new SqlParameter("@KyHieu", tbKyHieu.Text);
                pa[7] = new SqlParameter("@MaNoiSoanThao", dlNoiSoan.SelectedValue);
                pa[8] = new SqlParameter("@TrichYeu", key);
            }
            return ob.bindDataset(sql, pa);
        }
Exemplo n.º 12
0
 private void load_id()
 {
     try
     {
         tvData.Nodes.Clear();
         string sql = "EXEC ChungNT.ThongBao_Nhom_Select_ID @ID, @noiSoan";
         SqlParameter[] pa = new SqlParameter[2];
         pa[0] = new SqlParameter("@ID", lbID.Text);
         pa[1] = new SqlParameter("@noiSoan", UserInfo.Profile.GetPropertyValue("MaDonVi"));
         execSQL.connectionClass ob = new execSQL.connectionClass();
         DataSet ds = ob.bindDataset(sql, pa);
         if (ds.Tables[0].Rows.Count > 0)
             tbTenNhom.Text = ds.Tables[0].Rows[0]["TenNhom"].ToString();
         else
             tbTenNhom.Text = "";
         DataView dv = ds.Tables[2].DefaultView;
         TreeNode nodePC, nodeDL;
         foreach (DataRow dr in ds.Tables[1].Rows)
         {
             nodePC = new TreeNode();
             nodePC.Value = dr["MaDonViQL"].ToString();
             nodePC.Text = dr["TenDonViQL"].ToString();
             nodePC.SelectAction = TreeNodeSelectAction.None;
             dv.RowFilter = string.Format("MaDonViQL = '{0}'", dr["MaDonViQL"].ToString());
             foreach (DataRowView dr2 in dv)
             {
                 nodeDL = new TreeNode();
                 nodeDL.Value = dr2.Row["MaDonVi"].ToString();
                 nodeDL.Text = dr2.Row["TenDonVi"].ToString();
                 nodeDL.SelectAction = TreeNodeSelectAction.None;
                 nodeDL.ShowCheckBox = true;
                 nodeDL.Checked = dr["MaDonViQL"].ToString() == "A00";
                 nodePC.ChildNodes.Add(nodeDL);
             }
             tvData.Nodes.Add(nodePC);
         }
         tvData.CollapseAll();
     }
     catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
 }
 protected void gvData_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "SUA")
         try
         {
             int rowID = Convert.ToInt32(e.CommandArgument);
             lbID.Text = gvData.Rows[rowID].Cells[0].Text;
             string sql = "EXEC LuuTru.CaNhan_CapHoSo_Select_ID @ID";
             SqlParameter[] pa = new SqlParameter[1];
             pa[0] = new SqlParameter("@ID", lbID.Text);
             execSQL.connectionClass ob = new execSQL.connectionClass();
             DataSet ds = ob.bindDataset(sql, pa);
             tbHoSo.Text = ds.Tables[0].Rows[0]["TenHoSo"].ToString();
             cbTinhTrang.Checked = ds.Tables[0].Rows[0]["TinhTrang"].ToString() != "1";
             try
             {
                 dlHoSo.SelectedValue = ds.Tables[0].Rows[0]["ParentID"].ToString();
             }
             catch { }
             lbError.Text = "";
         }
         catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
 }
 protected void btCapNhat_Click(object sender, EventArgs e)
 {
     try
     {
         string sql = "EXEC LuuTru.CaNhan_CapHoSo_Update @ID, @TenHoSo, @NguoiTao, @TinhTrang, @ParentID";
         SqlParameter[] pa = new SqlParameter[5];
         pa[0] = new SqlParameter("@ID", lbID.Text);
         pa[1] = new SqlParameter("@TenHoSo", tbHoSo.Text);
         pa[2] = new SqlParameter("@NguoiTao", UserId);
         pa[3] = new SqlParameter("@TinhTrang", cbTinhTrang.Checked ? 0 : 1);
         pa[4] = new SqlParameter("@ParentID", dlHoSo.SelectedValue);
         execSQL.connectionClass ob = new execSQL.connectionClass();
         DataSet ds = ob.bindDataset(sql, pa);
         if (ds.Tables[0].Rows[0][0].ToString() == "1")
         {
             btBoQua_Click(sender, e);
             load_data();
             lbError.Text = "Cập nhật thành công";
         }
         else lbError.Text = "Không thể cập nhật";
     }
     catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
 }
Exemplo n.º 15
0
 private void Load_DinhKem()
 {
     try
     {
         execSQL.connectionClass ob = new execSQL.connectionClass();
         string cmdTxt = "EXEC EOFFICE_NPC.ChungNT.ThongBao_DinhKem_Select @ID, @userID";
         SqlParameter[] pa = new SqlParameter[2];
         pa[0] = new SqlParameter("@ID", lbID.Text);
         pa[1] = new SqlParameter("@userID", UserId);
         gvDinhKem.DataSource = ob.bindDataset(cmdTxt, pa).Tables[0];
         gvDinhKem.DataBind();
     }
     catch { }
 }
Exemplo n.º 16
0
 protected void btCapNhat_Click(object sender, EventArgs e)
 {
     try
     {
         string sql = "EXEC ChungNT.ThongBao_Nhom_Update @ID, @tenNhom, @userID";
         SqlParameter[] pa = new SqlParameter[3];
         pa[0] = new SqlParameter("@ID", lbID.Text);
         pa[1] = new SqlParameter("@tenNhom", tbTenNhom.Text);
         pa[2] = new SqlParameter("@userID", UserId);
         execSQL.connectionClass ob = new execSQL.connectionClass();
         DataSet ds = ob.bindDataset(sql, pa);
         if (ds.Tables[0].Rows[0]["RC"].ToString() != "0")
         {
             string newID = ds.Tables[0].Rows[0]["ID"].ToString();
             sql = "EXEC ChungNT.ThongBao_Nhom_Update_ID @ID, @donVi, @DELETE";
             pa = new SqlParameter[3];
             pa[0] = new SqlParameter("@ID", newID);
             pa[1] = new SqlParameter("@donVi", "F01");
             pa[2] = new SqlParameter("@DELETE", "1");
             ob.bindDataset(sql, pa);
             foreach (TreeNode node in tvData.Nodes)
                 foreach (TreeNode node2 in node.ChildNodes)
                     if (node2.Checked)
                     {
                         pa = new SqlParameter[3];
                         pa[0] = new SqlParameter("@ID", newID);
                         pa[1] = new SqlParameter("@donVi", node2.Value);
                         pa[2] = new SqlParameter("@DELETE", "0");
                         ob.bindDataset(sql, pa);
                     }
             load_all();
             btBoQua_Click(sender, e);
             lbError.Text = "Cập nhật thành công";
         }
         else lbError.Text = "Không thể cập nhật";
     }
     catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
 }
Exemplo n.º 17
0
 private void Load_ThongBao()
 {
     try
     {
         string sql = "EXEC EOFFICE_NPC.ChungNT.ThongBao_NoiDung_Select @ID, @userID, @noiSoan";
         SqlParameter[] pa = new SqlParameter[3];
         pa[0] = new SqlParameter("@ID", lbID.Text);
         pa[1] = new SqlParameter("@userID", UserId);
         pa[2] = new SqlParameter("@noiSoan", lbDonVi.Text);
         execSQL.connectionClass ob = new execSQL.connectionClass();
         DataSet ds = ob.bindDataset(sql, pa);
         lbID.Text = ds.Tables[0].Rows[0]["ID"].ToString();
         lbNoiSoan.Text = ds.Tables[0].Rows[0]["TenDonVi"].ToString();
         lbNoiSoan2.Text = ds.Tables[0].Rows[0]["TenDonViQL"].ToString();
         lbNguoiSoan.Text = lbID.Text == "0" ? UserInfo.DisplayName : ds.Tables[0].Rows[0]["NguoiSoan"].ToString();
         tbTieuDe.Text = ds.Tables[0].Rows[0]["TieuDe"].ToString();
         tbNoiDung.Text = ds.Tables[0].Rows[0]["NoiDung"].ToString();
         bool canEdit = ds.Tables[0].Rows[0]["CanEdit"].ToString() == "1";
         btGuiDi.Visible = canEdit;
         btXoa.Visible = canEdit;
         btTraLoi.Visible = !canEdit;
         btDinhKem.Visible = canEdit;
         gvDinhKem.Columns[3].Visible = canEdit;
     }
     catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đọc dữ liệu. " + ex.Message; }
 }
Exemplo n.º 18
0
 protected void btXoa_Click(object sender, EventArgs e)
 {
     try
     {
         execSQL.connectionClass ob = new execSQL.connectionClass();
         string sql = "EXEC EOFFICE_NPC.ChungNT.ThongBao_NoiDung_Update @ID, '', '', '', @userID, @userDV, 0, 1";
         SqlParameter[] pa = new SqlParameter[3];
         pa[0] = new SqlParameter("@ID", lbID.Text);
         pa[1] = new SqlParameter("@userID", UserId);
         pa[2] = new SqlParameter("@userDV", lbDonVi.Text);
         DataSet ds = ob.bindDataset(sql, pa);
         if (ds.Tables[0].Rows[0][0].ToString() == "0")
             lbError.Text = "Không thể xóa thông báo";
         else
             Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId));
     }
     catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình gửi thông báo. " + ex.Message; }
 }
Exemplo n.º 19
0
 protected void btTraLoi_Click(object sender, EventArgs e)
 {
     try
     {
         string sql = "EXEC EOFFICE_NPC.ChungNT.ThongBao_TraLoi @ID, @noiSoan, @nguoiSoan, @userID";
         SqlParameter[] pa = new SqlParameter[4];
         pa[0] = new SqlParameter("@ID", lbID.Text);
         pa[1] = new SqlParameter("@noiSoan", lbDonVi.Text);
         pa[2] = new SqlParameter("@nguoiSoan", UserInfo.DisplayName);
         pa[3] = new SqlParameter("@userID", UserId);
         execSQL.connectionClass ob = new execSQL.connectionClass();
         DataSet ds = ob.bindDataset(sql, pa);
         string newID = ds.Tables[2].Rows[0][0].ToString();
         sql = DotNetNuke.Common.Globals.NavigateURL(TabId, "SOAN", "mid/" + ModuleId, "ID/" + newID);
         Response.Redirect(sql);
     }
     catch { }
 }
Exemplo n.º 20
0
        protected void btXoa_Click(object sender, EventArgs e)
        {
            string sql = "EXEC LuuTru.CaNhan_CongVan_Delete @hosoID, @capsoID, @userID";
            SqlParameter[] pa = new SqlParameter[3];
            execSQL.connectionClass ob = new execSQL.connectionClass();
            foreach (TreeNode hoso in tvLuuTru.Nodes)
                foreach (TreeNode node2 in hoso.ChildNodes)
                {
                    if (node2.Checked)
                    {
                        pa[0] = new SqlParameter("@hosoID", hoso.Value);
                        pa[1] = new SqlParameter("@capsoID", node2.Value);
                        pa[2] = new SqlParameter("@userID", UserId);
                        ob.bindDataset(sql, pa);
                    }
                    foreach (TreeNode node3 in node2.ChildNodes)
                        if (node3.Checked)
                        {
                            pa[0] = new SqlParameter("@hosoID", node2.Value);
                            pa[1] = new SqlParameter("@capsoID", node3.Value);
                            pa[2] = new SqlParameter("@userID", UserId);
                            ob.bindDataset(sql, pa);
                        }
                }

            load_data("");
        }
Exemplo n.º 21
0
        protected void btGuiDi_Click(object sender, EventArgs e)
        {
            if (fileUpload.HasFile) btDinhKem_Click(sender, e);
            try
            {
                execSQL.connectionClass ob = new execSQL.connectionClass();
                string sql = "EXEC EOFFICE_NPC.ChungNT.ThongBao_NoiDung_Update @ID, @tieuDe, @noiDung, @nguoiSoan, @userID, @userDV, @parentID, 0";
                SqlParameter[] pa = new SqlParameter[7];
                pa[0] = new SqlParameter("@ID", lbID.Text);
                pa[1] = new SqlParameter("@tieuDe", tbTieuDe.Text);
                pa[2] = new SqlParameter("@noiDung", tbNoiDung.Text);
                pa[3] = new SqlParameter("@nguoiSoan", UserInfo.DisplayName);
                pa[4] = new SqlParameter("@userID", UserId);
                pa[5] = new SqlParameter("@userDV", lbDonVi.Text);
                pa[6] = new SqlParameter("@parentID", Request["PID"] == null ? "0" : Request["PID"]);
                DataSet ds = ob.bindDataset(sql, pa);
                DataSet dsTemp;
                int ok = 0;
                lbID.Text = ds.Tables[0].Rows[0][1].ToString();
                foreach (TreeNode node in tvNguoiNhan.Nodes)
                    foreach (TreeNode child in node.ChildNodes)
                    {
                        sql = "EXEC EOFFICE_NPC.ChungNT.ThongBao_GuiDi @ID, @noiNhan, @userID, @userDV, @DELETE, 0";
                        pa = new SqlParameter[5];
                        pa[0] = new SqlParameter("@ID", lbID.Text);
                        pa[1] = new SqlParameter("@noiNhan", child.Value);
                        pa[2] = new SqlParameter("@userID", UserId);
                        pa[3] = new SqlParameter("@userDV", lbDonVi.Text);
                        pa[4] = new SqlParameter("@DELETE", child.Checked ? 0 : 1);
                        dsTemp = ob.bindDataset(sql, pa);
                        if (dsTemp.Tables[0].Rows[0][0].ToString() == "1") ok++;
                    }

                // Gui theo NHOM
                foreach (TreeNode node2 in tvNhom.Nodes)
                    foreach (TreeNode child2 in node2.ChildNodes)
                        if (child2.Checked)
                        {
                            sql = "EXEC EOFFICE_NPC.ChungNT.ThongBao_GuiDi @ID, '', @userID, @userDV, 0, @nhomID";
                            pa = new SqlParameter[4];
                            pa[0] = new SqlParameter("@ID", lbID.Text);
                            pa[1] = new SqlParameter("@userID", UserId);
                            pa[2] = new SqlParameter("@userDV", lbDonVi.Text);
                            pa[3] = new SqlParameter("@nhomID", child2.Value);
                            dsTemp = ob.bindDataset(sql, pa);
                            if (dsTemp.Tables[0].Rows[0][0].ToString() != "0")
                            {
                                int sl = Convert.ToInt32(dsTemp.Tables[0].Rows[0][0].ToString());
                                ok += sl;
                            }
                        }
                if (ds.Tables[0].Rows[0][0].ToString() == "0" && ok == 0)
                    lbError.Text = "Không thể cập nhật";
                else
                {
                    Load_ThongBao();
                    lbError.Text = string.Format("Gửi thông báo thành công đến <b>{0}</b> đơn vị", ok);
                }
            }
            catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình gửi thông báo. " + ex.Message; }
        }
Exemplo n.º 22
0
        protected void gvDinhKem_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "XOA")
                try
                {
                    Int32 id = Convert.ToInt32(e.CommandArgument);
                    string cmdTxt = "EXEC EOFFICE_NPC.ChungNT.ThongBao_DinhKem_Update @ID, @thongBao, '', '', 0, 0x, @userID, @userDV, 1";
                    SqlParameter[] pa = new SqlParameter[4];
                    pa[0] = new SqlParameter("@ID", gvDinhKem.Rows[id].Cells[0].Text);
                    pa[1] = new SqlParameter("@thongBao", lbID.Text);
                    pa[2] = new SqlParameter("@userID", UserId);
                    pa[3] = new SqlParameter("@userDV", lbDonVi.Text);
                    execSQL.connectionClass ob = new execSQL.connectionClass();
                    ob.bindDataset(cmdTxt, pa);

                    Load_DinhKem();
                    lbError.Text = "Xóa file thành công";
                }
                catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình xóa file. " + ex.Message; }
        }
 protected void BindDropDownDanhMucCap(int id)
 {
     try
     {
         string sql = "EXEC LuuTru.CaNhan_CapHoSo_Select @userID, 1";
         SqlParameter[] pa = new SqlParameter[1];
         pa[0] = new SqlParameter("@userID", UserId);
         execSQL.connectionClass ob = new execSQL.connectionClass();
         DataSet ds = ob.bindDataset(sql, pa);
         ddlCapHoSo.DataSource = ds.Tables[0];
         ddlCapHoSo.DataBind();
     }
     catch { }
 }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            int idhoso = Convert.ToInt32(ddlCapHoSo.SelectedValue.ToString());
            if (idhoso == 0)
            {
                lbMessagePopup.Text = "Chọn cặp hồ sơ để lưu!!!";
            }
            else
            {
                int macongvan;
                int idcapso;

                string sql;
                execSQL.connectionClass ob = new execSQL.connectionClass();
                for (int i = 0; i < gvCongVanDenCanLuu.Rows.Count; i++)
                {

                    macongvan = Convert.ToInt32(gvCongVanDenCanLuu.Rows[i].Cells[0].Text);
                    idcapso = Convert.ToInt32(gvCongVanDenCanLuu.Rows[i].Cells[2].Text);

                    sql = "EXEC LuuTru.CaNhan_CongVan_Luu @MaCV, @HoSo, @IDCapSo";
                    SqlParameter[] pa = new SqlParameter[3];
                    pa[0] = new SqlParameter("@MaCV", macongvan);
                    pa[1] = new SqlParameter("@HoSo", idhoso);
                    pa[2] = new SqlParameter("@IDCapSo", idcapso);
                    ob.bindDataset(sql, pa);
                }
                Popup(false);
            }
            BindGridViewCongVan();
        }
Exemplo n.º 25
0
        protected void btDinhKem_Click(object sender, EventArgs e)
        {
            if (fileUpload.HasFile)
                try
                {
                    int fileLenght = fileUpload.PostedFile.ContentLength;
                    byte[] fileData = new byte[fileLenght];
                    fileUpload.PostedFile.InputStream.Read(fileData, 0, fileLenght);
                    string cmdTxt = "EXEC EOFFICE_NPC.ChungNT.ThongBao_DinhKem_Update 0, @thongBao, @fileName, @fileType, @fileSize, @fileData, @userID, @userDV, 0";
                    SqlParameter[] pa = new SqlParameter[7];
                    pa[0] = new SqlParameter("@thongBao", lbID.Text);
                    pa[1] = new SqlParameter("@fileName", fileUpload.FileName);
                    pa[2] = new SqlParameter("@fileType", fileUpload.PostedFile.ContentType);
                    pa[3] = new SqlParameter("@fileSize", fileLenght);
                    pa[4] = new SqlParameter("@fileData", fileData);
                    pa[5] = new SqlParameter("@userID", UserId);
                    pa[6] = new SqlParameter("@userDV", lbDonVi.Text);
                    execSQL.connectionClass ob = new execSQL.connectionClass();
                    ob.bindDataset(cmdTxt, pa);

                    Load_DinhKem();
                    lbError.Text = "Đính kèm file thành công";
                }
                catch (Exception ex) { lbError.Text = "Có lỗi trong quá trình đính kèm file. " + ex.Message; }
        }