コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string ls_docids="";
        string ls_filepath="";

        if (this.Request.QueryString["docids"] != null)
        {
            ls_docids = this.Request.QueryString["docids"].ToString();
        }
        string[] lv_docids;
        lv_docids = ls_docids.Split(',');
        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        DataTable dt = new DataTable();
        for (int j = 0; j < lv_docids.Length; j++)
        {
            dt = Hyoa_fileatt.Getfileatt(lv_docids[j]);
            if (dt.Rows[0]["hy_userid"].ToString() == Session["hyuid"].ToString() || Hyoa_global.isHaveRole("Role9995", Session["hyuid"].ToString()))
            {
                ls_filepath = Server.MapPath("~/") + dt.Rows[0]["hy_filepath"].ToString();
                //this.Response.Write(ls_filepath);
                //return;
                if (File.Exists(ls_filepath))
                {
                    System.IO.File.Delete(ls_filepath);
                }
                Hyoa_fileatt.ID = lv_docids[j];
                Hyoa_fileatt.Delete();
            }
            dt.Clear();
        }
        this.Response.Write("aaa");
        return ;
    }
コード例 #2
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";
        string ls_attsize = "";
        string str_path = "";
        string lspath = "";
        string lsguid = "";
        string lsurl = "";
        string lsfilename = "";
        string lshy_fatherfield = "";

        lsfilename = FileUpload1.FileName;
        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (lsfilename != "")  //attsize
        {
            lshy_fatherfield = "";
            ls_attsize = System.Convert.ToString(System.Convert.ToDouble(System.Convert.ToInt32(System.Convert.ToDouble(FileUpload1.PostedFile.ContentLength.ToString()) / 1024 / 1024 * 1000)) / 1000);//附件的大小
            lsguid = Hyoa_global.GetRandom();
            System.Console.WriteLine(lsguid);
            //SaveCommon(ls_path, ls_attsize, lsguid);
            //将附件上传到服务器目录下
            lspath = Server.MapPath("~/");//虚拟目录的位置
            lsurl = "fileatt\\" + lsguid; //存放的文件夹

            Directory.CreateDirectory(lspath + "\\" + lsurl);
            str_path = lspath + "\\" + lsurl + "\\" + lsfilename;
            FileUpload1.SaveAs(str_path);
            Hyoa_fileatt.ID = lsguid;
            Hyoa_fileatt.hy_fatherid = this.txtfatherid.Value;
            if (this.txtfilename.Text == "")
            {
                Hyoa_fileatt.hy_filename = lsfilename;
            }
            else
            {
                Hyoa_fileatt.hy_filename = this.txtfilename.Text;
            }
            Hyoa_fileatt.hy_filepath = lsurl + "\\" + lsfilename;
            Hyoa_fileatt.hy_filesize = ls_attsize;
            Hyoa_fileatt.hy_userid = this.Session["hyuid"].ToString();
            Hyoa_fileatt.hy_djsj = System.DateTime.Now.ToString();
            if (this.Request.QueryString["fatherfield"] != null)
            {
                lshy_fatherfield = this.Request.QueryString["fatherfield"].ToString();   ////父文档配置的域名
            }
            Hyoa_fileatt.hy_fatherfield = lshy_fatherfield;
            Hyoa_fileatt.Insert();

        }
        else
        {
            this.Response.Write("<script>alert('请选择要上传的文件!');</script>");
        }

        Response.Write("<script>alert('" + ls_tip + "');var lsurl = window.location.href;window.location = lsurl;window.opener.document.getElementById('btn_sxfj').onclick(); </script>");
    }
コード例 #3
0
    private void DataPlay()
    {
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();
        }
        HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail();
        DataTable dt = Hyoa_mail.Getmail(this.txtid.Value);
        if (dt.Rows.Count > 0)
        {
            this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString();
            this.txtid.Value = dt.Rows[0]["ID"].ToString();

            this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
            this.txtfsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
            this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString();
            this.txtfrsname.Text = dt.Rows[0]["hy_fsrname"].ToString();
            this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString();
            this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString();
            this.lblhy_title.Text = dt.Rows[0]["hy_title"].ToString();

            //附件
            HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
            DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
            if (dt_fileatt.Rows.Count > 0)
            {
                string ls_temp = "";
                for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                {
                    ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                }
                this.lblhy_field2.Text = ls_temp;
            }

            this.lblhy_content1.Text = dt.Rows[0]["hy_body"].ToString();
        }

        //20120210 start
        string sccksj = System.DateTime.Now.ToString();
        string sql = "";
        if (dt.Rows[0]["hy_type"].ToString() == "收件" & dt.Rows[0]["hy_sccksj"].ToString() == "")
        {
            sql = "update hyt_mail set hy_sccksj = '" + sccksj + "' where ID='" + this.txtid.Value + "' ";
            Hyoa_global.ExcuteSQL(sql);

        }
        //20120210 end
    }
コード例 #4
0
    private void DataPlay()
    {
        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
        string ls_att = "";
        this.lbupfile.Text = "无附件!";
        if (this.Request.QueryString["fatherid"] != null)
            {
                DataTable dt = Hyoa_fileatt.GetfileattByFatherid(this.Request.QueryString["fatherid"].ToString());   //是否弹出窗口
                if (dt.Rows.Count > 0)
                {
                    for(int j=0;j<dt.Rows.Count;j++)
                    {
                        ls_att += (j+1).ToString()+ "、<a href=\"" + "\\" + dt.Rows[j]["hy_filepath"].ToString() + "\" target=_blank>" + dt.Rows[j]["hy_filename"].ToString() + "</a><br />";

                    }
                    this.lbupfile.Text = ls_att;
                }
            }
    }
コード例 #5
0
ファイル: list_cbsx.aspx.cs プロジェクト: wjszxli/Webapp
    protected void btndelinfo_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
        String[] v_uids = this.txtuids.Value.Split(',');
        string ls_filepath = "";
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                Hyoa_flowmain.DOCID = v_uids[i];
                Hyoa_flowmain.Delete();
                //删除文档时将待办事宜删除start
                HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
                Hyoa_dbsy.DOCID = v_uids[i];
                Hyoa_dbsy.Deletebydocid(v_uids[i]);
                //删除文档时将待办事宜删除end

                //删的时候将附件也删除start
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]);
                if (dtfileatt.Rows.Count > 0)
                {
                    for (int k = 0; k < dtfileatt.Rows.Count; k++)
                    {
                        ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString();
                        if (File.Exists(ls_filepath))
                        {
                            System.IO.File.Delete(ls_filepath);
                        }
                        Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString();
                        Hyoa_fileatt.Delete();
                    }
                }
                //删的时候将附件也删除end
            }
        }
        this.txtuids.Value = "";
        DataPlay(System.Int32.Parse(this.curpage.Text));
    }
コード例 #6
0
ファイル: list.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyoaClass.Hyoa_gwk Hyoa_gwk = new HyoaClass.Hyoa_gwk();
     HyoaClass.Hyoa_gwksc Hyoa_gwksc = new HyoaClass.Hyoa_gwksc();
     String[] v_uids = this.txtuids.Value.Split(',');
     for (var i = 0; i < v_uids.Length; i++)
     {
         if (v_uids[i] != "")
         {
             Hyoa_gwk.ID = v_uids[i];
             Hyoa_gwk.Delete();
             //删除公文的同时删除我的收藏中对应的公文记录
             Hyoa_gwksc.gwk_id = v_uids[i];
             Hyoa_gwksc.DeleteBygwkid();
             //删除当前记录对应的附件(公文库中新增的附件)
             HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
             DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]);
             if (dtfileatt.Rows.Count > 0)
             {
                 string ls_filepath = "";
                 for (int k = 0; k < dtfileatt.Rows.Count; k++)
                 {
                     ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString();
                     if (File.Exists(ls_filepath))
                     {
                         System.IO.File.Delete(ls_filepath);
                     }
                     Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString();
                     Hyoa_fileatt.Delete();
                 }
             }
         }
     }
     this.txtuids.Value = "";
     DataPlay(System.Int32.Parse(this.curpage.Text));
 }
コード例 #7
0
ファイル: main_mail.aspx.cs プロジェクト: wjszxli/Webapp
    private void returnmail()
    {
        string lsreturnmailid = "";
        if (this.Request.QueryString["returnmailid"] != null)
        {
            lsreturnmailid = this.Request.QueryString["returnmailid"].ToString();   //是否弹出窗口
            HyoaClass.DAO db = new HyoaClass.DAO();
            DataTable dt;
            DataTable dtjsr;
            //信息中的转发
            string lssql ="";
            if (this.Request.QueryString["returnmid"].ToString() == "xxgl")
            {
                lssql = "select * from hyp_flowmain where hy_mudelid='xxgl' and hy_tableid='1a564b74-3d94-4cef-bb94-f0c0342ae8dd' and DOCID='" + lsreturnmailid + "'";
                dt = db.GetDataTable(lssql);
                this.txthy_title.Text = dt.Rows[0]["hy_bt"].ToString();
                this.hy_content1.Value = dt.Rows[0]["hy_content1"].ToString();
                string lssqljsr = "SELECT * FROM hyp_flowmain WHERE (hy_mudelid = 'returnmail') AND (hy_tableid = '70ed517c-6382-4e34-9316-0aa090f9b9e0') and hy_djrid='" + this.Session["hyuid"].ToString() + "'";
                dtjsr = db.GetDataTable(lssqljsr);
                string lsjsr = "";
                for (int jj = 0; jj < dtjsr.Rows.Count; jj++)
                {
                    if (lsjsr == "")
                    {
                        lsjsr = dtjsr.Rows[jj]["hy_field2"].ToString();
                    }
                    else
                    {
                        lsjsr += "," + dtjsr.Rows[jj]["hy_field2"].ToString();
                    }
                }
                this.txthy_wbjsrid.Text = lsjsr;
            }
            else if (this.Request.QueryString["returnmid"].ToString() == "moduleggps")
            {
                lssql = "select * from hyp_flowmain where hy_mudelid='moduleggps' and hy_tableid='bb523c42-d9ae-40cd-9bba-c3a99c2e1d54' and DOCID='" + lsreturnmailid + "'";
                dt = db.GetDataTable(lssql);
                this.txthy_title.Text = dt.Rows[0]["hy_bt"].ToString();
                this.hy_content1.Value = dt.Rows[0]["hy_content1"].ToString();
                string lssqljsr = "SELECT * FROM hyp_flowmain WHERE (hy_mudelid = 'returnmail') AND (hy_tableid = '70ed517c-6382-4e34-9316-0aa090f9b9e0') and hy_djrid='" + this.Session["hyuid"].ToString() + "'";
                dtjsr = db.GetDataTable(lssqljsr);
                string lsjsr = "";
                for (int jj = 0; jj < dtjsr.Rows.Count; jj++)
                {
                    if (lsjsr == "")
                    {
                        lsjsr = dtjsr.Rows[jj]["hy_field2"].ToString();
                    }
                    else
                    {
                        lsjsr += "," + dtjsr.Rows[jj]["hy_field2"].ToString();
                    }
                }
                this.txthy_wbjsrid.Text = lsjsr;
            }
            else if (this.Request.QueryString["returnmid"].ToString() == "moduleqjzl")
            {
                lssql = "select * from hyp_flowmain where hy_mudelid='moduleqjzl' and hy_tableid='ac5e8ddd-d74c-4c9d-b0bf-5c23fc77b589' and DOCID='" + lsreturnmailid + "'";
                dt = db.GetDataTable(lssql);
                this.txthy_title.Text = dt.Rows[0]["hy_bt"].ToString();
                this.hy_content1.Value = dt.Rows[0]["hy_content2"].ToString();
                string lssqljsr = "SELECT * FROM hyp_flowmain WHERE (hy_mudelid = 'returnmail') AND (hy_tableid = '70ed517c-6382-4e34-9316-0aa090f9b9e0') and hy_djrid='" + this.Session["hyuid"].ToString() + "'";
                dtjsr = db.GetDataTable(lssqljsr);
                string lsjsr = "";
                for (int jj = 0; jj < dtjsr.Rows.Count; jj++)
                {
                    if (lsjsr == "")
                    {
                        lsjsr = dtjsr.Rows[jj]["hy_field2"].ToString();
                    }
                    else
                    {
                        lsjsr += "," + dtjsr.Rows[jj]["hy_field2"].ToString();
                    }
                }
                this.txthy_wbjsrid.Text = lsjsr;
            }
            else if (this.Request.QueryString["returnmid"].ToString() == "gzyhbsh")
            {
                lssql = "select * from hyp_flowmain where hy_mudelid='gzyhbsh' and hy_tableid='7d03c313-186d-4859-9efa-acde27f4eff2' and DOCID='" + lsreturnmailid + "'";
                dt = db.GetDataTable(lssql);
                this.txthy_title.Text = dt.Rows[0]["hy_bt"].ToString();
                this.hy_content1.Value = dt.Rows[0]["hy_content1"].ToString();
                string lssqljsr = "SELECT * FROM hyp_flowmain WHERE (hy_mudelid = 'returnmail') AND (hy_tableid = '70ed517c-6382-4e34-9316-0aa090f9b9e0') and hy_djrid='" + this.Session["hyuid"].ToString() + "'";
                dtjsr = db.GetDataTable(lssqljsr);
                string lsjsr = "";
                for (int jj = 0; jj < dtjsr.Rows.Count; jj++)
                {
                    if (lsjsr == "")
                    {
                        lsjsr = dtjsr.Rows[jj]["hy_field2"].ToString();
                    }
                    else
                    {
                        lsjsr += "," + dtjsr.Rows[jj]["hy_field2"].ToString();
                    }
                }
                this.txthy_wbjsrid.Text = lsjsr;
            }
            else
            {
                lssql = "select * from hyp_flowmain where hy_mudelid='moduleiso' and hy_tableid='c8246158-511f-4ce9-b7b9-3b7edf136a87' and DOCID='" + lsreturnmailid + "'";
                dt = db.GetDataTable(lssql);
                this.txthy_title.Text = dt.Rows[0]["hy_bt"].ToString();
                this.hy_content1.Value = dt.Rows[0]["hy_content1"].ToString();
                string lssqljsr = "SELECT * FROM hyp_flowmain WHERE (hy_mudelid = 'returnmail') AND (hy_tableid = '70ed517c-6382-4e34-9316-0aa090f9b9e0') and hy_djrid='" + this.Session["hyuid"].ToString() + "'";
                dtjsr = db.GetDataTable(lssqljsr);
                string lsjsr = "";
                for (int jj = 0; jj < dtjsr.Rows.Count; jj++)
                {
                    if (lsjsr == "")
                    {
                        lsjsr = dtjsr.Rows[jj]["hy_field2"].ToString();
                    }
                    else
                    {
                        lsjsr += "," + dtjsr.Rows[jj]["hy_field2"].ToString();
                    }
                }
                this.txthy_wbjsrid.Text = lsjsr;
            }

            //得到附件
            HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
            DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(lsreturnmailid);
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            string lsguid = "";
            for (int j = 0; j < dtfileatt.Rows.Count; j++)
            {
                lsguid = Hyoa_global.GetRandom();
                Hyoa_fileatt.ID = lsguid;
                Hyoa_fileatt.hy_fatherid = this.txtdocid.Value;
                Hyoa_fileatt.hy_filename =  dtfileatt.Rows[j]["hy_filename"].ToString();
                Hyoa_fileatt.hy_filepath = dtfileatt.Rows[j]["hy_filepath"].ToString();
                Hyoa_fileatt.hy_filesize = dtfileatt.Rows[j]["hy_filesize"].ToString();
                Hyoa_fileatt.hy_userid = dtfileatt.Rows[j]["hy_userid"].ToString();
                Hyoa_fileatt.hy_djsj = dtfileatt.Rows[j]["hy_djsj"].ToString();
                Hyoa_fileatt.Insert();
            }

            dt.Clear();
            dtjsr.Clear();

        }
    }
コード例 #8
0
    public void display()
    {
        //需要首先设置这些信息
        HyoaClass.Hyoa_mail_config Hyoa_mail_config = new HyoaClass.Hyoa_mail_config();
        DataTable dtconfig = Hyoa_mail_config.Getmailconfigbyuserid(this.Session["hyuid"].ToString());
        if (dtconfig.Rows.Count > 0)
        {
            string pop3Server = dtconfig.Rows[0]["hy_pop3url"].ToString();// "pop.163.com";    //邮箱服务器 如:"pop.sina.com.cn";或 "pop.qq.com" 好像sina的比较快
            int pop3Port = System.Int32.Parse(dtconfig.Rows[0]["hy_pop3port"].ToString()); //110;          //端口号码   用"110"好使。最好看一下你的邮箱服务器用的是什么端口号
            bool pop3UseSsl = false;
            string lsmailid = dtconfig.Rows[0]["hy_mailid"].ToString();
            string username = lsmailid.Substring(0, lsmailid.IndexOf("@"));//"ztmfang2008";        //你的邮箱用户名
            string password = Decrypt(dtconfig.Rows[0]["hy_mailpwd"].ToString()); //"20120328";      //你的邮箱密码
            List<string> gotEmailIds = new List<string>();
            List<Mime> result = new List<Mime>();
            using (POP3_Client pop3 = new POP3_Client())
            {
                //与Pop3服务器建立连接
                pop3.Connect(pop3Server, pop3Port, pop3UseSsl);
                //验证身份
                pop3.Authenticate(username, password, false);
                //获取邮件信息列表
                POP3_ClientMessageCollection infos = pop3.Messages;
                foreach (POP3_ClientMessage info in infos)
                {
                    //每封Email会有一个在Pop3服务器范围内唯一的Id,检查这个Id是否存在就可以知道以前有没有接收过这封邮件
                    if (gotEmailIds.Contains(info.UID))
                        continue;
                    //获取这封邮件的内容
                    byte[] bytes = info.MessageToByte();
                    //记录这封邮件的Id
                    gotEmailIds.Add(info.UID);
                    //this.Response.Write("<script>alert('" + info.UID + "');</script>");
                    //解析从Pop3服务器发送过来的邮件信息
                    Mime m = Mime.Parse(bytes);

                    HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                    HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail();
                    HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                    //this.Response.Write("<script>alert('aaa');</script>");
                    string lsid = Hyoa_global.GetRandom();
                    string lsdocid = info.UID.ToString();

                    DataTable dtmail = Hyoa_mail.Getmailbydocid(lsdocid);
                    if (dtmail.Rows.Count > 0)
                    { }
                    else
                    {
                        Hyoa_mail.ID = lsid;
                        Hyoa_mail.DOCID = lsdocid;
                        Hyoa_mail.hy_type = "收件";
                        Hyoa_mail.hy_foldername = "收件箱";
                        Hyoa_mail.hy_fsrid = m.MainEntity.From.ToAddressListString().ToString();
                        Hyoa_mail.hy_fsrname = m.MainEntity.From.ToAddressListString().ToString();
                        Hyoa_mail.hy_jsrid = this.Session["hyuid"].ToString();
                        Hyoa_mail.hy_wbjsrid = m.MainEntity.To.ToAddressListString().ToString();
                        Hyoa_mail.hy_jsrname = this.Session["hyuname"].ToString();
                        Hyoa_mail.hy_title = m.MainEntity.Subject.ToString();
                        Hyoa_mail.hy_body = m.BodyHtml.ToString();
                        Hyoa_mail.hy_datetime = m.MainEntity.Date.ToString();
                        Hyoa_mail.hy_ifsavetofjx = "";
                        Hyoa_mail.hy_yxj = "";
                        Hyoa_mail.hy_yjbg = "";
                        Hyoa_mail.hy_zycd = "";
                        Hyoa_mail.hy_hz = "";

                        Hyoa_mail.Insert();
                        //this.Response.Write("<script>alert('bbb');</script>");

                        //获取附件
                        foreach (MimeEntity entry in m.Attachments)
                        {
                            string lsfileattid = Hyoa_global.GetRandom();
                            string fileName = entry.ContentDisposition_FileName; //获取文件名称
                            string path = Server.MapPath("~\\fileatt\\" + lsfileattid);
                            Directory.CreateDirectory(path);
                            path += "\\" + fileName;
                            if (File.Exists(path))
                            {
                                Random random = new Random();
                                int newfile = random.Next(1, 100000);
                                path = Server.MapPath("~\\fileatt\\" + lsfileattid + "\\" + newfile.ToString());
                                Directory.CreateDirectory(path);
                                path += "\\" + fileName;
                            }
                            byte[] data = entry.Data;
                            FileStream pFileStream = null;
                            pFileStream = new FileStream(path, FileMode.Create);
                            pFileStream.Write(data, 0, data.Length);
                            pFileStream.Close();

                            //向附件表插入记录
                            Hyoa_fileatt.ID = lsfileattid;
                            Hyoa_fileatt.hy_fatherid = lsdocid;
                            Hyoa_fileatt.hy_filename = fileName;
                            Hyoa_fileatt.hy_filepath = path.Substring(path.IndexOf("fileatt\\"));
                            Hyoa_fileatt.hy_filesize = data.Length.ToString();
                            Hyoa_fileatt.hy_userid = this.Session["hyuid"].ToString();
                            Hyoa_fileatt.hy_djsj = m.MainEntity.Date.ToString();
                            Hyoa_fileatt.hy_fatherfield = "";
                            Hyoa_fileatt.Insert();

                            //this.Response.Write("<script>alert('ccc');</script>");
                        }
                    }
                    //Response.Write("<br>From:" + m.MainEntity.From.ToAddressListString());
                    //Response.Write("<br>To:" + m.MainEntity.To.ToAddressListString());
                    //Response.Write("<br>Time:" + m.MainEntity.Date);            //发送时间
                    //Response.Write("<br>Subject:" + m.MainEntity.Subject);      //主题
                    //Response.Write("<br>Plain Body:" + m.BodyText);             //内容
                    //Response.Write("<br>Html Body:" + m.BodyHtml);              //HTML格式内容
                }
                this.Response.Write("<script>alert('邮件接收完成!');window.opener.location.reload();window.close();</script>");
            }
        }
        else
        {
            this.Response.Write("<script>alert('请先配置外网邮件信息!');</script>");
        }
    }
コード例 #9
0
ファイル: list_zb.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    protected void btndelinfo_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        String[] v_uids = this.txtuids.Value.Split(',');
        string ls_filepath = "";
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                string sql = "delete from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'";
                Hyoa_global.ExcuteSQL(sql);

                //删除文档时将待办事宜删除start
                HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
                Hyoa_dbsy.DOCID = v_uids[i];
                Hyoa_dbsy.Deletebydocid(v_uids[i]);
                //删除文档时将待办事宜删除end

                //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start   add by xf 20121016
                HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
                Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i];
                Hyoa_flowhistoryinfo_cl.DeleteByDOCID();
                HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i];
                Hyoa_flowhistoryinfo_cy.DeleteByDOCID();
                //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end

                //删的时候将附件也删除start
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]);
                if (dtfileatt.Rows.Count > 0)
                {
                    for (int k = 0; k < dtfileatt.Rows.Count; k++)
                    {
                        ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString();
                        if (File.Exists(ls_filepath))
                        {
                            System.IO.File.Delete(ls_filepath);
                        }
                        Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString();
                        Hyoa_fileatt.Delete();
                    }
                }
                //删的时候将附件也删除end

                //生成删除日志 start
                string ls_oppcontent = "表名:hyc_" + txttableid.Value + ";文档ID:" + v_uids[i] + "被删除。";
                HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log();
                Hyoa_log.ID = System.Guid.NewGuid().ToString();
                Hyoa_log.hy_createtime = System.DateTime.Now.ToString();
                string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (userip == null || userip == "")
                {
                    userip = Request.ServerVariables["REMOTE_ADDR"];
                }
                Hyoa_log.hy_oppip = userip;
                Hyoa_log.hy_opptype = "删除";
                Hyoa_log.hy_oppcontent = ls_oppcontent;
                Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
                Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();
                Hyoa_log.Insert();
                //生成删除日志end

            }
        }
        this.txtuids.Value = "";
        //DataPlay(1);
        DataPlay(System.Int32.Parse(this.curpage.Text));
    }
コード例 #10
0
ファイル: main.aspx.cs プロジェクト: wjszxli/Webapp
    //得到某一个字段的HTML  Written by xf 20110515
    //pi_flag 0:不赋值  1:需赋值
    //ifsearch:是否查询时使用 0:非查询时使用 1:查询时使用
    //docid:旧文档使用时,文档ID,新文档则为空就可以
    //ifhavarole:是否有权限  0:lable输出 1:input输出
    public string GetFieldHtml(string hy_mudelid, string hy_fieldid, string pi_flag, string hy_tableid, string ifsearch, string docid, string ifhavarole)
    {
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        DataTable dtfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(hy_mudelid, hy_fieldid, hy_tableid);
        HyoaClass.DAO db = new HyoaClass.DAO();
        string lsField = "";
        string field_css = "";
        string field_value = "";
        string field_functionhy_onclick = "";
        string field_functionhy_ondblclick = "";
        string field_functionhy_onchange = "";
        string field_functionhy_onkeydown = "";
        string field_functionhy_onkeyup = "";
        string field_wordlimit = "";

        if (dtfield.Rows.Count > 0)
        {
            //得到该字段的样式start
            if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
            {
                if (ifsearch == "0")
                    field_css += " readonly ";
            }
            if (dtfield.Rows[0]["hy_class"].ToString() != "")
            {
                field_css += " class='" + dtfield.Rows[0]["hy_class"].ToString() + "' ";
            }
            if (dtfield.Rows[0]["hy_width"].ToString() != "")
            {
                field_css += " style='width:" + dtfield.Rows[0]["hy_width"].ToString() + ";";
            }
            else
            {
                field_css += " style='";
            }
            if (dtfield.Rows[0]["hy_height"].ToString() != "")
            {
                field_css += " height:" + dtfield.Rows[0]["hy_height"].ToString() + "'";
            }
            else
            {
                field_css += "'";
            }

            //得到字数限制
            if (dtfield.Rows[0]["hy_wordlimit"].ToString() != "")
            {
                field_wordlimit += " maxlength='" + dtfield.Rows[0]["hy_wordlimit"].ToString() + "' ";
            }

            //默认值
            //默认值取值的方式,查询时不使用默认值

            if (ifsearch == "0")
            {
                if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "")
                {
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "0")
                        field_value += dtfield.Rows[0]["hy_defaultvalue"].ToString();

                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "1")
                    {
                        DataTable dtdefault = db.GetDataTable(dtfield.Rows[0]["hy_defaultvalue"].ToString());
                        if (dtdefault.Rows.Count > 0)
                            field_value += dtdefault.Rows[0][0].ToString();
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "2")
                    {
                        field_value += Session[dtfield.Rows[0]["hy_defaultvalue"].ToString()].ToString();
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "3")
                    {
                        if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                            field_value += System.DateTime.Now.ToShortDateString();
                        else
                            field_value += System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    }
                    //自动生成值的情况 Added by xf 20110719
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "4")
                    {
                        if (dtfield.Rows[0]["hy_fieldtype"].ToString() == "数值")
                        {
                            //得到目前最大的数值,然后+1,未找到则赋值为1
                            HyoaClass.DAO db_autovalue = new HyoaClass.DAO();

                            DataTable dt_autovalue = db_autovalue.GetDataTable("select max(hy_field36) as maxint from hyp_flowmain where hy_tableid='" + dtfield.Rows[0]["hy_tableid"].ToString() + "'");
                            if (dt_autovalue.Rows[0]["maxint"].ToString() == null || dt_autovalue.Rows[0]["maxint"].ToString() == "")
                                field_value += "1";
                            else
                                field_value += (System.Int32.Parse(dt_autovalue.Rows[0]["maxint"].ToString()) + 1).ToString();
                        }
                        else
                        {
                            field_value += System.Guid.NewGuid().ToString();
                        }
                    }
                }
            }

            //事件
            if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
            {
                field_functionhy_onclick += " onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" ";
            }
            if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
            {
                field_functionhy_ondblclick += " ondblclick=\"" + dtfield.Rows[0]["hy_ondblclick"].ToString() + "\" ";
            }
            if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
            {
                field_functionhy_onchange += " onchange=\"" + dtfield.Rows[0]["hy_onchange"].ToString() + "\" ";
            }
            if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
            {
                field_functionhy_onkeydown += " onkeydown=\"" + dtfield.Rows[0]["hy_onkeydown"].ToString() + "\" ";
            }
            if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
            {
                field_functionhy_onkeyup += " onkeyup=\"" + dtfield.Rows[0]["hy_onkeyup"].ToString() + "\" ";
            }
            //得到该字段的样式end
            string field_type = dtfield.Rows[0]["hy_fieldtype"].ToString();

            //是否需要赋值,如果需要赋值,得到当前字段对应的值(日期型需要根据格式进行转换)
            string field_docvalue = "";
            //this.Response.Write("<script>alert('" + pi_flag + "');</script>");
            if (pi_flag == "1")
            {
                HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
                DataTable dt_flowmain = Hyoa_flowmain.Getflowmain(docid);
                if (dt_flowmain.Rows.Count > 0)
                {
                    if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                    {
                        field_docvalue = System.DateTime.Parse(dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString()).ToShortDateString();
                    }
                    else
                    {
                        //如果SQL为数值的字段部分,则需要截取小数点后边两位
                        if (dtfield.Rows[0]["hy_fieldtype"].ToString() == "数值")
                        {
                            if (dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString().Contains(".") == true)
                                field_docvalue = float.Parse(dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString()).ToString("F2");
                            else
                                field_docvalue = dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString();
                        }
                        else
                        {
                            field_docvalue = dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString();
                        }
                    }
                }
            }
            //如果没有权限,直接输出lable
            //this.Response.Write("<script>alert('" + ifhavarole + "');</script>");
            if (ifhavarole == "0")
            {
                //痕迹保留
                if (field_type == "痕迹保留")
                {
                    lsField += "<input type=button id=\"btn_zwxg\" value='正  文' class=btn3 onclick=\"window.open('ntko/readoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=1&jsxd=1','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" ";
                }
                else
                {
                    //附件组件
                    if (field_type == "附件组件")
                    {
                        //根据docid得到目前已上传的附件信息
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                        DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(docid);
                        if (dt_fileatt.Rows.Count > 0)
                        {
                            for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++)
                            {
                                string ls_name = "";
                                DataTable dt_user = Hyoa_user.Getuser(dt_fileatt.Rows[ii]["hy_userid"].ToString());
                                if (dt_user.Rows.Count > 0)
                                {
                                    ls_name = dt_user.Rows[0]["hy_username"].ToString();
                                }
                                lsField += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + "&nbsp;&nbsp;&nbsp;&nbsp;" + ls_name + "&nbsp;&nbsp;[" + dt_fileatt.Rows[ii]["hy_djsj"].ToString() + "]" + "</a><br />";
                            }
                        }
                        else
                        {
                            lsField += "&nbsp;";
                        }
                    }
                    else
                    {
                        //ztmztmztm2start
                        if (field_docvalue.Length > 8)
                        {
                            if (field_docvalue.Substring(0, 8) == "1900-1-1")
                            {
                                field_docvalue = "&nbsp;";
                            }
                        }
                        //ztmztmztm2end
                        lsField = field_docvalue + "&nbsp;";
                    }
                }
            }
            else
            {
                //单行文本
                if (field_type == "文本")
                {
                    if (pi_flag == "0")
                        lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">";
                    else
                        lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">";
                }
                //多行文本
                if (field_type == "多行文本")
                {
                    //格式化内容,将<br>转为/n
                    if (field_docvalue.Contains("<br>"))
                        field_docvalue = field_docvalue.Replace("<br>", "\n");

                    if (pi_flag == "0")
                        lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_css + field_wordlimit + " >" + field_value + "</textarea>";
                    else
                        lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_css + field_wordlimit + " >" + field_docvalue + "</textarea>";
                }
                //日期
                if (field_type == "日期")
                {
                    //this.Response.Write("<script>alert('aaaaaa');</script>");
                    //this.Response.Write("<script>alert('" + pi_flag + "');</script>");

                    if (ifsearch == "0")
                    {
                        if (pi_flag == "0")
                            lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">";
                        else
                        {

                            //add ztm3 start
                            if (field_docvalue.Length > 7)
                            {
                                if (field_docvalue.Substring(0, 8) == "1900-1-1")
                                {
                                    field_docvalue = "";
                                }
                            }
                            //add ztm3 end
                            lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">";

                        }
                    }
                    else
                    {
                        //this.Response.Write("<script>alert('aaaa');</script>");
                        lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">至";
                        lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">";
                    }
                }
                //文本加按钮
                if (field_type == "文本加按钮")
                {
                    if (pi_flag == "0")
                        lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">&nbsp;<input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >";
                    else
                        lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">&nbsp;<input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >";
                }
                //多行文本加按钮
                if (field_type == "多行文本加按钮")
                {
                    //格式化内容,将<br>转为/n
                    if (field_docvalue.Contains("<br>"))
                        field_docvalue = field_docvalue.Replace("<br>", "\n");

                    if (pi_flag == "0")
                        lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_wordlimit + " " + field_css + " >" + field_value + "</textarea>&nbsp;<input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >";
                    else
                        lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_wordlimit + " " + field_css + " >" + field_docvalue + "</textarea>&nbsp;<input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >";
                }
                //数值
                if (field_type == "数值")
                {
                    if (ifsearch == "0")
                    {
                        if (pi_flag == "0")
                            lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">";
                        else
                            lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">";
                    }
                    else
                    {
                        lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">到";
                        lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">";
                    }
                }
                //对话框列表(下拉框
                if (field_type == "对话框列表")
                {
                    lsField = "<select name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onchange + field_css + "> ";
                    //第一项:请选择
                    lsField += "<option value=''>--请选择--</option>";
                    //有哪些选项
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                        for (var ii = 0; ii < lv_options.Length; ii++)
                        {
                            if (pi_flag == "0")
                            {
                                lsField += "<option value='" + lv_options[ii].ToString() + "'>" + lv_options[ii].ToString() + "</option>";
                            }
                            else
                            {
                                if (field_docvalue == lv_options[ii].ToString())
                                    lsField += "<option value='" + lv_options[ii].ToString() + "' selected>" + lv_options[ii].ToString() + "</option>";
                                else
                                    lsField += "<option value='" + lv_options[ii].ToString() + "'>" + lv_options[ii].ToString() + "</option>";
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString());
                        if (dtoptions.Rows.Count > 0)
                        {
                            for (var ii = 0; ii < dtoptions.Rows.Count; ii++)
                            {
                                if (pi_flag == "0")
                                {
                                    lsField += "<option value='" + dtoptions.Rows[ii][0].ToString() + "'>" + dtoptions.Rows[ii][0].ToString() + "</option>";
                                }
                                else
                                {
                                    if (field_docvalue == dtoptions.Rows[ii][0].ToString())
                                        lsField += "<option value='" + dtoptions.Rows[ii][0].ToString() + "' selected>" + dtoptions.Rows[ii][0].ToString() + "</option>";
                                    else
                                        lsField += "<option value='" + dtoptions.Rows[ii][0].ToString() + "'>" + dtoptions.Rows[ii][0].ToString() + "</option>";
                                }
                            }
                        }
                    }
                    lsField += "</select>";
                }
                //复选框
                if (field_type == "复选框")
                {
                    //有哪些选项
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                        for (var ii = 0; ii < lv_options.Length; ii++)
                        {
                            if (pi_flag == "0")
                            {
                                if (field_value == lv_options[ii].ToString())
                                    lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString();
                                else
                                    lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString();
                            }
                            else
                            {
                                if (field_docvalue.Contains(lv_options[ii].ToString()))
                                    lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString();
                                else
                                    lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString();
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString());
                        if (dtoptions.Rows.Count > 0)
                        {
                            for (var ii = 0; ii < dtoptions.Rows.Count; ii++)
                            {
                                if (pi_flag == "0")
                                {
                                    if (field_value == dtoptions.Rows[ii][0].ToString())
                                        lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString();
                                    else
                                        lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString();
                                }
                                else
                                {
                                    if (field_docvalue.Contains(dtoptions.Rows[ii][0].ToString()))
                                        lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString();
                                    else
                                        lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString();
                                }
                            }
                        }
                    }
                }

                //单选框
                if (field_type == "单选框")
                {
                    //有哪些选项
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                        for (var ii = 0; ii < lv_options.Length; ii++)
                        {
                            if (pi_flag == "0")
                            {
                                if (field_value == lv_options[ii].ToString())
                                    lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString();
                                else
                                    lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString();
                            }
                            else
                            {
                                if (field_docvalue == lv_options[ii].ToString())
                                    lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString();
                                else
                                    lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString();
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString());
                        if (dtoptions.Rows.Count > 0)
                        {
                            for (var ii = 0; ii < dtoptions.Rows.Count; ii++)
                            {
                                if (pi_flag == "0")
                                {
                                    if (field_value == dtoptions.Rows[ii][0].ToString())
                                        lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString();
                                    else
                                        lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString();
                                }
                                else
                                {
                                    if (field_docvalue == dtoptions.Rows[ii][0].ToString())
                                        lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString();
                                    else
                                        lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString();
                                }
                            }
                        }
                    }
                }
                //口令
                if (field_type == "口令")
                {
                    if (pi_flag == "0")
                        lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=password id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">";
                    else
                        lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=password id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">";
                }
                //附件组件
                if (field_type == "附件组件")
                {
                    lsField = "";
                    //根据docid得到目前已上传的附件信息
                    HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                    DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(docid);
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();

                    if (dt_fileatt.Rows.Count > 0)
                    {
                        for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++)
                        {
                            string ls_name = "";
                            DataTable dt_user = Hyoa_user.Getuser(dt_fileatt.Rows[ii]["hy_userid"].ToString());
                            if (dt_user.Rows.Count > 0)
                            {
                                ls_name = dt_user.Rows[0]["hy_username"].ToString();
                            }
                            lsField += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + "</a>&nbsp;&nbsp;&nbsp;&nbsp;" + ls_name + "&nbsp;&nbsp;[" + dt_fileatt.Rows[ii]["hy_djsj"].ToString() + "]" + "<br />";
                        }
                    }
                    lsField += "<input type=button id=\"uploadfile1\" value='附件管理' class=btn3 onclick=\"window.open('/ggdy/main_fileatt.aspx?fatherid=" + docid + "','newwindow','height=350,width=600,top=100,left=200,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no');\" ";
                }
                //说明文字
                if (field_type == "说明文字")
                {
                    lsField = "<span id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\">" + field_value + "</span>";
                }
                //编辑器
                if (field_type == "编辑器")
                {
                    //lsField = "<textarea name=\"hy_content1_1\" id=\"hy_content1_1\" style=\"display:none\" runat="server">" + field_docvalue + "</textarea>";
                    lsField += "<iframe ID=\"eWebEditor1\" src=\"system/eWebEditor/ewebeditor.htm?id=" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "&style=Portal\" frameborder=\"0\" scrolling=\"no\" width=\"100%\" height=\"350\"></iframe>";
                }
                //痕迹保留
                //this.Response.Write("<script>alert('" + field_type + "');</script>");
                if (field_type == "痕迹保留")
                {
                    //判断是否为第一环节
                    HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
                    DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, "*");

                    if (dtflowwork.Rows.Count > 0)
                    {
                        if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == this.hy_curtacheid.Text)
                        {
                            lsField += "<input type=button id=\"btn_zwxg\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=1&jsxd=0','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" ";
                        }
                        else
                        {
                            //判断是否为最后一个环节
                            dtflowwork.Clear();
                            dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                            if (dtflowwork.Rows.Count > 0)
                            {
                                if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**")
                                {
                                    lsField += "<input type=button id=\"btn_zwxg\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=0&jsxd=1','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" ";
                                }
                                else
                                {
                                    lsField += "<input type=button id=\"btn_zwxg\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=0&jsxd=0','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" ";
                                }
                            }

                        }
                    }

                }
            }

            db.Close();
        }
        return lsField;
    }
コード例 #11
0
ファイル: list_mail_cgx.aspx.cs プロジェクト: wjszxli/Webapp
    public void sendmail(string lsjsrid, string lsbt, string lsnr, string lsid)
    {
        //lsjsrid  接收人[email protected],[email protected]
        //lsbt  主题
        //lsnr  内容
        //lsfjpath 附件路径

        HyoaClass.Hyoa_mail_config Hyoa_mail_config = new HyoaClass.Hyoa_mail_config();
        DataTable dtmailuser = Hyoa_mail_config.Getmailconfigbyuserid(this.Session["hyuid"].ToString());

        string lssendid = "";
        string lssendpwd = "";
        string lssendname = "";
        string lshost = "";
        string lsport = "";
        if (dtmailuser.Rows.Count > 0)
        {
            lssendid = dtmailuser.Rows[0]["hy_mailid"].ToString();
            lssendpwd = Decrypt(dtmailuser.Rows[0]["hy_mailpwd"].ToString());
            lssendname = this.Session["hyuname"].ToString();
            lshost = dtmailuser.Rows[0]["hy_smtpurl"].ToString();
            lsport = dtmailuser.Rows[0]["hy_smtpport"].ToString();
            //lshost = lssendid.Substring(lssendid.IndexOf("@") + 1, lssendid.Length - lssendid.IndexOf("@") - 1);   //smtp的服务器地址hy_smtpurl
        }
        else
        {
            return;
        }
        string lsml = "";
        lsml = Server.MapPath("~/");//得到虚拟根目录

        SmtpClient smtp = new SmtpClient(); //实例化一个SmtpClient
        smtp.DeliveryMethod = SmtpDeliveryMethod.Network; //将smtp的出站方式设为 Network
        smtp.EnableSsl = false;//smtp服务器是否启用SSL加密

        smtp.Host = lshost; //指定 smtp 服务器地址
        smtp.Port = System.Int32.Parse(lsport);             //指定 smtp 服务器的端口,默认是25,如果采用默认端口,可省去
        ////如果你的SMTP服务器不需要身份认证,则使用下面的方式,不过,目前基本没有不需要认证的了
        //smtp.UseDefaultCredentials = true;

        //如果需要认证,则用下面的方式
        smtp.Credentials = new NetworkCredential(lssendid, lssendpwd);
        MailMessage mm = new MailMessage(); //实例化一个邮件类
        mm.Priority = MailPriority.High; //邮件的优先级,分为 Low, Normal, High,通常用 Normal即可
        mm.From = new MailAddress(lssendid, lssendname, Encoding.GetEncoding(936));
        //收件方看到的邮件来源;
        //第一个参数是发信人邮件地址
        //第二参数是发信人显示的名称
        //第三个参数是 第二个参数所使用的编码,如果指定不正确,则对方收到后显示乱码
        //936是简体中文的codepage值
        ////注:上面的邮件来源,一定要和你登录邮箱的帐号一致,否则会认证失败
        mm.ReplyTo = new MailAddress(lssendid, lssendname, Encoding.GetEncoding(936));
        //ReplyTo 表示对方回复邮件时默认的接收地址,即:你用一个邮箱发信,但却用另一个来收信
        //上面后两个参数的意义, 同 From 的意义

        //mm.CC.Add("[email protected],[email protected],[email protected]");
        ////邮件的抄送者,支持群发,多个邮件地址之间用 半角逗号 分开

        //mm.Bcc.Add("[email protected],[email protected]");
        ////邮件的密送者,支持群发,多个邮件地址之间用 半角逗号 分开

        mm.To.Add(lsjsrid);
        //邮件的接收者,支持群发,多个地址之间用 半角逗号 分开

        mm.Subject = lsbt; //邮件标题
        mm.SubjectEncoding = Encoding.GetEncoding(936);
        // 这里非常重要,如果你的邮件标题包含中文,这里一定要指定,否则对方收到的极有可能是乱码。
        // 936是简体中文的pagecode,如果是英文标题,这句可以忽略不用
        mm.IsBodyHtml = true; //邮件正文是否是HTML格式

        mm.BodyEncoding = Encoding.GetEncoding(936);
        //邮件正文的编码, 设置不正确, 接收者会收到乱码

        mm.Body = lsnr;

        //邮件正文
        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
        DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(lsid);
        if (dtfileatt.Rows.Count > 0)
        {
            for (int jj = 0; jj < dtfileatt.Rows.Count; jj++)
            {
                if (jj == 0)
                {
                    //添加附件,第二个参数,表示附件的文件类型,可以不用指定
                    mm.Attachments.Add(new Attachment(@lsml + "\\" + dtfileatt.Rows[jj]["hy_filepath"].ToString(), System.Net.Mime.MediaTypeNames.Application.Rtf));
                }
                else
                {//可以添加多个附件
                    mm.Attachments.Add(new Attachment(@lsml + "\\" + dtfileatt.Rows[jj]["hy_filepath"].ToString()));
                }
            }
        }

        smtp.Send(mm); //发送邮件,如果不返回异常, 则大功告成了。
    }
コード例 #12
0
ファイル: main.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改

            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                if (this.Request.QueryString["gwkid"] != null)
                {
                    //根据id得到信息
                    this.txtdocid.Value = this.Request.QueryString["gwkid"].ToString();
                    HyoaClass.Hyoa_gwk Hyoa_gwk = new HyoaClass.Hyoa_gwk();
                    DataTable dt = Hyoa_gwk.Getgwkbyid(this.txtdocid.Value);
                    if (dt.Rows.Count > 0)
                    {
                        this.txthy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString();
                        this.txthy_djbmname.Text = dt.Rows[0]["hy_djbmname"].ToString();
                        this.txthy_bt.Text = dt.Rows[0]["hy_bt"].ToString();
                        this.txthy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString();
                        this.txthy_typename.Text = dt.Rows[0]["hy_typename"].ToString();
                        this.txttypeid.Value = dt.Rows[0]["hy_typeid"].ToString();
                        this.txtdjrid.Value = dt.Rows[0]["hy_djrid"].ToString();
                        this.txtdjrbmid.Value = dt.Rows[0]["hy_djbmid"].ToString();
                        this.txtfatherid.Value = dt.Rows[0]["hy_fatherid"].ToString();
                    }
                    int tt = 0;
                    string ls_temp = "";
                    HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                    HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                    //发文
                    if (dt.Rows[0]["hy_mudelid"].ToString() == "Mudelfwgl")
                    {
                        string lssqlfwglfile;
                        lssqlfwglfile = "select * from files where fother = '" + dt.Rows[0]["hy_fatherid"].ToString() + "'";
                        DataTable dtfwglfile = Hyoa_global.GetDataTable(lssqlfwglfile);
                        if (dtfwglfile.Rows.Count > 0)
                        {
                            for (int jfile = 0; jfile < dtfwglfile.Rows.Count; jfile++)
                            {
                                tt += 1;
                                if (ls_temp == "")
                                {
                                    ls_temp = tt.ToString() + "、<a href='../NTKO/" + dtfwglfile.Rows[jfile]["fpath"].ToString() + "/" + dtfwglfile.Rows[jfile]["fname"].ToString() + "' target=_blank>正文</a>";
                                }
                                else
                                {
                                    ls_temp += "<br>" + tt.ToString() + "、<a href='../NTKO/" + dtfwglfile.Rows[jfile]["fpath"].ToString() + "/" + dtfwglfile.Rows[jfile]["fname"].ToString() + "' target=_blank>正文</a>";
                                }
                            }
                        }
                    }
                    //收发文中上传的附件
                    DataTable dt_fileatt = new DataTable();
                    if (dt.Rows[0]["hy_fatherid"].ToString() != "")
                    {
                        dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(dt.Rows[0]["hy_fatherid"].ToString());
                        if (dt_fileatt.Rows.Count > 0)
                        {
                            for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                            {
                                tt += 1;
                                if (ls_temp == "")
                                {
                                    ls_temp = tt.ToString() + "、<a href='../" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target=_blank>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a>";
                                }
                                else
                                {
                                    ls_temp += "<br>" + tt.ToString() + "、<a href='../" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target=_blank>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a>";
                                }
                            }
                        }
                    }
                    //附件
                    dt_fileatt.Clear();
                    dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
                    if (dt_fileatt.Rows.Count > 0)
                    {
                        for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                        {
                            tt += 1;
                            if (ls_temp == "")
                            {
                                ls_temp = tt.ToString() + "、<a href='../" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target=_blank>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a>";
                            }
                            else
                            {
                                ls_temp += "<br>" + tt.ToString() + "、<a href='../" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target=_blank>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a>";
                            }
                        }
                    }
                    this.lblhy_field2.Text = ls_temp;
                    dt.Clear();
                }
            }
        }
    }
コード例 #13
0
ファイル: main.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    ////////////////////////////////////以上代码请不要修改//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //1395行--判断是否上边有修改过//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //ifhavaClRight:是否当前流程和当前环节有处理权限 0:无权限 1:有权限
    //ifhavaYdRight:是否当前流程和当前环节有阅读权限 0:无权限 1:有权限
    //ifnewdoc:  是否新文档 0:新文档 1:旧文档
    public void WebOpen(string hy_mudelid, string hy_tableid, string flowid, string curtacheid, string ifhavaClRight, string ifhavaYdRight, string ifnewdoc)
    {
        ////加载批示人
        //HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        //DataTable dt_user = Hyoa_user.GetLeadersOrderbydeptsortandusersort();
        //this.txtpsr.DataSource = dt_user;
        //this.txtpsr.DataTextField = "hy_username";
        //this.txtpsr.DataValueField = "hy_userid";
        //this.txtpsr.DataBind();

        if (ifnewdoc == "1")
        {
            //判断是否显示再反馈
            if (this.hy_curtacheid.Text == "tache0003" && ifhavaClRight == "1")
            {
                this.td_reback.Visible = true;
            }
            if (this.hy_curtacheid.Text == "tache0003" && ifhavaClRight == "0")
            {
                //不允许收回
                this.td_withdraw.Visible = false;
            }
        }
        else
        {
            //this.lblhy_field8.Text = Session["hyuname"].ToString();
            //this.txthy_field8.Text = Session["hyuname"].ToString();
            //this.lblhy_field7.Text = Session["hydeptname"].ToString();
            //this.txthy_field7.Text = Session["hydeptname"].ToString();
            //this.txthy_field31.Text = System.DateTime.Now.ToString("yyyy-MM-dd");
            //this.txthy_field34.Text = System.DateTime.Now.ToString("yyyy-MM-dd");
            //this.lblhy_field36.Text = System.DateTime.Now.ToString("yyyy");
            //this.txthy_field36.Text = System.DateTime.Now.ToString("yyyy");
            ////自动加载流水号
            //string ls_lsh = "select hy_field37 from hyp_flowmain where hy_mudelid='zwdc' and hy_tableid='ba6f6f8e-df28-497e-93dd-856e80e4ba24' and hy_field36='" + System.DateTime.Now.ToString("yyyy") + "'";
            //DataTable dt_lsh = db.GetDataTable(ls_lsh);
            //if (dt_lsh.Rows.Count > 0)
            //{
            //    this.lblhy_field37.Text = dt_lsh.Rows[0][0].ToString();
            //    this.txthy_field37.Text = dt_lsh.Rows[0][0].ToString();
            //}
        }

        ////////承办反馈
        //HyoaClass.Hyoa_back Hyoa_back = new HyoaClass.Hyoa_back();
        //HyoaClass.Hyoa_reback Hyoa_reback = new HyoaClass.Hyoa_reback();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        //反馈内容(当前用户是反馈人员,则只显示自己单位的反馈信息,除外则显示所有信息)
        DataTable dt_iffkr = new DataTable();
        if (Session["conntype"].ToString() == "SQL")
        {
            dt_iffkr = Hyoa_global.GetDataTable("select * from hyp_flowhistoryinfo_cl where docid='" + this.txtdocid.Value + "' and hy_tacheid='tache0002' and ','+hy_clrid+',' like '%," + Session["hyuid"].ToString() + ",%'");
        }
        if (Session["conntype"].ToString() == "ORACLE")
        {
            dt_iffkr = Hyoa_global.GetDataTable("select * from hyp_flowhistoryinfo_cl where docid='" + this.txtdocid.Value + "' and hy_tacheid='tache0002' and CONCAT(CONCAT(',',hy_clrid),',') like '%," + Session["hyuid"].ToString() + ",%'");
        }
        if (dt_iffkr.Rows.Count > 0)
        {
            if (this.hy_curtacheid.Text == "tache0002")
            {
                this.btn_cbfk.Visible = true;
                this.lblcbgkzt.Visible = true;
            }
            else
            {
                this.btn_cbfk.Visible = false;
            }

            string lssql_gr = "Select * from hyt_back where hy_fatherid = '" + this.txtdocid.Value + "' and hy_fkrid = '" + Session["hyuid"].ToString() + "'";
            string lssql_reback_pd = "Select * from hyt_reback where hy_fatherid = '" + this.txtdocid.Value + "' and hy_rebackuserid = '" + Session["hyuid"].ToString() + "' and (hy_ifreback <> '1' or hy_ifreback is null) order by hy_senddate";
            DataTable dt_gr = Hyoa_global.GetDataTable(lssql_gr);
            DataTable dt_reback_pd = Hyoa_global.GetDataTable(lssql_reback_pd);
            //DataTable dt_gr = Hyoa_back.Getbackbyfatheridandfkrid(this.txtdocid.Value, Session["hyuid"].ToString());
            //DataTable dt_reback_pd = Hyoa_reback.GetWWCrebackbyfatheridandrebackuserid(this.txtdocid.Value, Session["hyuid"].ToString());
            if (dt_gr.Rows.Count > 0)
            {
                btn_cbfk.Value = "修改意见";
                if (dt_gr.Rows[0]["hy_iftj"].ToString() != "是")
                    lblcbgkzt.Text = "(状态:已反馈未提交。如果确认办理完成请点击提交按钮!) ";
                else
                {
                    lblcbgkzt.Text = "(状态:已反馈并提交。) ";
                    btn_cbfk.Visible = false;
                }

                //判断是否重新反馈
                if (dt_reback_pd.Rows.Count > 0)
                {
                    btn_cbfk.Visible = true;
                    btn_cbfk.Value = "需再反馈";
                    lblcbgkzt.Visible = false;
                    td_reback_tj.Visible = true;
                }

                tdfknr.RowSpan = 3;

                //得到附件信息
                string lsbackfjsql = "select * from hyt_back a, hyp_fileatt b where a.hy_fatherid='" + this.txtdocid.Value + "' and b.hy_fatherid=a.ID and a.hy_fkrid='" + dt_gr.Rows[0]["hy_fkrid"].ToString() + "'";
                //HyoaClass.DAO backfjdb = new HyoaClass.DAO();
                DataTable backfjdt = Hyoa_global.GetDataTable(lsbackfjsql);
                string lsfj = "&nbsp;";
                if (backfjdt.Rows.Count > 0)
                {
                    for (int iii = 0; iii < backfjdt.Rows.Count; iii++)
                    {
                        lsfj += (iii + 1).ToString() + "、<a href='/" + backfjdt.Rows[iii]["hy_filepath"].ToString() + "' target=_blank>" + backfjdt.Rows[iii]["hy_filename"].ToString() + "</a>&nbsp;&nbsp;&nbsp;&nbsp;";
                    }
                }
                //backfjdb.Close();

                this.lblfknr.Text = "<td  valign=\"bottom\" colspan=\"3\" class=\"Tdcellright\">(单位:" + dt_gr.Rows[0]["hy_fkrname"].ToString() + "&nbsp;&nbsp;签发人:" + dt_gr.Rows[0]["hy_qfr"].ToString() + "&nbsp;&nbsp; 反馈时间:" + System.DateTime.Parse(dt_gr.Rows[0]["hy_backdate"].ToString()).ToString("yyyy-MM-dd") + ")</td><tr><td colspan=\"3\" class=\"Tdcellright\">" + dt_gr.Rows[0]["hy_backidea"].ToString() + "</td></tr><tr><td colspan=\"3\" class=\"Tdcellright\" style='border-bottom:1px solid red'>" + lsfj + "</td></tr>";
            }
            else
            {
                btn_cbfk.Value = "添加意见";
                this.lblfknr.Text = "<td  valign=\"bottom\" colspan=\"3\" class=\"Tdcellright\">(单位:" + Session["hyuname"].ToString() + "&nbsp;&nbsp;状态:<font color=#FF00FF>未反馈</font>)</td><tr><td colspan=\"3\" class=\"Tdcellright\">&nbsp;</td></tr><tr><td colspan=\"3\" class=\"Tdcellright\" style='border-bottom:1px solid red'>&nbsp;</td></tr>";
            }

        }
        else
        {
            this.btn_cbfk.Visible = false;
            this.lblcbgkzt.Visible = false;

            string lssql_fknr = "Select * from hyt_back where hy_fatherid = '"+this.txtdocid.Value+"' order by hy_backdate desc";
            DataTable dt_fknr = Hyoa_global.GetDataTable(lssql_fknr);
            //DataTable dt_fknr = Hyoa_back.Getbackbyfatherid(this.txtdocid.Value);
            //DataTable dt_fknr= db.GetDataTable("select * from hyt_back where hy_fatherid='" + this.txtdocid.Value + "' order by ");
            if (dt_fknr.Rows.Count > 0)
            {
                tdfknr.RowSpan = dt_fknr.Rows.Count * 3;
                for (var i = 0; i < dt_fknr.Rows.Count; i++)
                {
                    //得到附件信息
                    string lsbackfjsql2 = "select * from hyt_back a, hyp_fileatt b where a.hy_fatherid='"+this.txtdocid.Value+"' and b.hy_fatherid=a.ID and a.hy_fkrid='" + dt_fknr.Rows[i]["hy_fkrid"].ToString() + "'";
                    DataTable backfjdt2 = Hyoa_global.GetDataTable(lsbackfjsql2);
                    string lsfj = "&nbsp;";
                    if (backfjdt2.Rows.Count > 0)
                    {
                        for (int iii = 0; iii < backfjdt2.Rows.Count; iii++)
                        {
                            lsfj += (iii + 1).ToString() + "、<a href='/" + backfjdt2.Rows[iii]["hy_filepath"].ToString() + "' target=_blank>" + backfjdt2.Rows[iii]["hy_filename"].ToString() + "</a>&nbsp;&nbsp;&nbsp;&nbsp;";
                        }
                    }
                    //backfjdb2.Close();
                    if (dt_fknr.Rows[i]["hy_iftj"].ToString() == "是")
                    {
                        this.lblfknr.Text += "<td  valign=\"bottom\" colspan=\"3\" class=\"Tdcellright\">(单位:" + dt_fknr.Rows[i]["hy_fkrname"].ToString() + "&nbsp;&nbsp;签发人:" + dt_fknr.Rows[i]["hy_qfr"].ToString() + "&nbsp;&nbsp; 反馈时间:" + System.DateTime.Parse(dt_fknr.Rows[i]["hy_backdate"].ToString()).ToString("yyyy-MM-dd") + "&nbsp;&nbsp;已提交" + ")</td><tr><td colspan=\"3\" class=\"Tdcellright\">" + dt_fknr.Rows[i]["hy_backidea"].ToString() + "</td></tr><tr><td colspan=\"3\" class=\"Tdcellright\" style='border-bottom:1px solid red'>" + lsfj + "</td></tr>";
                    }
                    else
                    {
                        this.lblfknr.Text += "<td  valign=\"bottom\" colspan=\"3\" class=\"Tdcellright\">(单位:" + dt_fknr.Rows[i]["hy_fkrname"].ToString() + "&nbsp;&nbsp;签发人:" + dt_fknr.Rows[i]["hy_qfr"].ToString() + "&nbsp;&nbsp; 反馈时间:" + System.DateTime.Parse(dt_fknr.Rows[i]["hy_backdate"].ToString()).ToString("yyyy-MM-dd") + "&nbsp;&nbsp;未提交" + ")</td><tr><td colspan=\"3\" class=\"Tdcellright\">" + dt_fknr.Rows[i]["hy_backidea"].ToString() + "</td></tr><tr><td colspan=\"3\" class=\"Tdcellright\" style='border-bottom:1px solid red'>" + lsfj + "</td></tr>";
                    }

                }
            }
            else
            {
                this.lblfknr.Text += "<td  valign=\"bottom\" colspan=\"3\" class=\"Tdcellright\">&nbsp;</td><tr><td colspan=\"3\" class=\"Tdcellright\">&nbsp;</td></tr><tr><td colspan=\"3\" class=\"Tdcellright\">&nbsp;</td></tr>";
            }
        }

        //附件
        this.lblhy_field2.Visible = true;
        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
        DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);

        if (dt_fileatt.Rows.Count > 0)
        {
            string ls_temp = "";
            for (var i = 0; i < dt_fileatt.Rows.Count; i++)
            {
                ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
            }
            this.lblhy_field2.Text = ls_temp;
        }
        if ((IfCanWriteByFlowid_Tacheid_Fieldid(flowid, curtacheid, "hy_field2") == "0" && ifhavaClRight == "1") || ifhavaYdRight == "1")
        {

            this.uploadhy_field2.Visible = false;
        }
        else
        {
            this.uploadhy_field2.Visible = true;
        }
        //需再反馈的人员及理由
        string lssql_reback = "Select * from hyt_reback where hy_fatherid = '" + this.txtdocid.Value + "' order by hy_senddate";
        DataTable dt_reback = Hyoa_global.GetDataTable(lssql_reback);
        //DataTable dt_reback = Hyoa_reback.Getrebackbyfatherid(this.txtdocid.Value);
        if (dt_reback.Rows.Count > 0)
        {
            for(var i=0;i<dt_reback.Rows.Count;i++)
            {
                this.lblhy_content4.Text += "需再反馈人员:" + dt_reback.Rows[i]["hy_rebackusername"].ToString()+"<br />";

                if(i==(dt_reback.Rows.Count-1))
                    this.lblhy_content4.Text += "需再反馈理由:" + dt_reback.Rows[i]["hy_rebackresion"].ToString();
                else
                    this.lblhy_content4.Text += "需再反馈理由:" + dt_reback.Rows[i]["hy_rebackresion"].ToString() + "<br /><br />";
            }
        }

        //再反馈状况
        string lssql_YWCreback = "Select * from hyt_reback where hy_fatherid = '" + this.txtdocid.Value + "' and hy_ifreback = '1' order by hy_senddate";
        DataTable dt_YWCreback = Hyoa_global.GetDataTable(lssql_YWCreback);
        //DataTable dt_YWCreback = Hyoa_reback.GetYWCrebackbyfatherid(this.txtdocid.Value);
        if (dt_YWCreback.Rows.Count > 0)
        {
            for (var i = 0; i < dt_YWCreback.Rows.Count; i++)
            {
                if (i == (dt_YWCreback.Rows.Count - 1))
                    this.lblhy_field11.Text += dt_YWCreback.Rows[i]["hy_rebackusername"].ToString() + "于" + System.DateTime.Parse(dt_YWCreback.Rows[i]["hy_rebackdate"].ToString()).ToShortDateString() + "再次反馈完成";
                else
                    this.lblhy_field11.Text += dt_YWCreback.Rows[i]["hy_rebackusername"].ToString() + "于" + System.DateTime.Parse(dt_YWCreback.Rows[i]["hy_rebackdate"].ToString()).ToShortDateString() + "再次反馈完成<br />";
            }
        }

        //////退回重办的人员及理由
        ////if ((IfCanWriteByFlowid_Tacheid_Fieldid(flowid, curtacheid, "hy_content5") == "0" && ifhavaClRight == "1") || ifhavaYdRight == "1")
        ////{
        ////    this.lblhy_content5.Visible = true;
        ////    this.txthy_content5.Visible = false;
        ////    if (dt.Rows.Count > 0)
        ////        this.lblhy_content5.Text = dt.Rows[0]["hy_content5"].ToString();
        ////}
        ////else
        ////{
        ////    this.lblhy_content5.Visible = false;
        ////    this.txthy_content5.Visible = true;
        ////    if (dt.Rows.Count > 0)
        ////        this.txthy_content5.Text = RtfToText(dt.Rows[0]["hy_content5"].ToString());
        ////}
        //////退回重办状况
        ////if ((IfCanWriteByFlowid_Tacheid_Fieldid(flowid, curtacheid, "hy_field13") == "0" && ifhavaClRight == "1") || ifhavaYdRight == "1")
        ////{
        ////    this.lblhy_field13.Visible = true;
        ////    this.txthy_field13.Visible = false;
        ////    if (dt.Rows.Count > 0)
        ////        this.lblhy_field13.Text = dt.Rows[0]["hy_field13"].ToString();
        ////}
        ////else
        ////{
        ////    this.lblhy_field13.Visible = false;
        ////    this.txthy_field13.Visible = true;
        ////    if (dt.Rows.Count > 0)
        ////        this.txthy_field13.Text = RtfToText(dt.Rows[0]["hy_field13"].ToString());
        ////}
        //db.Close();
    }
コード例 #14
0
    private void DataPlay()
    {
        //hy_json = "{\"success\":true,\"total\":\"60\",\"rows\":[{\"hy_mudelid\":\"111\",\"hy_mudelname\":\"1111\",\"hy_roleid\":\"111111\",\"hy_qqroleid\":\"111111\",\"hy_isenabled\":\"111111\"}]}";
        string hy_json = "";
        string ls_success = "true";    //调用方法成功
        string ls_flag = "0";   //删除失败
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        string txtuids = "";
        if (this.Request.Form["txtuids"] != null)
            txtuids = this.Request.Form["txtuids"].ToString();

        string txttableid = "";
        if (this.Request.Form["txttableid"] != null)
            txttableid = this.Request.Form["txttableid"].ToString();

        String[] v_uids = txtuids.Split(',');
        string ls_filepath = "";
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                string sql = "delete from hyc_" + txttableid + " where DOCID='" + v_uids[i] + "'";
                Hyoa_global.ExcuteSQL(sql);

                //删除文档时将待办事宜删除start
                HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
                Hyoa_dbsy.DOCID = v_uids[i];
                Hyoa_dbsy.Deletebydocid(v_uids[i]);
                //删除文档时将待办事宜删除end

                //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start   add by xf 20121016
                HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
                Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i];
                Hyoa_flowhistoryinfo_cl.DeleteByDOCID();
                HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i];
                Hyoa_flowhistoryinfo_cy.DeleteByDOCID();
                //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end

                //删的时候将附件也删除start
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]);
                if (dtfileatt.Rows.Count > 0)
                {
                    for (int k = 0; k < dtfileatt.Rows.Count; k++)
                    {
                        ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString();
                        if (File.Exists(ls_filepath))
                        {
                            System.IO.File.Delete(ls_filepath);
                        }
                        Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString();
                        Hyoa_fileatt.Delete();
                    }
                }
                //删的时候将附件也删除end

                //生成删除日志 start
                string ls_oppcontent = "表名:hyc_" + txttableid + ";文档ID:" + v_uids[i] + "被删除。";
                HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log();
                Hyoa_log.ID = System.Guid.NewGuid().ToString();
                Hyoa_log.hy_createtime = System.DateTime.Now.ToString();
                string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (userip == null || userip == "")
                {
                    userip = Request.ServerVariables["REMOTE_ADDR"];
                }
                Hyoa_log.hy_oppip = userip;
                Hyoa_log.hy_opptype = "删除";
                Hyoa_log.hy_oppcontent = ls_oppcontent;
                Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
                Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();
                Hyoa_log.Insert();
                //生成删除日志end
                ls_flag = "1";
            }
        }
        hy_json = "{\"success\":" + ls_success + ",\"flag\":\"" + ls_flag + "\"}";
        Response.Write(hy_json);
    }
コード例 #15
0
ファイル: main_fileatt.aspx.cs プロジェクト: wjszxli/Webapp
    private void DataPlay()
    {
        this.btn_submit.Visible = true; //保存
        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        string ls_att = "";
        this.lbupfile.Text = "无附件!";
        if (this.Request.QueryString["fatherid"] != null)
            {
                DataTable dt = Hyoa_fileatt.GetfileattByFatherid(this.Request.QueryString["fatherid"].ToString());   //是否弹出窗口
                if (dt.Rows.Count > 0)
                {
                    for(int j=0;j<dt.Rows.Count;j++)
                    {
                        string ls_name = "";
                        DataTable dt_user = Hyoa_user.Getuser(dt.Rows[j]["hy_userid"].ToString());
                        if (dt_user.Rows.Count > 0)
                        {
                            ls_name = dt_user.Rows[0]["hy_username"].ToString();
                        }
                        ls_att += "<input type='checkbox' name='docids' value='" + dt.Rows[j]["ID"].ToString() + "'>" + "<a href=\"" + "\\" + dt.Rows[j]["hy_filepath"].ToString() + "\" target=_blank>" + dt.Rows[j]["hy_filename"].ToString() + "</a>&nbsp;&nbsp;&nbsp;&nbsp;" + ls_name + "&nbsp;&nbsp;[" + dt.Rows[j]["hy_djsj"].ToString() + "]" + "<br />";

                    }
                    this.lbupfile.Text = ls_att + "<br />";
                    this.lbupfile.Text += "<input type=\"button\" onclick=\"delfileatt();\" value=\"  删 除\" class=btn7 name=\"Button_Return\" />";

                }
            }
    }
コード例 #16
0
ファイル: main_mail.aspx.cs プロジェクト: wjszxli/Webapp
    public void sendmail(string lsjsrid,string lsbt,string lsnr,string lsid)
    {
        //lsjsrid  接收人[email protected],[email protected]
        //lsbt  主题
        //lsnr  内容
        //lsfjpath 附件路径

           HyoaClass.Hyoa_mail_config Hyoa_mail_config = new HyoaClass.Hyoa_mail_config();
           DataTable dtmailuser = Hyoa_mail_config.Getmailconfigbyuserid(this.Session["hyuid"].ToString());

           string lssendid = "";
           string lssendpwd = "";
           string lssendname = "";
           string lshost = "";
           string lsport = "";

           if (dtmailuser.Rows.Count > 0)
           {
               for (int n = 0; n < dtmailuser.Rows.Count; n++)
               {
                   if (dtmailuser.Rows[n]["hy_mailid"].ToString() == this.ddlmailset.SelectedValue.ToString())
                   {
                       lssendid = dtmailuser.Rows[n]["hy_mailid"].ToString();
                       lssendpwd = Decrypt(dtmailuser.Rows[n]["hy_mailpwd"].ToString());
                       lssendname = this.Session["hyuname"].ToString();
                       lshost = dtmailuser.Rows[n]["hy_smtpurl"].ToString();
                       lsport = dtmailuser.Rows[n]["hy_smtpport"].ToString();
                   }
               }
           }
           else
           {
           return;
           }

           string lsml = "";
           lsml = Server.MapPath("~/");//得到虚拟根目录
           jmail.Message jmail = new jmail.Message();
           DateTime t = DateTime.Now;
           String Subject = lsbt;
           String body = lsnr;
           String FromEmail = lssendid;
           String ToEmail = lsjsrid;
           //Silent属性:如果设置为true,JMail不会抛出例外错误. JMail. Send( () 会根据操作结果返回true或false
           jmail.Silent = true;
           //Jmail创建的日志,前提loging属性设置为true
           jmail.Logging = true;
           //字符集,缺省为"US-ASCII"
           jmail.From = FromEmail;
           jmail.Charset="gb2312";
        jmail.ContentTransferEncoding="base64";
        jmail.Encoding="base64";
        jmail.ISOEncodeHeaders=false;

           //信件的contentype. 缺省是"text/plain") : 字符串如果你以HTML格式发送邮件, 改为"text/html"即可。
           //jmail.ContentType = "text/html";
           //添加收件人
           string[] lvToEmail;
           lvToEmail = ToEmail.Split(',');
           for (int jj = 0; jj < lvToEmail.Length; jj++)
           {
           jmail.AddRecipient(lvToEmail[jj], "", "");
           }

           //jmail.AddRecipient(ToEmail, "", "");
           //jmail.AddRecipient(ToEmail2, "", "");
           //jmail.From = FromEmail;
           //发件人邮件用户名
           //jmail.MailServerUserName = lssendid.Substring(0,lssendid.IndexOf("@"));
           jmail.MailServerUserName = lssendid;
           //发件人邮件密码
           jmail.MailServerPassWord = lssendpwd;
           //设置邮件标题
           jmail.Subject = Subject;
           //邮件内容
           jmail.HTMLBody = body;
           //邮件添加附件,(多附件的话,可以再加一条Jmail.AddAttachment( "c:test.jpg",true,null);)就可以搞定了。[注]:加了附件,讲把上面的 Jmail.ContentType="text/html";删掉。否则会在邮件里出现乱码。
           //jmail.AddAttachment(@"D:\bbb.rar", true, "htm");
           //jmail.AddAttachment(@"D:\bbb.txt", true, "htm");
           //邮件附件
           HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
           DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(lsid);
           if (dtfileatt.Rows.Count > 0)
           {
           for (int jj = 0; jj < dtfileatt.Rows.Count; jj++)
           {
               jmail.AddAttachment(@lsml + "\\" + dtfileatt.Rows[jj]["hy_filepath"].ToString(), true, "htm");
           }
           }
           //Jmail发送的方法
           jmail.Send(lshost, false);
           jmail.Close();
    }
コード例 #17
0
    private void DataPlay()
    {
        //HyoaClass.Hyoa_back Hyoa_back = new HyoaClass.Hyoa_back();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (this.Request.QueryString["fatherid"] != null)
        {
            this.txtfatherid.Value = this.Request.QueryString["fatherid"].ToString();   //得到父文档ID

            string lssql = "Select * from hyt_back where hy_fatherid = '" + this.txtfatherid.Value + "' and hy_fkrid = '" + this.Session["hyuid"].ToString() + "'";
            DataTable dt = Hyoa_global.GetDataTable(lssql);
            //DataTable dt = Hyoa_back.Getbackbyfatheridandfkrid(this.txtfatherid.Value, this.Session["hyuid"].ToString());
            if (dt.Rows.Count > 0)
            {
                this.txtdocid.Value = dt.Rows[0]["ID"].ToString();
                this.txtbackidea.Text = RtfToText(dt.Rows[0]["hy_backidea"].ToString());
                if (dt.Rows[0]["hy_backdate"].ToString() == "" )
                {
                    this.txtbackdate.Value = "";
                }
                else
                {
                    if (System.DateTime.Parse(dt.Rows[0]["hy_backdate"].ToString()).ToShortDateString() == "1900-1-1")
                    {
                        this.txtbackdate.Value = "";
                    }
                    else
                    {
                        this.txtbackdate.Value = System.DateTime.Parse(dt.Rows[0]["hy_backdate"].ToString()).ToShortDateString();
                    }
                }
                this.txtqfr.Value = dt.Rows[0]["hy_qfr"].ToString();
                //得到附件
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
                if (dt_fileatt.Rows.Count > 0)
                {
                    string ls_temp = "";
                    for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                    {
                        ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                    }
                    this.lblfj.Text = ls_temp;
                }
            }
            else
            {
                //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
                //文档ID
                this.txtdocid.Value = Hyoa_global.GetRandom();
                this.txtbackdate.Value = System.DateTime.Now.ToShortDateString();
            }
        }
    }
コード例 #18
0
 private void DataPlay()
 {
     HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
     this.btn_submit.Visible = true; //保存
     HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
     string ls_att = "";
     this.lbupfile.Text = "无附件!";
     string lshy_fatherfield = "";
 }
コード例 #19
0
ファイル: main.aspx.cs プロジェクト: wjszxli/Webapp
    //得到表单的HTML pi_flag 0:不赋值  1:需赋值    Written by xf 20110515
    //docid:旧文档使用时,文档ID
    //ifhavarole:是否有权限  0:lable输出 1:input输出
    //ifflowdoc:是否流程表单 0:非流程 1:流程
    //curtacheid:当前环节ID,用于判断字段是否在当前环节有权限
    public DataTable GetDataTableFieldHtml(string hy_mudelid, string hy_tableid, string pi_flag, string ifsearch, string docid, string ifhavarole, string ifflowdoc, string curtacheid)
    {
        //加载表单
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        //根据模块ID和表单ID得到对应的配置字段
        DataTable dt_gettablecolumns = Hyoa_flowfield.GetflowfieldsbyMudelidAndTableid(hy_mudelid, hy_tableid);
        string ls_html = "";
        Int32 li_tdnums = 0;    //TDS数(colspan的值相加)

        DataTable tempTable = new DataTable();
        DataColumn col = new DataColumn("displaycol", typeof(String)); //定义新的一列  add
        tempTable.Columns.Add(col);  //追加一列  add

        if (dt_gettablecolumns.Rows.Count > 0)
        {
            //先从配置表中将配置的列数取出,如果配置表中找不到,则默认为4列,并且设置相应的宽度start
            HyoaClass.Hyoa_detail Hyoa_detail = new HyoaClass.Hyoa_detail();
            int li_col = 4;//一行显示几列
            string ls_leftwidth = "15";//左侧列宽
            string ls_rightwidth = "35";//右侧列宽
            DataTable detaildt = Hyoa_detail.Getdetail(hy_tableid);
            if (detaildt.Rows.Count > 0)
            {
                li_col = int.Parse(detaildt.Rows[0]["hy_colnum"].ToString());
                if (detaildt.Rows[0]["hy_colnum"].ToString() == "6")
                {
                    ls_leftwidth = "10";
                    ls_rightwidth = "23";
                }
                else
                {
                    if (detaildt.Rows[0]["hy_colnum"].ToString() == "8")
                    {
                        ls_leftwidth = "5";
                        ls_rightwidth = "7";
                    }
                    else
                    {
                        if (detaildt.Rows[0]["hy_colnum"].ToString() == "10")
                        {
                            ls_leftwidth = "4";
                            ls_rightwidth = "6";
                        }
                    }
                }
            }
            //先从配置表中将配置的列数取出,如果配置表中找不到,则默认为4列,并且设置相应的宽度end

            //开始加载字段信息到DT中,用于前台显示
            for (int i = 0; i < dt_gettablecolumns.Rows.Count; i++)
            {
                if (i == 0)
                {
                    ls_html += "<TR height=\"30\">";
                }
                //输出字段说明列(文字说明除外)
                if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() != "说明文字")
                {
                    //20120724
                    //如果是隐藏字段,则隐藏(增加display)   added by xf 20120217
                    if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                        ls_html += "<TD width=\"" + ls_leftwidth + "%\" align=\"center\" class=\"Tdcellleft\">" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "</TD>";
                    else
                        ls_html += "<div style=\"display:none\">" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "</div>";
                    //ls_html += "<TD width=\"" + ls_leftwidth + "%\" align=\"center\" class=\"Tdcellleft\">" + dt_gettablecolumns.Rows[i]["hy_fieldname"].ToString() + "</TD>";
                }
                //得到当前字段的值
                HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
                DataTable dt_flowmain = Hyoa_flowmain.Getflowmain(docid);
                string field_docvalue = "&nbsp;";
                if (dt_flowmain.Rows.Count > 0)
                {
                    if (dt_gettablecolumns.Rows[i]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                    {
                        field_docvalue = System.DateTime.Parse(dt_flowmain.Rows[0][dt_gettablecolumns.Rows[i]["hy_sqlfield"].ToString()].ToString()).ToShortDateString() + field_docvalue;
                    }
                    else
                    {
                        //如果SQL为数值的字段部分,则需要截取小数点后边两位
                        if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "数值")
                        {
                            if (dt_flowmain.Rows[0][dt_gettablecolumns.Rows[i]["hy_sqlfield"].ToString()].ToString().Contains(".") == true)
                                field_docvalue = float.Parse(dt_flowmain.Rows[0][dt_gettablecolumns.Rows[i]["hy_sqlfield"].ToString()].ToString()).ToString("F2") + field_docvalue;
                            else
                                field_docvalue = dt_flowmain.Rows[0][dt_gettablecolumns.Rows[i]["hy_sqlfield"].ToString()].ToString() + field_docvalue;
                        }
                        else
                        {
                            field_docvalue = dt_flowmain.Rows[0][dt_gettablecolumns.Rows[i]["hy_sqlfield"].ToString()].ToString() + field_docvalue;
                        }
                    }
                }
                //输出字段列
                //this.Response.Write("<script>alert('" + ifhavarole + "');</script>");
                if (ifhavarole == "0")  //无权限(当前表单来讲)
                {
                    //附件组件的值需要特定读取(附件需要特殊处理) Added by xf 20110607
                    if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "附件组件")
                    {

                        field_docvalue = "";
                        //根据docid得到目前已上传的附件信息
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                        DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(docid);
                        if (dt_fileatt.Rows.Count > 0)
                        {
                            for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++)
                            {
                                string ls_name = "";
                                DataTable dt_user = Hyoa_user.Getuser(dt_fileatt.Rows[ii]["hy_userid"].ToString());
                                if (dt_user.Rows.Count > 0)
                                {
                                    ls_name = dt_user.Rows[0]["hy_username"].ToString();
                                }
                                field_docvalue += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + "&nbsp;&nbsp;&nbsp;&nbsp;" + ls_name + "&nbsp;&nbsp;[" + dt_fileatt.Rows[ii]["hy_djsj"].ToString() + "]" + "</a><br />";
                            }
                        }
                        if (field_docvalue == "")
                            field_docvalue = "&nbsp;";
                    }
                    //痕迹保留组件的值需要读取(需要特殊处理) Added by xf 20110705
                    if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "痕迹保留")
                    {
                        field_docvalue = "";
                        field_docvalue += "<input type=button id=\"btn_zwxg\" value='正  文' class=btn3 onclick=\"window.open('ntko/readoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=1&jsxd=1','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" ";
                        if (field_docvalue == "")
                            field_docvalue = "&nbsp;";
                    }
                    //ztmztmztmstart
                    //this.Response.Write("<script>alert('" + field_docvalue + "');</script>");
                    if (field_docvalue.Length > 7)
                    {

                        if (field_docvalue.Substring(0, 8) == "1900-1-1")
                        {
                            field_docvalue = "&nbsp;";
                        }
                    }
                    //ztmztmztmend
                    if (dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() == "1")
                    {
                        //如果是隐藏字段,则隐藏(增加display)   added by xf 20120217
                        if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                            ls_html += "<TD width=\"" + ls_rightwidth + "%\" height=\"30px\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\">" + field_docvalue + "</TD>";
                        else
                            ls_html += "<div style=\"display:none\">" + field_docvalue + "</div>";
                        //ls_html += "<TD width=\"" + ls_rightwidth + "%\" height=\"30px\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\">" + field_docvalue + "</TD>";
                    }
                    else
                    {
                        //如果是隐藏字段,则隐藏(增加display)   added by xf 20120217
                        if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                            ls_html += "<TD width=\"" + ls_rightwidth + "%\" height=\"30px\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\" colspan=" + dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() + ">" + field_docvalue + "</TD>";
                        else
                            ls_html += "<div style=\"display:none\">" + field_docvalue + "</div>";
                        //ls_html += "<TD width=\"" + ls_rightwidth + "%\" height=\"30px\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\" colspan=" + dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() + ">" + field_docvalue + "</TD>";
                    }
                }
                else
                {
                    //有权限(当前表单来讲)时,判断当前流程+当前环节对于这个字段是否有权限操作
                    string ls_ifhavarole = "0";    //默认没有权限(当前字段来讲)---该功能仅对于流程模块起作用
                    //非流程直接就有权限了
                    //this.Response.Write("<script>alert('" + ifflowdoc + "');</script>");
                    if (ifflowdoc == "0")
                    {
                        ls_ifhavarole = "1";
                    }
                    else
                    {
                        //判断当前字段是否有权限
                        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
                        ls_ifhavarole = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(dt_gettablecolumns.Rows[i]["hy_flowid"].ToString(), curtacheid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString());
                    }

                    if (dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() == "1")
                    {
                        //如果是隐藏字段,则隐藏(增加display)   added by xf 20120217
                        if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                            ls_html += "<TD width=\"" + ls_rightwidth + "%\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</TD>";
                        else
                            ls_html += "<div style=\"display:none\">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</div>";
                        //ls_html += "<TD width=\"" + ls_rightwidth + "%\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</TD>";
                    }
                    else
                    {
                        //如果是隐藏字段,则隐藏(增加display)   added by xf 20120217
                        if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                            ls_html += "<TD width=\"" + ls_rightwidth + "%\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\" colspan=" + dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() + ">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</TD>";
                        else
                            ls_html += "<div style=\"display:none\">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</div>";
                        //ls_html += "<TD width=\"" + ls_rightwidth + "%\" align=" + dt_gettablecolumns.Rows[i]["hy_align"].ToString() + " class=\"Tdcellright\" colspan=" + dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString() + ">" + GetFieldHtml(hy_mudelid, dt_gettablecolumns.Rows[i]["hy_fieldid"].ToString(), pi_flag, hy_tableid, ifsearch, docid, ls_ifhavarole) + "</TD>";

                    }
                }
                //开始colspan值累加,如果是隐藏字段,不计算在内
                if (dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                {
                    if (dt_gettablecolumns.Rows[i]["hy_fieldtype"].ToString() == "说明文字")
                        li_tdnums += System.Int32.Parse(dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString());
                    else
                        li_tdnums += System.Int32.Parse(dt_gettablecolumns.Rows[i]["hy_tdnums"].ToString()) + 1;
                }
                //this.lbtest.Text += "," + li_tdnums;
                if (li_tdnums % li_col == 0 && dt_gettablecolumns.Rows[i]["hy_ifhiddle"].ToString() != "是")
                {
                    ls_html += "</tr>";
                    DataRow dr = tempTable.NewRow();
                    dr["displaycol"] = ls_html;  //将新值赋给相应的列  add
                    tempTable.Rows.Add(dr);
                    ls_html = "";
                    if (i != (dt_gettablecolumns.Rows.Count - 1))
                        ls_html += "<tr>";
                }
                //先从配置表中将配置的列数取出,如果配置表中找不到,则默认为4列end
            }
        }
        return tempTable;
    }
コード例 #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.CacheControl = "no-cache";
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
        string ls_attsize = "";
        string str_path = "";
        string lspath = "";
        string lsguid = "";
        string lsurl = "";
        string lsfilename = "";
        string lshy_fatherfield = Request.Params["fatherfield"].ToString();
        string lshy_fatherid = Request.Params["fatherid"].ToString();
        string hy_userid = Request.Params["hy_userid"].ToString();
             //Request.Params["fatherid"].ToString()+"\\"+Request.Params["fatherfield"].ToString();

                //string Datedir = DateTime.Now.ToString("yy-MM-dd");
                //string updir = s_rpath + "\\" + Datedir;
                //string updir = s_rpath;
                if (this.Page.Request.Files.Count > 0)
                {
                    try
                    {

                        for (int j = 0; j < this.Page.Request.Files.Count; j++)
                        {
                            lsguid = Hyoa_global.GetRandom();
                            string s_rpath = Server.MapPath("~/") + "fileatt\\" + lsguid;
                            string updir = s_rpath;

                            HttpPostedFile uploadFile = this.Page.Request.Files[j];

                            if (uploadFile.ContentLength > 0)
                            {
                                if (!Directory.Exists(updir))
                                {
                                    Directory.CreateDirectory(updir);
                                }
                                string extname = Path.GetExtension(uploadFile.FileName);
                                string fullname=DateTime.Now.Year.ToString()+DateTime.Now.Month.ToString()+DateTime.Now.Day.ToString()+ DateTime.Now.Hour.ToString()+DateTime.Now.Minute.ToString()+DateTime.Now.Second.ToString();
                                string filename = uploadFile.FileName;

                                //上传附件名称特殊字符的处理
                                if (filename.IndexOf('#') > 0)
                                {
                                    filename = filename.Replace("#", "#");
                                }

                                lsfilename = filename;
                                lsurl = "fileatt\\" + lsguid + "\\" + filename; //存放的文件夹
                                uploadFile.SaveAs(string.Format("{0}\\{1}", updir, filename));

                                Hyoa_fileatt.ID = lsguid;
                                Hyoa_fileatt.hy_fatherid = lshy_fatherid;
                                Hyoa_fileatt.hy_filename = lsfilename;
                                Hyoa_fileatt.hy_filepath = lsurl;
                                Hyoa_fileatt.hy_filesize = ls_attsize;
                                Hyoa_fileatt.hy_userid = hy_userid;
                                Hyoa_fileatt.hy_djsj = System.DateTime.Now.ToString();
                                Hyoa_fileatt.hy_fatherfield = lshy_fatherfield;
                                Hyoa_fileatt.Insert();

                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Response.Write("Message"+ ex.ToString());
                    }

        }
    }
コード例 #21
0
ファイル: list.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    private void DataPlay(int PageNo)
    {
        //得到当前模块对应的role
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        DataTable dt_mudel = Hyoa_mudel.Getmudel(this.txtmudelid.Value);
        string ls_role = "Rolegwk";
        if (dt_mudel.Rows.Count > 0)
            ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString();

        //判断当前用户是否有删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
        {
            this.isrole.Value = "1";
            this.tddeldoc.Visible = true; //删除
            this.tdnewdoc.Visible = true;//新建
        }
        else
        {
            this.isrole.Value = "0";
            this.tddeldoc.Visible = false; //删除
            this.tdnewdoc.Visible = false;//新建
        }

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

        //已流转完成的全局公告
        string sql = "";
        string lstypeid = "";
        if (this.Request.QueryString["type"] != null)
        {
            lstypeid = this.Request.QueryString["type"].ToString();
        }
        sql = "select * from hyp_gwk where 1=1";

        if (this.hy_djsj_start_1.Value != "")
        {
            if (Session["conntype"].ToString() == "SQL")
            {
                sql += " and hy_djsj>='" + this.hy_djsj_start_1.Value + "' ";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                sql += " and to_char(hy_djsj,'YYYY-MM-DD')>='" + this.hy_djsj_start_1.Value + "' ";
            }
        }
        if (this.hy_djsj_end_1.Value != "")
        {
            if (Session["conntype"].ToString() == "SQL")
            {
                sql += " and hy_djsj<='" + this.hy_djsj_end_1.Value + "' ";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                sql += " and to_char(hy_djsj,'YYYY-MM-DD')<='" + this.hy_djsj_end_1.Value + "' ";
            }
        }
        if (this.hy_bt_1.Value != "")
            sql += " and hy_bt like '%" + this.hy_bt_1.Value + "%' ";

        if (this.hy_wh_1.Value != "")
            sql += " and hy_wh like '%" + this.hy_wh_1.Value + "%' ";

        if (lstypeid != "")
            sql += " and hy_typeid = '" + lstypeid + "' ";

        sql += " order by hy_djsj desc ";

        DataTable dt = Hyoa_global.GetDataTable(sql);
        DataTable tempTable = dt.Clone();
        DataColumn col = new DataColumn("lookfileatt", typeof(String)); //定义新的一列  add
        tempTable.Columns.Add(col);  //追加一列  add
        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];
            }

            //fileatt
            string ls_classnames = "";   //add
            if (dt.Rows[i]["hy_mudelid"].ToString() == "Mudelfwgl")
            {
                string lssqlfwglfile;
                lssqlfwglfile = "select * from files where fother = '" + dt.Rows[i]["hy_fatherid"].ToString() + "'";
                DataTable dtfwglfile = Hyoa_global.GetDataTable(lssqlfwglfile);
                if (dtfwglfile.Rows.Count > 0)
                {
                    for (int jfile = 0; jfile < dtfwglfile.Rows.Count; jfile++)
                    {
                        if (ls_classnames == "")
                        {
                            ls_classnames = "<a href='../NTKO/" + dtfwglfile.Rows[jfile]["fpath"].ToString() + "/" + dtfwglfile.Rows[jfile]["fname"].ToString() + "' target=_blank>正文</a>";
                        }
                        else
                        {
                            ls_classnames += "<br>" + "<a href='../NTKO/" + dtfwglfile.Rows[jfile]["fpath"].ToString() + "/" + dtfwglfile.Rows[jfile]["fname"].ToString() + "' target=_blank>正文</a>";
                        }
                    }
                }

            }
            HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
            DataTable dtfile = new DataTable();
            if (dt.Rows[i]["hy_fatherid"].ToString() == "")
            {
                dtfile = Hyoa_fileatt.GetfileattByFatherid(dt.Rows[i]["ID"].ToString());
            }
            else
            {
                dtfile = Hyoa_fileatt.GetfileattByFatherid(dt.Rows[i]["hy_fatherid"].ToString());
            }

            if (dtfile.Rows.Count > 0)
            {
                for (int ifile = 0; ifile < dtfile.Rows.Count; ifile++)
                {
                    if (ls_classnames == "")
                    {
                        ls_classnames = "<a href='../" + dtfile.Rows[ifile]["hy_filepath"].ToString() + "' target=_blank>" + dtfile.Rows[ifile]["hy_filename"].ToString() + "</a>";
                    }
                    else
                    {
                        ls_classnames += "<br>" + "<a href='../" + dtfile.Rows[ifile]["hy_filepath"].ToString() + "' target=_blank>" + dtfile.Rows[ifile]["hy_filename"].ToString() + "</a>";
                    }
                }
            }

            dr["lookfileatt"] = ls_classnames;  //将新值赋给相应的列  add

            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();
    }
コード例 #22
0
    private void DataPlay()
    {
        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();
        }
        HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
        DataTable dt = Hyoa_wjcd.Getdoc(this.txtid.Value);
        if (dt.Rows.Count > 0)
        {
            this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString();
            this.txtid.Value = dt.Rows[0]["ID"].ToString();

            this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
            this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString();
            this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString();
            this.txthy_jsrname.Text = dt.Rows[0]["hy_jsrname"].ToString();
            this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString();
            this.txthy_title.Text = dt.Rows[0]["hy_title"].ToString();
            this.ddlhy_foldername.Text = dt.Rows[0]["hy_foldername"].ToString();
            if (dt.Rows[0]["hy_jzsj"] == System.DBNull.Value)
            {
                this.jzsj.Text = "";
            }
            else
            {
                if (System.DateTime.Parse(dt.Rows[0]["hy_jzsj"].ToString()).ToShortDateString() == "1900-1-1")
                {
                    this.jzsj.Text = "";
                }
                else
                {
                    this.jzsj.Text = System.DateTime.Parse(dt.Rows[0]["hy_jzsj"].ToString()).ToShortDateString();
                }
            }
            if (dt.Rows[0]["hy_txfs"] == System.DBNull.Value)
            {
                this.txfs.Text = "";
            }
            else
            {
                this.txfs.Text = dt.Rows[0]["hy_txfs"].ToString();
            }
            //附件
            HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
            DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
            if (dt_fileatt.Rows.Count > 0)
            {
                string ls_temp = "";
                for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                {
                    string ls_path = dt_fileatt.Rows[i]["hy_filepath"].ToString();
                    ls_path = ls_path.Replace("+","%2B");
                    ls_temp += (i + 1).ToString() + "、<a href='/" + ls_path + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                }
                this.lblhy_field2.Text = ls_temp;
            }

            this.hy_content1.Text = dt.Rows[0]["hy_body"].ToString();

            //显示回复列表
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            //string ls_hfsql = "select * from hyp_gzlxdhf where hy_fsrdocid='" + this.txtdocid.Value + "' ";
            string ls_jsrsql = "select * from hyp_wjcd where hy_type='收件' and DOCID='" + this.txtdocid.Value + "' order by  hy_jsrid asc";
            DataTable dt_jsr = Hyoa_global.GetDataTable(ls_jsrsql);
            if (dt_jsr.Rows.Count > 0)
            {
                //输出回复记录
                this.lblhf.Text = "";
                this.lblhf.Text = "<table width=\"95%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" class=\"tb1-main\">";
                this.lblhf.Text += "<tr><td colspan='7' class='Tdcellright'>回复情况:共" + dt_jsr.Rows.Count + "人</td></tr>";
                this.lblhf.Text += "<tr>";
                this.lblhf.Text += "<td width='10%' class='Tdcellleft' align='center'>序号</td>";
                this.lblhf.Text += "<td width='15%' class='Tdcellleft' align='center'>部门名称</td>";
                this.lblhf.Text += "<td width='10%' class='Tdcellleft' align='center'>回复人</td>";
                this.lblhf.Text += "<td width='15%' class='Tdcellleft' align='center'>回复时间</td>";
                this.lblhf.Text += "<td class='Tdcellleft' align='center'>回复内容</td>";
                this.lblhf.Text += "<td width='15%' class='Tdcellleft' align='center'>附件</td>";
                this.lblhf.Text += "<td width='10%' class='Tdcellleft' align='center'>上报情况</td>";
                this.lblhf.Text += "</tr>";
                for (var i = 0; i < dt_jsr.Rows.Count; i++)
                {
                    string ls_bmmc = "";
                    string ls_hfr = "";
                    string ls_hfsj = "";
                    string ls_hfnr = "";
                    string ls_fj = "";
                    string ls_sbqk = "";

                    if (dt_jsr.Rows[i]["hy_ifyhf"].ToString() == "1")
                    {
                        string ls_hfsql = "select * from hyp_gzlxdhf where hy_fsrdocid='" + this.txtdocid.Value + "' and hy_jsrdocid='" + dt_jsr.Rows[i]["ID"].ToString() + "' ";
                        DataTable dt_hf = Hyoa_global.GetDataTable(ls_hfsql);
                        if (dt_hf.Rows.Count > 0)
                        {
                            ls_bmmc = dt_hf.Rows[0]["hy_deptname"].ToString();
                            ls_hfr = dt_hf.Rows[0]["hy_username"].ToString();
                            ls_hfsj = dt_hf.Rows[0]["hy_time"].ToString();
                            ls_hfnr = dt_hf.Rows[0]["hy_body"].ToString();
                            //附件
                            DataTable dt_fileatt2 = Hyoa_fileatt.GetfileattByFatherid(dt_hf.Rows[0]["hy_jsrdocid"].ToString());
                            if (dt_fileatt2.Rows.Count > 0)
                            {
                                for (var j = 0; j < dt_fileatt2.Rows.Count; j++)
                                {
                                    if (ls_fj != "")
                                    {
                                        ls_fj += "<br />";
                                    }
                                    ls_fj += (j + 1).ToString() + "、<a href='/" + dt_fileatt2.Rows[j]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt2.Rows[j]["hy_filename"].ToString() + "</a>";
                                }
                            }
                            //上报情况
                            System.TimeSpan ts = System.DateTime.Parse(dt_hf.Rows[0]["hy_time"].ToString()) - System.DateTime.Parse(dt_jsr.Rows[0]["hy_jzsj"].ToString());
                            int days = ts.Days;
                            if (days > 0)
                            {
                                ls_sbqk = "逾期上报";
                            }
                            else
                            {
                                ls_sbqk = "按期上报";
                            }
                        }
                    }
                    else
                    {
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        DataTable dt_user = Hyoa_user.Getuserallinfo(dt_jsr.Rows[i]["hy_jsrid"].ToString());
                        if (dt_user.Rows.Count > 0)
                        {
                            HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
                            DataTable dt_dept = Hyoa_dept.Getdept(dt_user.Rows[0]["hy_deptid"].ToString());
                            if (dt_dept.Rows.Count > 0)
                            {
                                ls_bmmc = dt_dept.Rows[0]["hy_deptname"].ToString();
                            }
                        }
                        ls_hfr = dt_jsr.Rows[i]["hy_jsrname"].ToString();
                        //附件
                        DataTable dt_fileatt2 = Hyoa_fileatt.GetfileattByFatherid(dt_jsr.Rows[i]["ID"].ToString());
                        if (dt_fileatt.Rows.Count > 0)
                        {
                            for (var j = 0; j < dt_fileatt2.Rows.Count; j++)
                            {
                                ls_fj += (j + 1).ToString() + "、<a href='/" + dt_fileatt2.Rows[j]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt2.Rows[j]["hy_filename"].ToString() + "</a><br />";
                            }
                        }
                        //上报情况
                        ls_sbqk = "未上报";
                    }

                    this.lblhf.Text += "<tr>";
                    this.lblhf.Text += "<td width='10%' class='Tdcellright' align='center'>" + (i + 1).ToString() + "</td>";
                    this.lblhf.Text += "<td width='15%' class='Tdcellright' align='center'>" + ls_bmmc + "</td>";
                    this.lblhf.Text += "<td width='10%' class='Tdcellright' align='center'>" + ls_hfr + "</td>";
                    this.lblhf.Text += "<td width='15%' class='Tdcellright' align='center'>" + ls_hfsj + "&nbsp;</td>";
                    this.lblhf.Text += "<td class='Tdcellright' align='center'>" + ls_hfnr + "&nbsp;</td>";
                    this.lblhf.Text += "<td width='20%' class='Tdcellright' align='center'>" + ls_fj + "&nbsp;</td>";
                    this.lblhf.Text += "<td width='10%' class='Tdcellright' align='center'>" + ls_sbqk + "</td>";
                    this.lblhf.Text += "</tr>";
                }
                this.lblhf.Text += "</table>";
            }
        }
    }
コード例 #23
0
    private void DataPlay()
    {
        //this.btn_submit.Visible = true; //保存
        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
        string ls_att = "";
        this.lbupfile.Text = "无附件!";
        string lshy_fatherfield = "";
        if (this.Request.QueryString["fatherfield"] != null)
        {
            lshy_fatherfield = this.Request.QueryString["fatherfield"].ToString();   //父文档配置的域名
        }
        if (this.Request.QueryString["fatherid"] != null)
            {
                DataTable dt = Hyoa_fileatt.GetfileattByFatheridandFatherfield(this.Request.QueryString["fatherid"].ToString(), lshy_fatherfield);   //是否弹出窗口
                if (dt.Rows.Count > 0)
                {
                    for(int j=0;j<dt.Rows.Count;j++)
                    {
                        ls_att += "<input type='checkbox' name='docids' value='" + dt.Rows[j]["ID"].ToString() + "'>" + "<a href=\"" + "\\" + dt.Rows[j]["hy_filepath"].ToString() + "\" target=_blank>" + dt.Rows[j]["hy_filename"].ToString() + "</a><br />";

                    }
                    this.lbupfile.Text = ls_att + "<br />";
                    this.lbupfile.Text += "<input type=\"button\" onclick=\"delfileatt();\" value=\"  删 除\" class=btn7 name=\"Button_Return\" />";

                }
            }
    }
コード例 #24
0
    private void DataPlay()
    {
        //加载文件分类
        HyoaClass.Hyoa_wjcd_class Hyoa_wjcd_class = new HyoaClass.Hyoa_wjcd_class();
        DataTable dt_class = Hyoa_wjcd_class.Getdocs();
        ddlhy_foldername.DataTextField = "ClassName";
        ddlhy_foldername.DataSource = dt_class;
        ddlhy_foldername.DataBind();
        this.ddlhy_foldername.Items.Insert(0, new ListItem("--请选择--", ""));

        //新文档
        if (this.txtop.Value == "add")
        {
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            this.txtdocid.Value = Hyoa_global.GetRandom();
            this.lblhy_fsrid.Text = Session["hyuid"].ToString();
            this.lblhy_fsrname.Text = Session["hyuname"].ToString();
            this.lblhy_datetime.Text = System.DateTime.Now.ToString();
            //如果是回复
            if (this.Request.QueryString["fhid"] != null)
            {
                HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
                DataTable dt = Hyoa_wjcd.Getdoc(this.Request.QueryString["fhid"].ToString());
                if (dt.Rows.Count > 0)
                {
                    this.txthy_jsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
                    this.txthy_jsrname.Value = dt.Rows[0]["hy_fsrname"].ToString();
                    this.txthy_title.Text = "回复:"+dt.Rows[0]["hy_title"].ToString();
                }
            }
            //如果是转发
            if (this.Request.QueryString["zfid"] != null)
            {
                HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
                DataTable dt = Hyoa_wjcd.Getdoc(this.Request.QueryString["zfid"].ToString());
                if (dt.Rows.Count > 0)
                {
                    this.txthy_title.Text = "转发:" + dt.Rows[0]["hy_title"].ToString();
                    this.hy_content1.Value = dt.Rows[0]["hy_body"].ToString();
                    this.txtdocid.Value = dt.Rows[0]["docid"].ToString();

                    //附件
                    HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                    DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(dt.Rows[0]["DOCID"].ToString());
                    if (dt_fileatt.Rows.Count > 0)
                    {
                        string ls_temp = "";
                        for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                        {
                            ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                        }
                        this.lblhy_field2.Text = ls_temp;

                    }
                }
                this.uploadhy_field2.Visible = false;

                this.jzsjtxfs.Visible = false;
            }
        }
        else
        {
            if (this.Request.QueryString["id"] != null)
            {
                this.txtid.Value = this.Request.QueryString["id"].ToString();
            }
            HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
            DataTable dt = Hyoa_wjcd.Getdoc(this.txtid.Value);
            if (dt.Rows.Count > 0)
            {
                this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString();
                this.txtid.Value = dt.Rows[0]["ID"].ToString();

                this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
                this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString();
                this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString();
                this.txthy_jsrname.Value = dt.Rows[0]["hy_jsrname"].ToString();
                this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString();
                this.txthy_title.Text = dt.Rows[0]["hy_title"].ToString();

                //附件
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
                if (dt_fileatt.Rows.Count > 0)
                {
                    string ls_temp = "";
                    for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                    {
                        ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                    }
                    this.lblhy_field2.Text = ls_temp;
                }

                this.hy_content1.Value = dt.Rows[0]["hy_body"].ToString();
                this.ddlifsavetofjx.SelectedValue = dt.Rows[0]["hy_ifsavetofjx"].ToString();
                this.ddlhy_foldername.SelectedValue = dt.Rows[0]["hy_foldername"].ToString();

            }
        }
    }
コード例 #25
0
ファイル: list_yk.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    protected void btndelinfo_my_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        String[] v_uids = this.txtuids.Value.Split(',');
        string ls_filepath = "";
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                //判断是否是当前用户的文档
                string sql = "select * from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'";
                DataTable dt_judge = Hyoa_global.GetDataTable(sql);
                if (dt_judge.Rows.Count > 0)
                {
                    if (dt_judge.Rows[0]["hy_djrid"].ToString() == Session["hyuid"].ToString())
                    {
                        sql = "delete from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'";
                        Hyoa_global.ExcuteSQL(sql);

                        //删除文档时将待办事宜删除start
                        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
                        Hyoa_dbsy.DOCID = v_uids[i];
                        Hyoa_dbsy.Deletebydocid(v_uids[i]);
                        //删除文档时将待办事宜删除end

                        //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start   add by xf 20121016
                        HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl();
                        Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i];
                        Hyoa_flowhistoryinfo_cl.DeleteByDOCID();
                        HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy();
                        Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i];
                        Hyoa_flowhistoryinfo_cy.DeleteByDOCID();
                        //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end

                        //删的时候将附件也删除start
                        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                        DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]);
                        if (dtfileatt.Rows.Count > 0)
                        {
                            for (int k = 0; k < dtfileatt.Rows.Count; k++)
                            {
                                ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString();
                                if (File.Exists(ls_filepath))
                                {
                                    System.IO.File.Delete(ls_filepath);
                                }
                                Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString();
                                Hyoa_fileatt.Delete();
                            }
                        }
                        //删的时候将附件也删除end
                    }
                }
            }
        }
        this.txtuids.Value = "";
        //DataPlay(1);
        DataPlay(System.Int32.Parse(this.curpage.Text));
    }
コード例 #26
0
ファイル: list_bh.aspx.cs プロジェクト: wjszxli/hyoav10_gdcrm
    private void DataPlay(int PageNo)
    {
        //得到当前模块对应的role
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        DataTable dt_mudel = Hyoa_mudel.Getmudel(this.txtmudelid.Value);
        string ls_role = "Role9999";
        if (dt_mudel.Rows.Count > 0)
            ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString();

        //得到当前页号
        this.curpage.Text = PageNo.ToString();
        //HyoaClass.DAO db = new HyoaClass.DAO();
        string sql = "";

        //判断当前用户是否有权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()) || Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
        {
            this.isrole.Value = "1";
            this.tddeldoc.Visible = true; //删除
        }
        else
        {
            this.isrole.Value = "0";
            this.tddeldoc.Visible = false; //删除
        }

        string lssql = "select * from hyc_" + this.txttableid.Value +" where 1=1 ";
        if (this.hy_field31_start_1.Value != "")
        {
            if (Session["conntype"].ToString() == "SQL")
            {
                lssql += " and left(CONVERT(varchar, hyc_djsj, 120 ) ,10) >='" + this.hy_field31_start_1.Value + "'";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                lssql += " and to_char(hyc_djsj,'YYYY-MM-DD')>='" + this.hy_field31_start_1.Value + "'";
            }
        }
        if (this.hy_field31_end_1.Value != "")
        {
            if (Session["conntype"].ToString() == "SQL")
            {
                lssql += " and left(CONVERT(varchar, hyc_djsj, 120 ) ,10) <='" + this.hy_field31_end_1.Value + "'";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                lssql += " and to_char(hyc_djsj,'YYYY-MM-DD')<='" + this.hy_field31_end_1.Value + "'";
            }
        }
        if (this.hy_bt_1.Text != "")
        {
            lssql += " and hyc_dcsx like '%" + this.hy_bt_1.Text + "%' ";
        }
        if (Session["conntype"].ToString() == "SQL")
        {
            lssql += " order by convert(int,hyc_bh) desc";
        }
        if (Session["conntype"].ToString() == "ORACLE")
        {
            lssql += " order by TO_NUMBER(hyc_bh) desc";
        }
        //this.Response.Write(lssql);
        //return;

        DataTable dt = Hyoa_global.GetDataTable(lssql);

        DataTable tempTable = dt.Clone();

        DataColumn col2 = new DataColumn("hy_fileatt", typeof(String)); //定义新的一列  add
        tempTable.Columns.Add(col2);  //追加一列  add
        DataColumn col3 = new DataColumn("hy_jlqx", typeof(String)); //定义新的一列  add距离期限日
        tempTable.Columns.Add(col3);  //追加一列  add距离期限日
        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();  //add
        DataTable fileattdt;//add

        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];
            }

            //得到附件
            fileattdt = Hyoa_fileatt.GetfileattByFatherid(dt.Rows[i]["DOCID"].ToString());
            string lsfileatt = "";
            if (fileattdt.Rows.Count > 0)
            {
                for (int kk = 0; kk < fileattdt.Rows.Count; kk++)
                {
                    if (lsfileatt == "")
                    {
                        lsfileatt = "<a href='/" + fileattdt.Rows[kk]["hy_filepath"].ToString() + "' target='_blank'>" + fileattdt.Rows[kk]["hy_filename"].ToString() + "</a><br>";
                    }
                    else
                    {
                        lsfileatt += "<a href='/" + fileattdt.Rows[kk]["hy_filepath"].ToString() + "' target='_blank'>" + fileattdt.Rows[kk]["hy_filename"].ToString() + "</a><br>";
                    }
                }
            }

            DateTime t1 = DateTime.Parse(dt.Rows[i]["hyc_cbqx"].ToString());
            DateTime t2 = DateTime.Now;
            System.TimeSpan ts = t1 - t2;
            int days = ts.Days;

            dr["hy_fileatt"] = lsfileatt;  //将新值赋给相应的列  add
            if (dt.Rows[i]["hy_curtacheid"].ToString() == "**")
            {
                dr["hy_jlqx"] = "&nbsp;";
            }
            else
            {
                if (days < 0)
                {
                    dr["hy_jlqx"] = "<font color=red>"+days.ToString() + "天</font>";  //将新值赋给相应的列  add距离期限日
                }
                else
                {
                    dr["hy_jlqx"] = days.ToString() + "天";  //将新值赋给相应的列  add距离期限日
                }

            }

            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();
    }
コード例 #27
0
    //输出一个字段
    //li_tdnums_onerow:当前行已输出了几列
    //li_colnums_show:每行显示几列(标准情况下)
    //pi_isnewdoc 0:新文档  1:旧文档
    //ifhavarole:表单上是否有权限  0:lable输出 1:input输出
    //ifflowdoc:是否流程表单 0:非流程 1:流程
    //curtacheid:当前环节ID,用于判断字段是否在当前环节有权限
    public int GetFieldHtml(TableRow tRow, int li_tdnums_onerow, int li_colnums_show, string hy_fieldid, string pi_isnewdoc, string ifhavarole, string ifflowdoc, string curtacheid)
    {
        int li_return = li_tdnums_onerow;

        string ls_laborinput = "0";     //输出LABLE还是INPUT    0:LABLE    1:INPUT
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        DataTable dtfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(this.hy_mudelid.Text, hy_fieldid, this.hy_tableid.Text);

        int li_left = 30;
        int li_right = 70;
        if (dtfield.Rows.Count > 0)
        {
            string field_type = dtfield.Rows[0]["hy_fieldtype"].ToString();     //字段类型
            if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "5")   //如果设置了不显示左侧说明文字,则不加载左侧列
            {
                li_return += 1;
                //插入单元格(左侧)
                TableCell tCell = new TableCell();
                tRow.Cells.Add(tCell);
                tCell.Width = Unit.Percentage((li_left / li_colnums_show));
                tCell.Height = Unit.Pixel(30);
                tCell.CssClass = "Tdcellleft";
                tCell.HorizontalAlign = HorizontalAlign.Center;
                tCell.Controls.Add(new LiteralControl(dtfield.Rows[0]["hy_fieldname"].ToString()));
            }
            else
            {
                li_left = 50;
                li_right = 50;
            }
            //插入单元格(右侧)
            TableCell tCell2 = new TableCell();
            tRow.Cells.Add(tCell2);
            tCell2.Width = Unit.Percentage((li_right / li_colnums_show));
            tCell2.Height = Unit.Pixel(30);
            tCell2.CssClass = "Tdcellright";
            if (dtfield.Rows[0]["hy_align"].ToString() == "left")
            {
                tCell2.HorizontalAlign = HorizontalAlign.Left;
            }
            if (dtfield.Rows[0]["hy_align"].ToString() == "center")
            {
                tCell2.HorizontalAlign = HorizontalAlign.Center;
            }
            if (dtfield.Rows[0]["hy_align"].ToString() == "right")
            {
                tCell2.HorizontalAlign = HorizontalAlign.Right;
            }
            tCell2.ColumnSpan = int.Parse(dtfield.Rows[0]["hy_tdnums"].ToString());
            li_return += int.Parse(dtfield.Rows[0]["hy_tdnums"].ToString());

            //赋值(新文档取配置的默认值,旧文档取数据库表中的值)
            string field_docvalue = "";
            if (pi_isnewdoc == "0")     //新文档
            {
                if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "-1")
                {
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "0")
                    {
                        field_docvalue = dtfield.Rows[0]["hy_defaultvalue"].ToString();     //手工配置
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "1")
                    {
                        DataTable dt_getfieldvalue = Hyoa_global.GetDataTable(dtfield.Rows[0]["hy_defaultvalue"].ToString());
                        field_docvalue = dt_getfieldvalue.Rows[0][0].ToString();     //SQL语句
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "2")
                    {
                        field_docvalue = Session[dtfield.Rows[0]["hy_defaultvalue"].ToString()].ToString();     //SESSION
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "3")
                    {
                        if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                            field_docvalue = System.DateTime.Now.ToString("yyyy-MM-dd");     //当前时间
                        else
                            field_docvalue = System.DateTime.Now.ToString("yyyy-MM-dd HH:MM:ss");     //当前时间
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "4")
                    {
                        //自动生成
                        if (dtfield.Rows[0]["hy_fieldtype"].ToString() == "数值")
                        {
                            //得到目前最大的数值,然后+1,未找到则赋值为1
                            DataTable dt_autovalue = Hyoa_global.GetDataTable("select max(hyc_" + hy_fieldid + ") maxint from hyc_" + this.hy_tableid.Text);
                            if (dt_autovalue.Rows[0]["maxint"].ToString() == null || dt_autovalue.Rows[0]["maxint"].ToString() == "")
                                field_docvalue += "1";
                            else
                                field_docvalue += (System.Int32.Parse(dt_autovalue.Rows[0]["maxint"].ToString()) + 1).ToString();
                        }
                        else
                        {
                            field_docvalue += System.Guid.NewGuid().ToString();
                        }
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "5")
                    {
                        field_docvalue += dtfield.Rows[0]["hy_defaultvalue"].ToString();
                    }
                }
            }
            else
            {
                if (field_type == "文本" || field_type == "多行文本" || field_type == "多行文本_TEXT" || field_type == "文本加按钮" || field_type == "多行文本加按钮" || field_type == "日期" || field_type == "数值" || field_type == "对话框列表" || field_type == "复选框" || field_type == "单选框" || field_type == "口令" || field_type == "编辑器")
                {
                    string ls_sql = "select hyc_" + hy_fieldid + " from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "'";
                    DataTable dt_getdocvalue = Hyoa_global.GetDataTable(ls_sql);
                    if (dt_getdocvalue.Rows.Count > 0)
                    {
                        field_docvalue = dt_getdocvalue.Rows[0][0].ToString();
                        if (field_type == "日期")
                        {
                            if (field_docvalue.Length > 8)
                            {
                                if (field_docvalue.Substring(0, 8) == "1900-1-1")
                                {
                                    field_docvalue = "&nbsp;";
                                }
                                else
                                {
                                    if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                                    {
                                        field_docvalue = System.DateTime.Parse(field_docvalue).ToString("yyyy-MM-dd");
                                    }
                                }
                            }
                        }
                    }
                }
                if (field_type == "说明文字")
                {
                    field_docvalue += dtfield.Rows[0]["hy_defaultvalue"].ToString();
                }
            }

            //判断是输出LABL还是INPUT
            if (pi_isnewdoc == "0")     //新文档
            {
                if (ifflowdoc == "0")   //非流程
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        ls_laborinput = "1";
                    }
                }
                else
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        //有流程(判断当前环节这个字段是否有权限)
                        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
                        ls_laborinput = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(hy_flowid.Text, curtacheid, hy_fieldid);
                        if (ls_laborinput == "0")
                        {
                            field_docvalue = "";
                        }
                    }
                    else
                    {
                        field_docvalue = "";
                    }
                }
            }
            else     //旧文档
            {
                if (ifflowdoc == "0")   //非流程
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        ls_laborinput = "1";
                        //如果文档已经确认,则输出lable
                        string ls_sql = "select hy_ifconfirm from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "'";
                        DataTable dt_getifconfirm = Hyoa_global.GetDataTable(ls_sql);
                        if (dt_getifconfirm.Rows.Count > 0)
                        {
                            if (dt_getifconfirm.Rows[0]["hy_ifconfirm"].ToString() == "1")
                                ls_laborinput = "0";
                        }
                    }
                }
                else
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        //有流程(判断当前环节这个字段是否有权限)
                        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
                        ls_laborinput = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(hy_flowid.Text, curtacheid, hy_fieldid);
                        //如果流程结束了,则输出lable
                        if (hy_curtacheid.Text == "**")
                        {
                            ls_laborinput = "0";
                        }
                    }
                }
            }

            //如果是输出LABLE,值为空则赋为&nbsp;不为空时需要转换回车和空格
            if (ls_laborinput == "0")
            {
                if (field_docvalue == "")
                {
                    field_docvalue = "&nbsp;";
                }
                else
                {
                    if (field_type != "编辑器")
                    {
                        field_docvalue = RtfToText(field_docvalue);
                    }
                }
            }

            //单行文本
            if (field_type == "文本")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //多行文本
            if (field_type == "多行文本")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //多行文本_TEXT
            if (field_type == "多行文本_TEXT")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //按钮
            if (field_type == "按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = "&nbsp;";
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value='" + dtfield.Rows[0]["hy_fieldname"].ToString() + "' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //一直显示的按钮
            if (field_type == "一直显示的按钮")
            {
                //-----开始输出字段------
                Label txtTextBox = new Label();
                txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value='" + dtfield.Rows[0]["hy_fieldname"].ToString() + "' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                txtTextBox.Text = field_docvalue;
                tCell2.Controls.Add(txtTextBox);
            }
            //日期
            if (field_type == "日期")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //文本加按钮
            if (field_type == "文本加按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    txtTextBox.Width = Unit.Parse("60%");
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //多行文本加按钮
            if (field_type == "多行文本加按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //意见加按钮
            if (field_type == "意见加按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    //txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" /><input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "_cz' value=' 重 置 ' class=btn3 onclick=\"document.getElementById('" + dtfield.Rows[0]["hy_fieldid"].ToString() + "').value='';\" />";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //数值
            if (field_type == "数值")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //对话框列表(下拉框
            if (field_type == "对话框列表")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    DropDownList ddlDropDownList = new DropDownList();
                    ddlDropDownList.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        ddlDropDownList.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        ddlDropDownList.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        ddlDropDownList.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        //手工配置
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                            for (int i = 0; i < lv_options.Length; i++)
                            {
                                ddlDropDownList.Items.Add(lv_options[i].ToString());
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        //SQL语句
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            //如果SQL语句中含有特殊标示,则需要替换
                            string ls_sql = dtfield.Rows[0]["hy_options"].ToString();
                            if (ls_sql.Contains("用户ID"))
                            {
                                ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'");
                            }
                            if (ls_sql.Contains("用户名"))
                            {
                                ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'");
                            }
                            if (ls_sql.Contains("部门ID"))
                            {
                                ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'");
                            }
                            if (ls_sql.Contains("部门名"))
                            {
                                ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'");
                            }
                            DataTable dt_options = Hyoa_global.GetDataTable(ls_sql);
                            ddlDropDownList.DataSource = dt_options;
                            ddlDropDownList.DataTextField = dt_options.Columns[0].ColumnName;
                            ddlDropDownList.DataValueField = dt_options.Columns[0].ColumnName;
                            ddlDropDownList.DataBind();
                        }
                    }
                    ddlDropDownList.Items.Insert(0, new ListItem("--请选择--", ""));
                    ddlDropDownList.SelectedValue = field_docvalue;
                    tCell2.Controls.Add(ddlDropDownList);
                }
            }
            //复选框(查询时直接显示文本框)
            if (field_type == "复选框")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    CheckBoxList txtTextBox = new CheckBoxList();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        //手工配置
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                            for (int i = 0; i < lv_options.Length; i++)
                            {
                                txtTextBox.Items.Add(lv_options[i].ToString());
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        //SQL语句
                        //如果SQL语句中含有特殊标示,则需要替换
                        string ls_sql = dtfield.Rows[0]["hy_options"].ToString();
                        if (ls_sql.Contains("用户ID"))
                        {
                            ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("用户名"))
                        {
                            ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门ID"))
                        {
                            ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门名"))
                        {
                            ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'");
                        }
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            DataTable dt_options = Hyoa_global.GetDataTable(ls_sql);
                            txtTextBox.DataSource = dt_options;
                            txtTextBox.DataTextField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataValueField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataBind();
                        }
                    }
                    if (field_docvalue != "")
                    {
                        field_docvalue = "," + field_docvalue + ",";
                        foreach (ListItem li in txtTextBox.Items)
                        {
                            if (field_docvalue.Contains(li.Value))
                                li.Selected = true;
                        }
                    }
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //单选框(查询时直接显示文本框)
            if (field_type == "单选框")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    RadioButtonList txtTextBox = new RadioButtonList();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        //手工配置
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                            for (int i = 0; i < lv_options.Length; i++)
                            {
                                txtTextBox.Items.Add(lv_options[i].ToString());
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        //SQL语句
                        //如果SQL语句中含有特殊标示,则需要替换
                        string ls_sql = dtfield.Rows[0]["hy_options"].ToString();
                        if (ls_sql.Contains("用户ID"))
                        {
                            ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("用户名"))
                        {
                            ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门ID"))
                        {
                            ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门名"))
                        {
                            ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'");
                        }
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            DataTable dt_options = Hyoa_global.GetDataTable(ls_sql);
                            txtTextBox.DataSource = dt_options;
                            txtTextBox.DataTextField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataValueField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataBind();
                        }
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //口令
            if (field_type == "口令")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = "&nbsp;";
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.Password;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //附件组件
            if (field_type == "附件组件")
            {
                //读取附件内容
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatheridandFatherfield(this.txtdocid.Value, hy_fieldid);
                field_docvalue = "";
                if (dt_fileatt.Rows.Count > 0)
                {
                    for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++)
                    {
                        field_docvalue += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + "</a><br />";
                    }
                }
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (field_docvalue == "")
                    {
                        field_docvalue = "&nbsp;";
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue += "<input type=button id='uploadfile1' value='附件管理' class=btn3 onclick=\"window.open('ggdy/main_fileatt.aspx?fatherid=" + this.txtdocid.Value + "&fatherfield=" + hy_fieldid + "','filewindow','height=350,width=600,top=100,left=200,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');\" />";
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //说明文字
            if (field_type == "说明文字")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //编辑器
            if (field_type == "编辑器")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    //隐藏文本框
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    txtTextBox.Style.Value = "display:none";
                    tCell2.Controls.Add(txtTextBox);
                    //编辑器
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "eWebEditor" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<iframe ID=\"eWebEditor" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"system/eWebEditor/ewebeditor.htm?id=" + dtfield.Rows[0]["hy_fieldid"].ToString() + "&style=Portal\" frameborder=0 scrolling=no width=" + dtfield.Rows[0]["hy_width"].ToString() + " height=" + dtfield.Rows[0]["hy_height"].ToString() + "></iframe>";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //痕迹保留
            if (field_type == "痕迹保留")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/readoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=1&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                    //如果是流程模块,则根据环节判断一下
                    if (ifflowdoc == "1")
                    {
                        //判断是否为第一环节
                        HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
                        DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, "*");
                        if (dtflowwork.Rows.Count > 0)
                        {
                            if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == this.hy_curtacheid.Text)
                            {
                                field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                            }
                            else
                            {
                                //判断是否为最后一个环节
                                dtflowwork.Clear();
                                dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                                if (dtflowwork.Rows.Count > 0)
                                {
                                    if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**")
                                    {
                                        field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=0&jsxd=1&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                                    }
                                    else
                                    {
                                        field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=0&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                                    }
                                }

                            }
                        }
                    }
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //IFRAME列表
            if (field_type == "IFRAME列表")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    field_docvalue = "<iframe id=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" name=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"" + dtfield.Rows[0]["hy_defaultvalue"].ToString() + "&motherid=" + this.txtdocid.Value + "&ishaverole=0\" frameborder=\"0\" scrolling=\"yes\" height=\"80px\" width=\"98%\"></iframe>";
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    field_docvalue = "<iframe id=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" name=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"" + dtfield.Rows[0]["hy_defaultvalue"].ToString() + "&motherid=" + this.txtdocid.Value + "&ishaverole=1\" frameborder=\"0\" scrolling=\"yes\" height=\"80px\" width=\"98%\"></iframe>";
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //子表信息带链接

            //子表信息不带链接

        }
        return li_return;
    }
コード例 #28
0
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改

            //判断当前用户是否有保存的权限
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            string ls_role = "Rolegwk";

            if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
            {
                this.btn_submit.Visible = true; //保存
            }
            else
            {
                this.btn_submit.Visible = false; //保存
            }

            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                uploadhy_field2.Visible = false;
                if (this.Request.QueryString["id"] != null)
                {
                    //根据id得到信息
                    this.txtdocid.Value = this.Request.QueryString["id"].ToString();
                    HyoaClass.Hyoa_gwk Hyoa_gwk = new HyoaClass.Hyoa_gwk();
                    DataTable dt = Hyoa_gwk.Getgwkbyid(this.txtdocid.Value);
                    if (dt.Rows.Count > 0)
                    {
                        this.txthy_djrname.Value = dt.Rows[0]["hy_djrname"].ToString();
                        this.txthy_djbmname.Value = dt.Rows[0]["hy_djbmname"].ToString();
                        this.txthy_bt.Value = dt.Rows[0]["hy_bt"].ToString();
                        this.txthy_wh.Value = dt.Rows[0]["hy_wh"].ToString();
                        //this.txthy_lwwh.Value = dt.Rows[0]["hy_lwwh"].ToString();
                        this.txthy_djsj.Value = dt.Rows[0]["hy_djsj"].ToString();
                        this.txthy_typename.Value = dt.Rows[0]["hy_typename"].ToString();
                        this.txttypeid.Value = dt.Rows[0]["hy_typeid"].ToString();
                        this.txtdjrid.Value = dt.Rows[0]["hy_djrid"].ToString();
                        this.txtdjrbmid.Value = dt.Rows[0]["hy_djbmid"].ToString();
                        this.txtfatherid.Value = dt.Rows[0]["hy_fatherid"].ToString();

                        //附件
                        string ls_temp = "";
                        if (dt.Rows[0]["hy_mudelid"].ToString() == "Mudelfwgl")
                        {
                            string lssqlfwglfile;
                            lssqlfwglfile = "select * from files where fother = '" + dt.Rows[0]["hy_fatherid"].ToString() + "'";
                            DataTable dtfwglfile = Hyoa_global.GetDataTable(lssqlfwglfile);
                            if (dtfwglfile.Rows.Count > 0)
                            {
                                for (int jfile = 0; jfile < dtfwglfile.Rows.Count; jfile++)
                                {
                                    if (ls_temp == "")
                                    {
                                        ls_temp = "<a href='../NTKO/" + dtfwglfile.Rows[jfile]["fpath"].ToString() + "/" + dtfwglfile.Rows[jfile]["fname"].ToString() + "' target=_blank>正文</a>";
                                    }
                                    else
                                    {
                                        ls_temp += "<br>" + "<a href='../NTKO/" + dtfwglfile.Rows[jfile]["fpath"].ToString() + "/" + dtfwglfile.Rows[jfile]["fname"].ToString() + "' target=_blank>正文</a>";
                                    }
                                }
                            }

                        }

                        HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                        DataTable dt_fileatt = new DataTable();
                        if (this.txtfatherid.Value == "")
                        {
                            dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
                        }
                        else
                        {
                            dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtfatherid.Value);
                        }
                        if (dt_fileatt.Rows.Count > 0)
                        {
                            for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                            {
                                if (ls_temp == "")
                                {
                                    ls_temp += "<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                                }
                                else
                                {
                                    ls_temp += "<br /><a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                                }
                            }
                            this.lblhy_field2.Text = ls_temp;

                        }
                    }
                    dt.Clear();
                }
            }
            else
            {

                this.txtdocid.Value = Hyoa_global.GetRandom();
                this.txthy_djrname.Value = this.Session["hyuname"].ToString();
                this.txtdjrid.Value = this.Session["hyuid"].ToString();
                this.txthy_djbmname.Value = this.Session["hydeptname"].ToString();
                this.txtdjrbmid.Value = this.Session["hydeptid"].ToString();
                this.txthy_djsj.Value = System.DateTime.Now.ToString();
            }
        }
    }
コード例 #29
0
    private void DataPlay()
    {
        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();
        }
        HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
        DataTable dt = Hyoa_wjcd.Getdoc(this.txtid.Value);
        if (dt.Rows.Count > 0)
        {
            this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString();
            this.txtid.Value = dt.Rows[0]["ID"].ToString();

            this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
            this.txtfsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
            this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString();
            this.txtfrsname.Text = dt.Rows[0]["hy_fsrname"].ToString();
            this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString();
            this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString();
            this.lblhy_title.Text = dt.Rows[0]["hy_title"].ToString();
            this.ddlhy_foldername.Text = dt.Rows[0]["hy_foldername"].ToString();

            if (dt.Rows[0]["hy_jzsj"] == System.DBNull.Value)
            {
                this.jzsj.Text = "";
            }
            else
            {
                if (System.DateTime.Parse(dt.Rows[0]["hy_jzsj"].ToString()).ToShortDateString() == "1900-1-1")
                {
                    this.jzsj.Text = "";
                }
                else
                {
                    this.jzsj.Text = System.DateTime.Parse(dt.Rows[0]["hy_jzsj"].ToString()).ToShortDateString();
                }
            }
            //附件
            HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
            DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
            if (dt_fileatt.Rows.Count > 0)
            {
                string ls_temp = "";
                for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                {
                    ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                }
                this.lblhy_field2.Text = ls_temp;
            }

            //回复附件
            DataTable dt_fileatt2 = Hyoa_fileatt.GetfileattByFatherid(this.txtid.Value);
            if (dt_fileatt2.Rows.Count > 0)
            {
                string ls_temp = "";
                for (var j = 0; j < dt_fileatt2.Rows.Count; j++)
                {
                    ls_temp += (j + 1).ToString() + "、<a href='/" + dt_fileatt2.Rows[j]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt2.Rows[j]["hy_filename"].ToString() + "</a><br />";
                }
                this.lblhy_field3.Text = ls_temp;
            }
            this.lblhy_content1.Text = dt.Rows[0]["hy_body"].ToString();

            //判断是否已回复
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            string lshfsql = "select * from hyp_gzlxdhf where hy_jsrdocid='" + this.txtid.Value + "' ";
            DataTable dt_hf = Hyoa_global.GetDataTable(lshfsql);
            if (dt_hf.Rows.Count > 0)
            {
                this.txthfnr.Text = dt_hf.Rows[0]["hy_body"].ToString();
                this.btn_submit.Visible = false;
            }
            else
            {
                this.txthfnr.Text = "已收到。";
            }
        }
    }
コード例 #30
0
ファイル: main_mail.aspx.cs プロジェクト: wjszxli/Webapp
    private void DataPlay()
    {
        HyoaClass.Hyoa_mail_config Hyoa_mail_config = new HyoaClass.Hyoa_mail_config ();
        DataTable dtmailcon = Hyoa_mail_config.Getmailconfigbyuserid(Session["hyuid"].ToString());
        for(int ii=0;ii<dtmailcon.Rows.Count;ii++)
        {
             this.ddlmailset.Items.Insert(ii,dtmailcon.Rows[ii]["hy_mailid"].ToString());
        }

        //新文档
        if (this.txtop.Value == "add")
        {
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            this.txtdocid.Value = Hyoa_global.GetRandom();
            this.lblhy_fsrid.Text = Session["hyuid"].ToString();
            this.lblhy_fsrname.Text = Session["hyuname"].ToString();
            this.lblhy_datetime.Text = System.DateTime.Now.ToString();
            //如果是回复
            if (this.Request.QueryString["fhid"] != null)
            {
                HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail();
                DataTable dt = Hyoa_mail.Getmail(this.Request.QueryString["fhid"].ToString());
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["hy_wbjsrid"].ToString() != "")
                    {
                        //this.txthy_jsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
                        this.txthy_wbjsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
                        //this.txthy_jsrid.Text = dt.Rows[0]["txthy_wbjsrid"].ToString();
                        //this.txthy_jsrname.Value = dt.Rows[0]["hy_fsrname"].ToString();
                        this.txthy_title.Text = "回复:" + dt.Rows[0]["hy_title"].ToString();
                    }
                    else
                    {
                        this.txthy_jsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
                        //this.txthy_wbjsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
                        this.txthy_jsrname.Value = dt.Rows[0]["hy_fsrname"].ToString();
                        this.txthy_title.Text = "回复:" + dt.Rows[0]["hy_title"].ToString();
                    }
                }
            }
             //如果是从在线人员中过来的
            if (this.Request.QueryString["recuserid"] != null)
            {
                HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                DataTable dtuser = Hyoa_user.Getuserallinfo(this.Request.QueryString["recuserid"].ToString());
                if (dtuser.Rows.Count > 0)
                {
                    this.txthy_jsrid.Text = this.Request.QueryString["recuserid"].ToString();
                    this.txthy_jsrname.Value = dtuser.Rows[0]["hy_username"].ToString();
                }
            }
            //如果是转发
            if (this.Request.QueryString["zfid"] != null)
            {
                HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail();
                DataTable dt = Hyoa_mail.Getmail(this.Request.QueryString["zfid"].ToString());
                if (dt.Rows.Count > 0)
                {
                    this.txthy_title.Text = "转发:" + dt.Rows[0]["hy_title"].ToString();
                    this.hy_content1.Value = dt.Rows[0]["hy_body"].ToString();
                    this.txtdocid.Value = dt.Rows[0]["docid"].ToString();

                    //附件
                    HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                    DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(dt.Rows[0]["DOCID"].ToString());
                    if (dt_fileatt.Rows.Count > 0)
                    {
                        string ls_temp = "";
                        for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                        {
                            ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                        }
                        this.lblhy_field2.Text = ls_temp;

                    }
                }
                this.uploadhy_field2.Visible = false;
            }
        }
        else
        {
            if (this.Request.QueryString["id"] != null)
            {
                this.txtid.Value = this.Request.QueryString["id"].ToString();
            }
            HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail();
            DataTable dt = Hyoa_mail.Getmail(this.txtid.Value);
            if (dt.Rows.Count > 0)
            {
                this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString();
                this.txtid.Value = dt.Rows[0]["ID"].ToString();

                this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
                this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString();
                this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString();
                this.txthy_jsrname.Value = dt.Rows[0]["hy_jsrname"].ToString();
                this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString();
                this.txthy_wbjsrid.Text = dt.Rows[0]["hy_wbjsrid"].ToString();
                this.txthy_title.Text = dt.Rows[0]["hy_title"].ToString();

                //附件
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
                if (dt_fileatt.Rows.Count > 0)
                {
                    string ls_temp = "";
                    for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                    {
                        ls_temp += (i + 1).ToString() + "、<a href='/" + dt_fileatt.Rows[i]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                    }
                    this.lblhy_field2.Text = ls_temp;
                }

                this.hy_content1.Value = dt.Rows[0]["hy_body"].ToString();
                this.ddlifsavetofjx.SelectedValue = dt.Rows[0]["hy_ifsavetofjx"].ToString();

            }

            //20120210 start
            if (dt.Rows[0]["hy_type"].ToString() == "发件" & dt.Rows[0]["hy_foldername"].ToString() == "发件箱")
            {

                string text = "<TR height='30'><TD width='20%' align='center' class='Tdcellleft'>序号</TD><TD width='40%' align='center' class='Tdcellleft'>姓名</TD><TD width='40%' align='center' class='Tdcellleft'>回执时间</TD></TR>";
                HyoaClass.DAO db = new HyoaClass.DAO();
                string sql = "";
                sql = "select * from hyt_mail where DOCID='" + this.txtdocid.Value + "' and hy_type ='收件' and hy_sccksj <> '' order by hy_sccksj asc";
                DataTable dt2 = db.GetDataTable(sql);
                if (dt2.Rows.Count > 0)
                {
                    for (var i = 0; i < dt2.Rows.Count; i++)
                    {
                        text = text + "<TR height='30'><TD width='20%' align='center' class='Tdcellright'>" + (i+1).ToString() + "</TD>";
                        text = text + "<TD width='40%' align='center' class='Tdcellright'>" + dt2.Rows[i]["hy_jsrname"].ToString() + "</TD>";
                        text = text + "<TD width='40%' align='center' class='Tdcellright'>" + dt2.Rows[i]["hy_sccksj"].ToString() + "</TD></TR>";
                    }
                }
                this.hzlb.Text = text;
            }
            //20120210 end
         }
    }