Ejemplo n.º 1
0
 //置为文档已读状态  edited by xf 20140625
 private void UpdateReadFlag()
 {
     HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
     string sql = "";
     //得到初始值
     sql = "select * from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "'";
     DataTable dt = Hyoa_global.GetDataTable(sql);
     string ls_readuserlist = "";
     string ls_readdatelist = "";
     if ((dt.Rows[0]["hy_readuserlist"].ToString() + ",").IndexOf("," + Session["hyuid"].ToString() + ",") < 0)
     {
         ls_readuserlist = dt.Rows[0]["hy_readuserlist"].ToString() + "," + Session["hyuid"].ToString();
         ls_readdatelist = dt.Rows[0]["hy_readdatelist"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
         sql = "update hyc_" + this.hy_tableid.Text + " set hy_readuserlist='" + ls_readuserlist + "' ,hy_readdatelist = '" + ls_readdatelist + "'";
         sql += "  where DOCID='" + this.txtdocid.Value + "'";
         Hyoa_global.ExcuteSQL(sql);
     }
 }
Ejemplo n.º 2
0
    //合同办理状态  完成
    private void Htblztwc()
    {
        HyoaClass.Hyoa_global db = new HyoaClass.Hyoa_global();
        string sql = "";
        DataTable dt = new DataTable();
        sql = "update hyt_blzt set hy_state='已完成' where DOCID='" + this.txtdocid.Value + "'";
        db.ExcuteSQL(sql);
        string url = "list_flc.aspx?mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&listid=f3cdf8e1-21eb-43ce-8481-f10f8a1db069&rnd=" + System.Guid.NewGuid().ToString();

        if (this.Request.QueryString["flag"] != null)
        {
            if (this.Request.QueryString["flag"] == "flag_wwcgz")
            {
                // Response.Write("<script>alert('已完成');</script>");
                //  Response.Write("<script>window.opener=null;window.close();</script>");// 不会弹出询问
                Response.Write("<script>alert('已完成');try{window.opener.location.reload();}catch(err){}self.close();</script>");
                // Response.Write("<script>window.location='system/list_wblsx.aspx?rnd =" + System.Guid.NewGuid().ToString() + "'</script>");
            }
        }
        Response.Write("<script>alert('已完成');window.location='" + url + "'</script>");
    }
Ejemplo n.º 3
0
 //判断单位名称是否存在并添加
 private void Khdaxx()
 {
     HyoaClass.Hyoa_global db = new HyoaClass.Hyoa_global();
     string ls_sql = "";
     string sql = "";
     DataTable dt = new DataTable();
     ls_sql = "select * from hyc_Tablekhda where 1=1";
     if (Request.Form["jfmc"] != null)
     {
         ls_sql += "and  hyc_dwmc='" + Request.Form["jfmc"].ToString() + "'";
     }
     dt = db.GetDataTable(ls_sql);
     if (dt.Rows.Count == 0)
     {
         sql = "insert into hyc_Tablekhda(DOCID,hy_mudelid,hy_tableid,hy_djrid,hy_djrname,hy_djrbmname,hy_djrbmid,hy_djsj,hyc_dwmc,hyc_dwdz)";
         sql += " values ('" + System.Guid.NewGuid().ToString() + "'";
         sql += ",'Mudelkhda','Tablekhda','" + Session["hyuid"].ToString() + "','" + Session["hyuname"].ToString() + "','" + Session["hydeptname"].ToString() + "','" + Session["hydeptid"].ToString() + "',getdate()";
         if (Request.Form["jfmc"] != null)
         {
             sql += ",'" + Request.Form["jfmc"].ToString() + "','";
         }
         if (Request.Form["jfdz"] != null)
         {
             sql += Request.Form["jfdz"].ToString() + "')";
         }
         db.ExcuteSQL(sql);
     }
 }
Ejemplo n.º 4
0
 //合同办理状态
 private void Htblzt()
 {
     HyoaClass.Hyoa_global db = new HyoaClass.Hyoa_global();
     string sql = "";
     string url = "";
     url = "main_flc.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&pop=1";
     DataTable dt = new DataTable();
     sql = "insert into hyt_blzt(ID,DOCID,hy_mudelid,hy_tableid,hy_state,hy_djsj,hy_djrid,hy_djrname,hy_djz,hy_url,hy_htmc,hy_mc)";
     sql += " values ('" + System.Guid.NewGuid().ToString() + "','" + this.txtdocid.Value + "','" + this.hy_mudelid.Text + "','" + this.hy_tableid.Text + "','未完成'";
     sql += ",'" + DateTime.Now.ToString("yyyy-MM-dd") + "','" + Session["hyuid"].ToString() + "','" + Session["hyuname"].ToString() + "','" + Session["hydeptname"].ToString() + "','" + url + "','" + this.lbltablename.Text + "'";
     if (this.hy_tableid.Text == "Tablekdjrht" || this.hy_tableid.Text == "Tablesyyhfwxy" || this.hy_tableid.Text == "Tablejdhazfwht"
         || this.hy_tableid.Text == "TableVODfwxy" || this.hy_tableid.Text == "Tableffpdfwht" || this.hy_tableid.Text == "TableDVBazfwdght"
         || this.hy_tableid.Text == "Tablejwdsjsxy" || this.hy_tableid.Text == "Tablejwdscsxy" || this.hy_tableid.Text == "Tablekdjrht"
         || this.hy_tableid.Text == "Tablesjcsfwht" || this.hy_tableid.Text == "Tablesjgdcsfwht" || this.hy_tableid.Text == "Tablesjtxyyhzxy"
         || this.hy_tableid.Text == "Tablezdyht" || this.hy_tableid.Text == "Tablegxhzhht" || this.hy_tableid.Text == "Tableqtht"
         //下面新合同 add by ccg 20150617
         || this.hy_tableid.Text == "Tablesyyhfwxy_new" || this.hy_tableid.Text == "Tableszdsywfwht_new" || this.hy_tableid.Text == "Tablejwdscsxy_new"
         || this.hy_tableid.Text == "Tablejwdsjm" || this.hy_tableid.Text == "Tablesjcsfwht_new" || this.hy_tableid.Text == "Tablekdjrht_new"
         || this.hy_tableid.Text == "Tablesjgdcsfwht_new" || this.hy_tableid.Text == "Tablesjtxyyhzxy_new" || this.hy_tableid.Text == "Tablezdyht"
         || this.hy_tableid.Text == "Tablegcsght" || this.hy_tableid.Text == "Tableqtht" || this.hy_tableid.Text == "Tablegxhzhht")
     {
         if (Request.Form["jfmc"] != null)
         {
             sql += ",'" + Request.Form["jfmc"].ToString() + "')";
         }
     }
     //add by zxx 20150305
     if (this.hy_tableid.Text == "Tablexjsq")
     {
         if (Request.Form["xm"] != null)
         {
             sql += ",'" + Request.Form["xm"].ToString() + "')";
         }
     }
     if (this.hy_tableid.Text == "Tableshd")
     {
         if (Request.Form["dwmc"] != null)
         {
             sql += ",'" + Request.Form["dwmc"].ToString() + "')";
         }
     }
     if (this.hy_tableid.Text == "Tableszds")
     {
         if (Request.Form["yhmc"] != null)
         {
             sql += ",'" + Request.Form["yhmc"].ToString() + "')";
         }
     }
     //Response.Write(sql);
     db.ExcuteSQL(sql);
 }
Ejemplo n.º 5
0
 private void Getslbh()
 {
     if (this.hy_tableid.Text == "Tableywsl")
     {
         string ls_sql = "SELECT TOP 1 * FROM hyc_Tableslbhwh ORDER BY hyc_pxh";
         HyoaClass.Hyoa_global hyoa = new HyoaClass.Hyoa_global();
         DataTable dt = hyoa.GetDataTable(ls_sql);
         if (dt.Rows.Count > 0)
         {
             string sqlSelect = "";
             if (DateTime.Now.Year.ToString() != dt.Rows[0]["hyc_nf"].ToString())
             {
                 sqlSelect = " update hyc_Tableslbhwh set hyc_nf='" + DateTime.Now.Year.ToString() + "',hyc_slbh='1' where docid='" + dt.Rows[0]["DOCID"].ToString() + "' ";
                 hyoa.ExcuteSQL(sqlSelect);
             }
             //Response.Write(sqlSelect);
             //return;
             string bh = dt.Rows[0]["hyc_slbh"].ToString();
             this.txt_slbh.Value += "B";
             this.txt_slbh.Value += dt.Rows[0]["hyc_nf"].ToString();
             this.txt_slbh.Value += (Convert.ToInt32(DateTime.Now.Month.ToString()) < 10 ? "0" + DateTime.Now.Month : DateTime.Now.Month.ToString());
             this.txt_slbh.Value += (Convert.ToInt32(DateTime.Now.Day.ToString()) < 10 ? "0" + DateTime.Now.Day : DateTime.Now.Day.ToString());
             if (Convert.ToString(bh).Length == 1)
             {
                 this.txt_slbh.Value += "000" + dt.Rows[0]["hyc_slbh"];
             }
             if (Convert.ToString(bh).Length == 2)
             {
                 this.txt_slbh.Value += "00" + dt.Rows[0]["hyc_slbh"];
             }
             if (Convert.ToString(bh).Length == 3)
             {
                 this.txt_slbh.Value += "0" + dt.Rows[0]["hyc_slbh"];
             }
             if (Convert.ToString(bh).Length == 4)
             {
                 this.txt_slbh.Value += dt.Rows[0]["hyc_slbh"].ToString();
             }
         }
     }
 }
Ejemplo n.º 6
0
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("login.aspx");

        string ls_tip = "保存成功!";
        if (this.Session["hyuid"].ToString() == "025" && this.hy_tableid.Text == "Tablejemx")
        {
            string sqlSelect = " select * from hyc_Tablefpbd where docid ='" + this.txtMotherid.Value + "' ";
            HyoaClass.Hyoa_global hyoaGlobal = new Hyoa_global();
            DataTable dt = hyoaGlobal.GetDataTable(sqlSelect);
            if (dt.Rows.Count > 0)
            {
                this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString();
                this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString();
                this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString();
                this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString();
            }
        }

        #region 新建时先进行一次保存
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        string sql = "";
        if (this.txtop.Value == "add")
        {
            //处理特殊字符
            this.hy_bt.Text = ReplaceString_Tszf(this.hy_bt.Text);
            if (Session["conntype"].ToString() == "SQL")
            {
                //edited by xf 20140625
                sql = "insert into hyc_" + this.hy_tableid.Text + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist,hy_clrylist,hy_cyrylist) values (";
                sql += "'" + this.txtdocid.Value + "','" + this.hy_mudelid.Text + "','" + this.hy_tableid.Text + "','" + this.hy_flowid.Text + "','" + this.hy_flowname.Text + "'";
                sql += ",'" + this.hy_curtacheid.Text + "','" + this.hy_curtachename.Text + "','" + this.hy_curclrid.Text + "','" + this.hy_curclrname.Text + "','" + this.hy_djrid.Text + "'";
                sql += ",'" + this.hy_djrname.Text + "','" + this.hy_djrbmid.Text + "','" + this.hy_djrbmname.Text + "','" + this.hy_djsj.Text + "','" + this.hy_bt.Text + "'";
                sql += ",'','','," + Session["hyuid"].ToString() + ",',',') ";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                //edited by xf 20140625
                sql = "insert into hyc_" + this.hy_tableid.Text + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist,hy_clrylist,hy_cyrylist) values (";
                sql += "'" + this.txtdocid.Value + "','" + this.hy_mudelid.Text + "','" + this.hy_tableid.Text + "','" + this.hy_flowid.Text + "','" + this.hy_flowname.Text + "'";
                sql += ",'" + this.hy_curtacheid.Text + "','" + this.hy_curtachename.Text + "','" + this.hy_curclrid.Text + "','" + this.hy_curclrname.Text + "','" + this.hy_djrid.Text + "'";
                sql += ",'" + this.hy_djrname.Text + "','" + this.hy_djrbmid.Text + "','" + this.hy_djrbmname.Text + "',to_date('" + this.hy_djsj.Text + "','YYYY-MM-DD HH24:MI:SS'),'" + this.hy_bt.Text + "'";
                sql += ",'','','," + Session["hyuid"].ToString() + ",',',') ";
            }
            Hyoa_global.ExcuteSQL(sql);

            //调用添加客户名称的方法
            if (this.hy_mudelid.Text == "MudelVODfwxy" && this.hy_tableid.Text == "TableVODfwxy" || this.hy_mudelid.Text == "Mudelffpdfwht" && this.hy_tableid.Text == "Tableffpdfwht"
             || this.hy_mudelid.Text == "Mudeljdhazfwht" && this.hy_tableid.Text == "Tablejdhazfwht" || this.hy_mudelid.Text == "Mudelsyyhfwxy" && this.hy_tableid.Text == "Tablesyyhfwxy"
             || this.hy_mudelid.Text == "MudelDVBazfwdght" && this.hy_tableid.Text == "TableDVBazfwdght" || this.hy_mudelid.Text == "MudelDVBazfwdght" && this.hy_tableid.Text == "TableDVBazfwdght"
             || this.hy_mudelid.Text == "Mudeljwdsjsxy" && this.hy_tableid.Text == "Tablejwdsjsxy" || this.hy_mudelid.Text == "Mudeljwdscsxy" && this.hy_tableid.Text == "Tablejwdscsxy"
             || this.hy_mudelid.Text == "Mudelkdjrht" && this.hy_tableid.Text == "Tablekdjrht" || this.hy_mudelid.Text == "Mudelsjcsfwht" && this.hy_tableid.Text == "Tablesjcsfwht"
             || this.hy_mudelid.Text == "Mudelsjgdcsfwht" && this.hy_tableid.Text == "Tablesjgdcsfwht" || this.hy_mudelid.Text == "Mudelsjtxyyhzxy" && this.hy_tableid.Text == "Tablesjtxyyhzxy"
             || this.hy_mudelid.Text == "Mudelzdyht" && this.hy_tableid.Text == "Tablezdyht")
            {
                Khdaxx();   //添加客户信息内容
                Htblzt();   //添加办理状态表
            }
            //add by zxx 20150305
            if (this.hy_mudelid.Text == "Mudelxjsq" && this.hy_tableid.Text == "Tablexjsq"
             || this.hy_mudelid.Text == "Mudelshd" && this.hy_tableid.Text == "Tableshd" || this.hy_mudelid.Text == "Mudelszds" && this.hy_tableid.Text == "Tableszds")
            {
                Htblzt();   //添加办理状态表
            }
            //add by ccg 20150617
            if (this.hy_mudelid.Text == "Mudelsyyhfwxy_new" && this.hy_tableid.Text == "Tablesyyhfwxy_new" || this.hy_mudelid.Text == "Mudelszdsywfwht_new" && this.hy_tableid.Text == "Tableszdsywfwht_new"
             || this.hy_mudelid.Text == "Mudeljwdscsxy_new" && this.hy_tableid.Text == "Tablejwdscsxy_new" || this.hy_mudelid.Text == "Mudeljwdsjm" && this.hy_tableid.Text == "Tablejwdsjm"
             || this.hy_mudelid.Text == "Mudelsjcsfwht_new" && this.hy_tableid.Text == "Tablesjcsfwht_new" || this.hy_mudelid.Text == "Mudelkdjrht_new" && this.hy_tableid.Text == "Tablekdjrht_new"
             || this.hy_mudelid.Text == "Mudelsjgdcsfwht_new" && this.hy_tableid.Text == "Tablesjgdcsfwht_new" || this.hy_mudelid.Text == "Mudelsjtxyyhzxy_new" && this.hy_tableid.Text == "Tablesjtxyyhzxy_new" || this.hy_mudelid.Text == "Mudelzdyht" && this.hy_tableid.Text == "Tablezdyht"
             || this.hy_mudelid.Text == "Mudelgcsght" && this.hy_tableid.Text == "Tablegcsght"
             || this.hy_mudelid.Text == "Mudelqtht" && this.hy_tableid.Text == "Tableqtht"
             || this.hy_mudelid.Text == "Mudelgxhzhht" && this.hy_tableid.Text == "Tablegxhzhht")
            {
                Htblzt();   //添加办理状态表
            }

        }
        #endregion
        //更新内容
        sql = "update hyc_" + this.hy_tableid.Text + " set hy_tableid='" + hy_tableid.Text + "',hy_bt='" + hy_bt.Text + "' ";
        #region 根据“需要保存的字段”来进行保存
        if (txtsavefields.Text != "")
        {
            string[] lv_savefields = txtsavefields.Text.Split(',');
            string[] lv_savefields_sx = txtsavefields_sx.Text.Split(',');
            string fielddocvalue = "";
            for (int i = 0; i < lv_savefields.Length; i++)
            {
                if (lv_savefields_sx[i].ToString() == "0")  //文本
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "1")  //日期
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        if (Session["conntype"].ToString() == "SQL")
                        {
                            if (fielddocvalue == "")
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=null";
                            else
                                sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                        }
                        if (Session["conntype"].ToString() == "ORACLE")
                        {
                            if (fielddocvalue == "")
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=null";
                            else
                                sql += ",hyc_" + lv_savefields[i].ToString() + "=to_date('" + fielddocvalue + "','YYYY-MM-DD HH24:MI:SS')";
                        }
                    }
                }
                if (lv_savefields_sx[i].ToString() == "3")  //数值
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        if (fielddocvalue == "")
                            sql += ",hyc_" + lv_savefields[i].ToString() + "=0";
                        else
                            sql += ",hyc_" + lv_savefields[i].ToString() + "=" + fielddocvalue;
                    }
                }
                if (lv_savefields_sx[i].ToString() == "5")  //口令
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "6")  //编辑器
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'";
                    }
                }
                if (lv_savefields_sx[i].ToString() == "7")  //复选框
                {
                    string s = "";
                    CheckBoxList txfs = (CheckBoxList)this.FindControl(lv_savefields[i].ToString());
                    foreach (ListItem li in txfs.Items)
                    {
                        if (li.Selected)
                        {
                            if (li.Selected) s += li.Value + ",";
                        }
                    }
                    s = s.TrimEnd(',');
                    s = ReplaceString_Tszf(s);
                    sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'";
                }
                if (lv_savefields_sx[i].ToString() == "8")  //单选框
                {
                    string s = "";
                    RadioButtonList txfs = (RadioButtonList)this.FindControl(lv_savefields[i].ToString());
                    foreach (ListItem li in txfs.Items)
                    {
                        if (li.Selected)
                        {
                            if (li.Selected) s += li.Value + ",";
                        }
                    }
                    s = s.TrimEnd(',');
                    s = ReplaceString_Tszf(s);
                    sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'";
                }
                if (lv_savefields_sx[i].ToString() == "9")  //意见
                {
                    if (this.Request.Form[lv_savefields[i].ToString()] != null)
                    {
                        fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString();
                        fielddocvalue = ReplaceString_Tszf(fielddocvalue);
                        if (fielddocvalue != "")
                        {
                            HyoaClass.Hyoa_yj Hyoa_yj = new HyoaClass.Hyoa_yj();
                            Hyoa_yj.yjid = Hyoa_global.GetRandom();
                            Hyoa_yj.hy_tableid = this.hy_tableid.Text;
                            Hyoa_yj.hy_fatherid = this.txtdocid.Value;
                            Hyoa_yj.hy_fieldid = lv_savefields[i].ToString();
                            Hyoa_yj.hy_yjuserid = Session["hyuid"].ToString();
                            Hyoa_yj.hy_yjusername = Session["hyuname"].ToString();
                            Hyoa_yj.hy_yjdeptid = Session["hydeptid"].ToString();
                            Hyoa_yj.hy_yjdeptname = Session["hydeptname"].ToString();
                            Hyoa_yj.hy_yjtime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            Hyoa_yj.hy_yjbody = fielddocvalue;
                            Hyoa_yj.hy_yjip = HttpContext.Current.Request.UserHostAddress;
                            Hyoa_yj.hy_yjifshow = "";
                            Hyoa_yj.Insert();
                        }
                    }
                }
            }
        }
        #endregion

        #region 保存
        if (this.txtwhichoperation.Value == "1")
        {
            sql += hylcbctscl();  //特殊处理
        }
        #endregion

        #region 完成
        if (this.txtwc.Text == "1")
        {
            Htblztwc();  //特殊处理
        }
        #endregion
        #region 确认
        if (this.txtwhichoperation.Value == "111")
        {
            sql += ",hy_ifconfirm='1'";
        }
        #endregion

        #region 取消确认
        if (this.txtwhichoperation.Value == "112")
        {
            sql += ",hy_ifconfirm='0'";
        }
        #endregion

        #region 在主表单内嵌列表的功能中,保存、提交和确认子表单时,需要将父文档的DOCID保存到当前记录的hy_motherid中
        //ADD BY XF 2011-11-17
        if (this.txtwhichoperation.Value == "1" || this.txtwhichoperation.Value == "2" || this.txtwhichoperation.Value == "111")
        {
            if (Request.QueryString["op"] != null)
            {
                if (Request.QueryString["op"].ToString() != "")
                {
                    if (Request.QueryString["motherid"] != null)
                    {
                        if (Request.QueryString["motherid"].ToString() != "")
                        {
                            sql += ",hy_motherid='" + Request.QueryString["motherid"].ToString() + "'";
                        }
                    }
                }
            }
        }
        #endregion

        sql += " where DOCID='" + this.txtdocid.Value + "'";
        Hyoa_global.ExcuteSQL(sql);
        if (this.txtop.Value == "add")
        {
            string slbh_sql = "SELECT TOP 1 * FROM hyc_Tableslbhwh ORDER BY hyc_pxh";
            string update_sql = "";
            DataTable dt_slbh = Hyoa_global.GetDataTable(slbh_sql);
            if (dt_slbh.Rows.Count > 0)
            {
                int bh = Convert.ToInt32(dt_slbh.Rows[0]["hyc_slbh"].ToString());
                bh = bh + 1;
                string docid = dt_slbh.Rows[0]["DOCID"].ToString();
                update_sql = "UPDATE hyc_Tableslbhwh SET hyc_slbh = '" + bh + "' WHERE DOCID = '" + docid + "'";
            }
            Hyoa_global.ExcuteSQL(update_sql);
        }
        // add by wjs 20141029 end
        if (this.hy_tableid.Text == "Tabletjjzr")
        {
            Zbtjkz();
        }

        #region 处理完成后的提示及跳转(增加刷新附件功能)

        if (this.txtifsxfj.Text == "1")
        {

            Response.Write("<script>window.location='main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&url=" + this.txturl.Value + "'</script>");
        }
        //合同标志位  路径特殊跳转
        else if (this.txt_nextFlag.Value == "1")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
        else
        {
            if (this.txtifpop.Value == "")
            {

                Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
            }
            else
            {

                Response.Write("<script>alert('" + ls_tip + "');try{window.opener.location.reload();}catch(err){}self.close();</script>");
            }
        }
        #endregion
    }
Ejemplo n.º 7
0
    protected void btndelinfo_sq_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        String[] v_uids = this.txtuids.Value.Split(',');
        string ls_filepath = "";
        if (this.txttableid.Value == "TableVODfwxy" || this.txttableid.Value == "Tableffpdfwht" || this.txttableid.Value == "Tablejdhazfwht" ||
            this.txttableid.Value == "Tablesyyhfwxy" || this.txttableid.Value == "TableDVBazfwdght" || this.txttableid.Value == "TableDVBazfwdght" ||
            this.txttableid.Value == "Tablejwdsjsxy" || this.txttableid.Value == "Tablejwdscsxy" || this.txttableid.Value == "Tablekdjrht" ||
             this.txttableid.Value == "Tablesjcsfwht" || this.txttableid.Value == "Tablesjgdcsfwht" || this.txttableid.Value == "Tablesjtxyyhzxy" ||
              this.txttableid.Value == "Tablezdyht" ||
              this.txttableid.Value == "Tablesyyhfwxy_new" || this.txttableid.Value == "Tableszdsywfwht_new" || this.txttableid.Value == "Tablejwdscsxy_new"
              || this.txttableid.Value == "Tablejwdsjm" || this.txttableid.Value == "Tablesjcsfwht_new" || this.txttableid.Value == "Tablekdjrht_new" ||
              this.txttableid.Value == "Tablesjgdcsfwht_new" || this.txttableid.Value == "Tablesjtxyyhzxy_new" || this.txttableid.Value == "Tableqtht"
            || this.txttableid.Value == "Tablegxhzhht")
        {
            for (var i = 0; i < v_uids.Length; i++)
            {
                if (v_uids[i] != "")
                {
                    string sql = "update hyc_" + txttableid.Value + " set hy_iftx='1',hy_zhtxsj='" + System.DateTime.Now.ToString() + "' 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));
        }
        else
        {
            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

                            //生成删除日志 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));
        }
    }
Ejemplo n.º 8
0
 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 sqlUpdate = " update hyc_" + this.txttableid.Value + " set hyc_sfbf='1' where DOCID='" + v_uids[i] + "'";
             Hyoa_global.ExcuteSQL(sqlUpdate);
         }
     }
     DataPlay(System.Int32.Parse(this.curpage.Text));
 }