Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         string ls_docid = "";
         if (this.Request.QueryString["docid"] != null)
         {
             ls_docid = this.Request.QueryString["docid"].ToString();
         }
         string ls_name = "";
         if (this.Request.QueryString["name"] != null)
         {
             ls_name = this.Request.QueryString["name"].ToString();
         }
         string ls_url = "";
         if (this.Request.QueryString["url"] != null)
         {
             ls_url = this.Request.QueryString["url"].ToString();
         }
         if (ls_docid != "")
         {
             HyoaClass.Hyoa_ntkoesp Hyoa_ntkoesp = new HyoaClass.Hyoa_ntkoesp();
             Hyoa_ntkoesp.espid = ls_docid;
             Hyoa_ntkoesp.espname = ls_name;
             Hyoa_ntkoesp.UpdateNameByDocid();
             Response.Write("<script>window.location='" + ls_url + "';</script>");
         }
     }
 }
Пример #2
0
 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyoaClass.Hyoa_ntkoesp Hyoa_ntkoesp = new HyoaClass.Hyoa_ntkoesp();
     String[] v_uids = this.txtuids.Value.Split(',');
     for (var i = 0; i < v_uids.Length; i++)
     {
         if (v_uids[i] != "")
         {
             //删除附件
             DataTable dt;
             dt = Hyoa_ntkoesp.Getesp(v_uids[i]);
             if (dt.Rows.Count > 0)
             {
                 string ls_filepath = Server.MapPath("~/") + "NTKO/" + dt.Rows[0]["espurl"].ToString();
                 if (File.Exists(ls_filepath))
                 {
                     System.IO.File.Delete(ls_filepath);
                 }
             }
             Hyoa_ntkoesp.espid = v_uids[i];
             Hyoa_ntkoesp.Delete();
         }
     }
     this.txtuids.Value = "";
     //DataPlay(1);
     DataPlay(System.Int32.Parse(this.curpage.Text));
 }
Пример #3
0
        //保存esp印章文件
        public void saveesp()
        {
            string esppath = Server.MapPath("esp").ToString();//上传印章文件的路径

            System.Web.HttpFileCollection uploadFiles = Request.Files;
            System.Web.HttpPostedFile theFile;

            try
            {
                string docid = Request.Form["txtdocid"];
                for (int i = 0; i < uploadFiles.Count; i++)
                {
                    theFile = uploadFiles[i];
                    fname = fname.Replace(":", ".");//上传文件到磁盘,文件名中不允许带:符号
                    theFile.SaveAs(esppath + @"\" + docid + ".esp");
                    //Response.Write("保存成功!<br>");
                    //Response.Write("印章名称: " + fname + "<br>");
                    //Response.Write("文件大小: " + theFile.ContentLength.ToString() + "	bytes<br>");
                }

                //插入SQL记录
                string SignName = Request.Form["SignName"];
                string txthy_bsqrname = Request.Form["txthy_bsqrname"];
                string txthy_bsqrid = Request.Form["txthy_bsqrid"];
                string Password1 = Request.Form["Password1"];
                string Sort = Request.Form["Sort"];

                //Response.Write(SignName);
                //Response.Write(txthy_bsqrname);
                //Response.Write(txthy_bsqrid);
                //Response.Write(Password1);

                HyoaClass.Hyoa_ntkoesp Hyoa_ntkoesp = new HyoaClass.Hyoa_ntkoesp();

                Hyoa_ntkoesp.espid = docid;
                Hyoa_ntkoesp.espname = docid;       //临时存放文档ID,主要是因为编码问题
                Hyoa_ntkoesp.esppassword = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(Password1, "MD5");
                Hyoa_ntkoesp.espsort = System.Int32.Parse(Sort);
                Hyoa_ntkoesp.esptype = "发文";
                Hyoa_ntkoesp.espurl = "esp/" + docid + ".esp";
                Hyoa_ntkoesp.espuserid = txthy_bsqrid;
                Hyoa_ntkoesp.espusername = txthy_bsqrname;
                Hyoa_ntkoesp.Insert();

                string url = Request.Form["url"].ToString();
                Response.Write("<script>window.close();if(window.opener){window.opener.document.getElementById('btnespeditname').click();};</script>");
            }
            catch (Exception err) { Response.Write(err.Message); }
        }
Пример #4
0
        //ntko_class db = new ntko_class();//实例ntko_class类
        protected void Page_Load(object sender, EventArgs e)
        {
            //title = db.getdemotitle();
            //attachpath = db.getattachpath();
            if (this.Session["hyuid"].ToString() == "")
                this.Response.Redirect("../login.aspx?url=" + this.Request.RawUrl);

            //加载模板
            HyoaClass.Hyoa_ntkotemplateFile Hyoa_ntkotemplateFile = new HyoaClass.Hyoa_ntkotemplateFile();
            DataTable dt_templateFile = Hyoa_ntkotemplateFile.GettemplateFiles();
            this.templateFile.DataSource = dt_templateFile;
            this.templateFile.DataTextField = "templateFilename";
            this.templateFile.DataValueField = "templateFileurl";
            this.templateFile.DataBind();
            this.templateFile.Items.Insert(0, new ListItem("--请选择模板--", ""));
            this.templateFile.SelectedIndex = 0;

            //加载印章
            HyoaClass.Hyoa_ntkoesp Hyoa_ntkoesp = new HyoaClass.Hyoa_ntkoesp();
            DataTable dt_esp = Hyoa_ntkoesp.Getesps();
            this.SignFileUrl.DataSource = dt_esp;
            this.SignFileUrl.DataTextField = "espname";
            this.SignFileUrl.DataValueField = "espurl";
            this.SignFileUrl.DataBind();
            this.SignFileUrl.Items.Insert(0, new ListItem("--请选择印章--", ""));
            this.SignFileUrl.SelectedIndex = 0;

            //加载红头
            HyoaClass.Hyoa_ntkohongtou Hyoa_ntkohongtou = new HyoaClass.Hyoa_ntkohongtou();
            DataTable dt_hongtou = Hyoa_ntkohongtou.Gethongtous();
            this.redHeadTemplateFile.DataSource = dt_hongtou;
            this.redHeadTemplateFile.DataTextField = "hongtouname";
            this.redHeadTemplateFile.DataValueField = "hongtouurl";
            this.redHeadTemplateFile.DataBind();
            this.redHeadTemplateFile.Items.Insert(0, new ListItem("--请选择红头--", ""));
            this.redHeadTemplateFile.SelectedIndex = 0;

            title = "宁波合益";
            hyusername = this.Session["hyuname"].ToString();
            //设置第一环节是否在痕迹模式下编辑
            tacheByhj = "0";//痕迹模式下编辑
            if (this.Request.QueryString["tacheByhj"] != null)
            {
                if (this.Request.QueryString["tacheByhj"].ToString() == "1")
                {
                    tacheByhj = "1";    //非痕迹模式下编辑
                }
            }
            //是否显示接受修订按钮
            if (this.Request.QueryString["jsxd"] != null)
            {
                if (this.Request.QueryString["jsxd"].ToString() == "1")
                {
                    btnjsxd = "<input id=\"Button2\" type=button style =\"width:70px;height:23px;\" onclick=\"TANGER_OCX_AllRevisions(true);\" runat=\"server\" value=\" 接受修订\"  />";
                }
            }

            newofficetype = Request.QueryString["newofficetype"];
            HyoaClass.Hyoa_ntko Hyoa_ntko = new HyoaClass.Hyoa_ntko();
            if (this.Request.QueryString["fatherid"] != null)
            {
                fatherid = this.Request.QueryString["fatherid"].ToString();

                DataTable dtfatherid = Hyoa_ntko.GetntkofileByfother(fatherid);
                //this.Response.Write("<script>alert('" + dtfatherid.Rows.Count + "');</script>");
                if (dtfatherid.Rows.Count > 0)
                {
                    url = dtfatherid.Rows[0]["fid"].ToString();

                    DataTable dt = Hyoa_ntko.Getntkofile(url);
                    if (dt.Rows.Count > 0)
                    {
                        fileid = dt.Rows[0]["fid"].ToString();
                        filetitle = dt.Rows[0]["ftitle"].ToString();
                        fileother = dt.Rows[0]["fother"].ToString();
                        filename = dt.Rows[0]["fname"].ToString();
                    }
                }
            }

            tableid = "";
            if (this.Request.QueryString["tableid"] != null)
            {
                tableid = Request.QueryString["tableid"].ToString();
            }

            //隐藏控制(根据fatherid)
            string ls_flowid = "";
            string ls_currenttacheid = "";
            HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            string sql = "";
            sql = "select * from hyc_" + tableid + " where DOCID='" + fatherid + "' ";
            DataTable dt_flowmain = Hyoa_global.GetDataTable(sql);
            if (dt_flowmain.Rows.Count > 0)
            {
                ls_flowid = dt_flowmain.Rows[0]["hy_flowid"].ToString();
                ls_currenttacheid = dt_flowmain.Rows[0]["hy_curtacheid"].ToString();
                //根据当前环节ID得到对应的隐藏权限
                DataTable dt_flowtachefield = Hyoa_flowtachefield.Getflowtachefield_gl(ls_flowid, ls_currenttacheid);
                if (dt_flowtachefield.Rows.Count > 0)
                {
                    for (var i = 0; i < dt_flowtachefield.Rows.Count; i++)
                    {
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "选择模板")
                        {
                            xuanzemubangongneng.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "界面设置")
                        {
                            jiemianshezhi.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "打印控制")
                        {
                            dayinkongzhi.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "印章和图片")
                        {
                            yinzhanghetupiangongneng.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "套红功能")
                        {
                            taohonggongneng.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "接受修订")
                        {
                            jieshouxiuding.Visible = true;
                        }
                        if (dt_flowtachefield.Rows[i]["hy_fieldname"].ToString() == "权限控制")
                        {
                            quanxiankongzhi.Visible = true;
                        }
                    }
                }
            }
            else
            {
                //未找到,则默认权限
                xuanzemubangongneng.Visible = true;
                jiemianshezhi.Visible = true;
                dayinkongzhi.Visible = true;
                yinzhanghetupiangongneng.Visible = true;
                taohonggongneng.Visible = true;
                jieshouxiuding.Visible = true;
                quanxiankongzhi.Visible = true;
            }

            //生成痕迹稿start
            //在接受修订环节,打开文档时生成痕迹稿。
            string lsMapPath="";
            string lsMapPathsdec = "";
            if (this.Request.QueryString["jsxd"] != null)
            {
                if (this.Request.QueryString["jsxd"].ToString() == "1")
                {
                    lsMapPath = Server.MapPath("~/")+"/NTKO/uploadOfficeFile/"+filename;    //虚拟目录的位置
                    if (filename.IndexOf(".doc") > 0)
                    {
                        lsMapPathsdec = Server.MapPath("~/") + "/NTKO/uploadOfficeFile/" + filename.Substring(0, filename.IndexOf(".doc")) + "hjbl" + ".doc";//虚拟目录的位置
                    }
                    if (filename.IndexOf(".wps") > 0)
                    {
                        lsMapPathsdec = Server.MapPath("~/") + "/NTKO/uploadOfficeFile/" + filename.Substring(0, filename.IndexOf(".wps")) + "hjbl" + ".wps";//虚拟目录的位置
                    }
                        //File.Delete(lsMapPathsdec);
                    if (File.Exists(lsMapPathsdec))
                    {
                        //如果文件已经存在了,就不用产生痕迹稿了
                    }
                    else
                    {   //如果没有生成则生成痕迹稿
                        File.Copy(lsMapPath, lsMapPathsdec, false);
                    }

                }
            }
            //生成痕迹稿end
        }
Пример #5
0
    private void DataPlay(int PageNo)
    {
        //判断当前用户是否有新建删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        string ls_mudelid = "";
        string ls_role = "";
        if (Request.QueryString["mid"] != null)
        {
            ls_mudelid = Request.QueryString["mid"].ToString();
        }
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        DataTable dt_mudel = Hyoa_mudel.Getmudel(ls_mudelid);
        if (dt_mudel.Rows.Count > 0)
        {
            ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString();
        }
        if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
        {
            this.isrole.Value = "1";
            this.tdnewdoc.Visible = true; //新建
            this.tddeldoc.Visible = true; //删除
        }
        else
        {
            this.isrole.Value = "0";
            this.tdnewdoc.Visible = false; //新建
            this.tddeldoc.Visible = false; //删除
        }

        //得到当前页号
        this.curpage.Text = PageNo.ToString();
        HyoaClass.Hyoa_ntkoesp Hyoa_ntkoesp = new HyoaClass.Hyoa_ntkoesp();

        DataTable dt;
        dt = Hyoa_ntkoesp.Getesps();

        DataTable tempTable = dt.Clone();
        for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            tempTable.Rows.Add(dr);
        }

        int TotalRecord = dt.Rows.Count;
        this.sumts.Text = TotalRecord.ToString();
        this.sumts2.Text = TotalRecord.ToString();
        this.ShowTotalRecord.Text = TotalRecord.ToString();
        //计算及显示总页数
        int TotalPage;
        if (TotalRecord < System.Int32.Parse(PageSize.Text))
        {
            TotalPage = 1;
        }
        else
        {
            if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0)
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1;

            }
            else
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text);

            }
        }
        this.ShowTotalPage.Text = TotalPage.ToString();
        this.rptlist.DataSource = tempTable;
        this.rptlist.DataBind();
        dt.Clear();
    }