Exemplo n.º 1
0
        protected void btCDGui_Click(object sender, EventArgs e)
        {
            if (tbChiDao.Text.Length == 0)
            {
                lbError.Text = "* Chưa có nội dung chỉ đạo";
                return;
            }
            execSQL.connectionClass ob = new execSQL.connectionClass();
            csBanTTAT ob2 = new csBanTTAT();
            string maDV, dvGui, dvNhan, cmd;
            int dem = 0;
            DataSet ds;
            maDV = Request.ApplicationPath.ToUpper() == "/BANTTAT" ? "F01P11" : UserInfo.Profile.GetPropertyValue("MaDonVi");
            dvGui = ob2.get_code(maDV, out dvNhan);
            foreach (GridViewRow row in gvChiDao.Rows)
            {
                CheckBox cb = (CheckBox)row.FindControl("cbChiDao");
                if (cb.Checked) try
                    {
                        cmd = string.Format("EXEC EOFFICE_NPC.ChungNT.P11_setShare {0}, 0, '', '{1}', '{2}', N'{3}', {4}", lbID.Text, dvGui, row.Cells[1].Text, tbChiDao.Text, UserId);
                        ds = ob.fillDataset(cmd);
                        ds.Tables[0].Rows[0][0].ToString();
                        dem++;

                    }
                    catch { }
            }

            ChiDao_Load();
            tbChiDao.Text = "";
            lbError.Text = string.Format("Chỉ đạo thành công {0} đơn vị", dem);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            try
            {
                string maDV = Request.ApplicationPath.ToUpper() == "/BANTTAT" ? "F01P11" : UserInfo.Profile.GetPropertyValue("MaDonVi");
                btThemCV.Visible = maDV == "F01P11";

                csBanTTAT ob = new csBanTTAT();
                string dvNhan;
                string cmd = string.Format("EXEC ChungNT.P11_getCV_DonVi '{0}'", ob.get_code(maDV, out dvNhan));
                DataSet ds = ob.fillDataset(cmd);
                DataColumn dc = new DataColumn("linkView");
                ds.Tables[0].Columns.Add(dc);
                ds.Tables[0].AcceptChanges();
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    row.BeginEdit();
                    row["linkView"] = DotNetNuke.Common.Globals.NavigateURL(TabId, "EDIT", "mid/" + ModuleId, "ID/" + row[0].ToString());
                    row.EndEdit();
                }
                dlCongVan.DataSource = ds;
                dlCongVan.DataBind();
            }
            catch { }
        }
Exemplo n.º 3
0
        protected void CV_Load()
        {
            try
            {
                csBanTTAT ob = new csBanTTAT();
                DataSet ds = ob.fillDataset("EXEC ChungNT.P11_getCongVan " + lbID.Text);
                if (lbID.Text != "0")
                {
                    lbID.Text = ds.Tables[0].Rows[0][0].ToString();
                    tbSo.Text = ds.Tables[0].Rows[0][1].ToString();
                    tbNgay.Text = ds.Tables[0].Rows[0][2].ToString();
                    tbKyHieu.Text = ds.Tables[0].Rows[0][3].ToString();
                    tbLinhVuc.Text = ds.Tables[0].Rows[0][4].ToString();
                    tbNoiGui.Text = ds.Tables[0].Rows[0][5].ToString();
                    tbTrichYeu.Text = ds.Tables[0].Rows[0][6].ToString();
                    tbButPhe.Text = ds.Tables[0].Rows[0][7].ToString();
                    tbGhiChu.Text = ds.Tables[0].Rows[0][8].ToString();
                }
                gvDinhKem.DataSource = ds.Tables[1];
                gvDinhKem.DataBind();
            }
            catch
            {
                lbID.Text = "0";
                lbError.Text = "Có lỗi xảy ra trong quá trình đọc dữ liệu";
            }

            BaoCao_Load();
        }
Exemplo n.º 4
0
 protected void ChiDao_Load()
 {
     try
     {
         execSQL.connectionClass ob = new execSQL.connectionClass();
         csBanTTAT ob2 = new csBanTTAT();
         string dvNhan;
         string maDV = Request.ApplicationPath.ToUpper() == "/BANTTAT" ? "F01P11" : UserInfo.Profile.GetPropertyValue("MaDonVi");
         string cmd = string.Format("EXEC EOFFICE_NPC.ChungNT.P11_getChiDao '{0}', {1}, 1, {2}", ob2.get_code(maDV, out dvNhan), lbID.Text, dlDonVi.SelectedValue);
         gvChiDao.DataSource = ob.fillDataset(cmd);
         gvChiDao.DataBind();
         lbError.Text = string.Format("Hiển thị {0} bản ghi", gvChiDao.Rows.Count);
     }
     catch { }
 }
Exemplo n.º 5
0
        protected void file_upload()
        {
            if (fileUpload.HasFile)
                try
                {
                    string my_folder = DateTime.Today.ToString("yyyy-MM");
                    string cmdTxt = string.Format("EXEC ChungNT.P11_setFile {0}, N'{1}', '{2}', '{3}', {4}", lbID.Text, fileUpload.FileName, my_folder, fileUpload.PostedFile.ContentType, UserId);
                    csBanTTAT ob = new csBanTTAT();
                    DataSet ds = ob.fillDataset(cmdTxt);
                    my_folder = Server.MapPath(@"Portals\0\") + my_folder + @"\";
                    if (Directory.Exists(my_folder) == false) Directory.CreateDirectory(my_folder);
                    fileUpload.SaveAs(my_folder + ds.Tables[0].Rows[0][0].ToString());

                    ds = ob.fillDataset("EXEC ChungNT.P11_getCongVan " + lbID.Text);
                    gvDinhKem.DataSource = ds.Tables[1];
                    gvDinhKem.DataBind();
                }
                catch { lbError.Text = "Có lỗi trong quá trình đính kèm"; }
            else lbError.Text = "Chưa chọn file đính kèm";
        }
Exemplo n.º 6
0
 protected void BaoCao_Load()
 {
     try
     {
         string maDV = Request.ApplicationPath.ToUpper() == "/BANTTAT" ? "F01P11" : UserInfo.Profile.GetPropertyValue("MaDonVi");
         bool ok = maDV == "F01P11";
         btUpload.Visible = ok;
         btCapNhat.Visible = ok;
         btChuyenCV.Visible = lbID.Text != "0";
         btXoa.Visible = ok && lbID.Text != "0";
         Panel1.Visible = !ok && lbID.Text != "0";
         if (!ok && lbID.Text != "0")
         {
             csBanTTAT ob = new csBanTTAT();
             string dvNhan;
             string cmd = string.Format("EXEC ChungNT.P11_getBaoCao {0}, '{1}'", lbID.Text, ob.get_code(maDV, out dvNhan));
             gvBaoCao.DataSource = ob.fillDataset(cmd).Tables[0];
             gvBaoCao.DataBind();
         }
     }
     catch { }
 }
Exemplo n.º 7
0
        protected void btBaoCao_Click(object sender, EventArgs e)
        {
            if (tbBaoCao.Text.Length == 0)
            {
                lbBaoCao.Text = "* Chưa có nội dung báo cáo";
                return;
            }
            try
            {
                csBanTTAT ob = new csBanTTAT();
                string maDV = Request.ApplicationPath.ToUpper() == "/BANTTAT" ? "F01P11" : UserInfo.Profile.GetPropertyValue("MaDonVi");
                string dvNhan;
                string dvGui = ob.get_code(maDV, out dvNhan);
                string cmd = string.Format("EXEC ChungNT.P11_setShare {0}, 1, '', '{1}', '{2}', N'{3}', {4}", lbID.Text, dvGui, dvNhan, tbBaoCao.Text, UserId);
                ob.fillDataset(cmd);

                BaoCao_Load();
                tbBaoCao.Text = "";
                lbBaoCao.Text = "Cập nhật báo cáo lúc " + DateTime.Now.ToString("HH:mm dd/MM/yyyy");
            }
            catch { lbBaoCao.Text = "Có lỗi xảy ra trong quá trình cập nhật báo cáo"; }
        }
Exemplo n.º 8
0
 protected void btCapNhat_Click(object sender, EventArgs e)
 {
     if (fileUpload.HasFile) file_upload();
     try
     {
         csBanTTAT ob = new csBanTTAT();
         string cmdTxt = string.Format("EXEC ChungNT.P11_setCongVan {0}, '{1}', '{2}', '{3}', N'{4}', N'{5}', N'{6}', N'{7}', N'{8}', N'{9}', {10}",
             lbID.Text, "F01P11", tbSo.Text, ob.dateFormat(tbNgay.Text), tbKyHieu.Text, tbLinhVuc.Text, tbNoiGui.Text, tbTrichYeu.Text, tbButPhe.Text, tbGhiChu.Text, UserId);
         DataSet ds = ob.fillDataset(cmdTxt);
         lbID.Text = ds.Tables[0].Rows[0][0].ToString();
         if (ds.Tables[0].Rows[0][1].ToString() == "0")
             lbError.Text = "Tài khoản không có quyền cập nhật công văn này";
         else
         {
             CV_Load();
             lbError.Text = "Cập nhật dữ liệu lúc " + DateTime.Now.ToString("HH:mm dd/MM/yyyy");
         }
     }
     catch { lbError.Text = "Có lỗi xảy ra trong quá trình cập nhật"; }
 }
Exemplo n.º 9
0
 protected void btXoa_Click(object sender, EventArgs e)
 {
     try
     {
         csBanTTAT ob = new csBanTTAT();
         string cmdTxt = string.Format("EXEC ChungNT.P11_setCongVan {0}, 'DEL', '', '', '', '', '', '', '', '', {1}", lbID.Text, UserId);
         DataSet ds = ob.fillDataset(cmdTxt);
         lbID.Text = ds.Tables[0].Rows[0][0].ToString();
         if (ds.Tables[0].Rows[0][1].ToString() == "0")
             lbError.Text = "Tài khoản không có quyền cập nhật công văn này";
         else
             Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId));
     }
     catch { lbError.Text = "Có lỗi xảy ra trong quá trình xóa dữ liệu"; }
 }