示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.Params["delid"]))
         {
             mb = tb.GetModel(Convert.ToInt32(Request.Params["delid"]));
             if ("issure".Equals(Request.Params["mod"]))
             {
                 tmt.Title      = mb.b_title;
                 tmt.TypeId     = 5;
                 tmt.HtmlSource = fc.From_Content(mb.b_formcontent, mb.b_content, true);//取得替换后的表单数据
                 tmt.UserId     = mb.b_user;
                 Tunnel.BLL.Tunnel_information bllf = new Tunnel.BLL.Tunnel_information();
                 int relt = -1;
                 relt = bllf.Add(tmt);
             }
             tb.Delete(mb.b_id);
             Tunnel.Data.DbHelperSQL.ExecuteSql("DELETE FROM TUNNEL_EXAM WHERE E_GID=" + mb.b_id);
             Tunnel.Data.DbHelperSQL.ExecuteSql("DELETE FROM Tunnel_Advice WHERE A_GID=" + mb.b_id);
             Tunnel.Data.DbHelperSQL.ExecuteSql("DELETE FROM Tunnel_Remind WHERE m_type=1 and m_typeid=" + mb.b_id);
             Tunnel.Common.Del_File delfile = new Tunnel.Common.Del_File();
             delfile.FileDelete(mb.b_file);
             Tunnel.Common.Message.Show("操作成功!", "Other_Manage.aspx");
         }
         this.ShowInit("");
     }
 }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         this.ShowInit("");
         Tunnel.BLL.Tunnel_flow tf = new Tunnel.BLL.Tunnel_flow();
         DataSet  dds  = tf.GetList("f_sort=18");
         ListItem list = new ListItem();
         //list.Text = "所有流程类型";
         //list.Value = "0";
         //DropDownList1.Items.Add(list);
         foreach (DataRow drds in dds.Tables[0].Rows)
         {
             list       = new ListItem();
             list.Text  = drds["f_name"].ToString();
             list.Value = drds["f_id"].ToString();
             DropDownList1.Items.Add(list);
         }
         if (!string.IsNullOrEmpty(Request.Params["delid"]))
         {
             mb = tb.GetModel(Convert.ToInt32(Request.Params["delid"]));
             if ("issure".Equals(Request.Params["mod"]))
             {
                 tmt.Title      = mb.b_title;
                 tmt.TypeId     = 5;
                 tmt.HtmlSource = fc.From_Content(mb.b_formcontent, mb.b_content, true);//取得替换后的表单数据
                 tmt.UserId     = mb.b_user;
                 Tunnel.BLL.Tunnel_information bllf = new Tunnel.BLL.Tunnel_information();
                 int relt = -1;
                 relt = bllf.Add(tmt);
             }
             tb.Delete(mb.b_id);
             Tunnel.Data.DbHelperSQL.ExecuteSql("DELETE FROM TUNNEL_EXAM WHERE E_GID=" + mb.b_id);
             Tunnel.Data.DbHelperSQL.ExecuteSql("DELETE FROM Tunnel_Advice WHERE A_GID=" + mb.b_id);
             Tunnel.Data.DbHelperSQL.ExecuteSql("DELETE FROM Tunnel_Remind WHERE m_type=1 and m_typeid=" + mb.b_id);
             Tunnel.Common.Del_File delfile = new Tunnel.Common.Del_File();
             delfile.FileDelete(mb.b_file);
             Tunnel.Common.Message.Show("操作成功!");
         }
     }
 }
示例#3
0
    //添加至信息表
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (titleId == 1)
        {
            if (!"0".Equals(Request.Form["DropDownList1"]))
            {
                string title       = this.tb_Title.Text.Trim();
                int    typeid      = Convert.ToInt32(this.DropDownList1.SelectedValue);
                string htmlsourcce = this.FCKeditor.Value; // Request.Form["content1"];  //this.FCKeditor.Value;
                string imagepaht   = stringFormat(From_Content(htmlsourcce)).Trim();
                string content     = FCKeditor.Value;      //Request.Form["content1"]; //FreeTextBox1.HtmlStrippedText;
                int    userid      = ul.LoginID;
                if (!string.IsNullOrEmpty(imagepaht))
                {
                    if (imagepaht.Substring(0, 1) == "/")
                    {
                        imagepaht = imagepaht.Substring(1, imagepaht.Length - 1);
                    }
                    imagepaht = imagepaht.Replace("src=/sdoa/", "");
                }

                Tunnel.Model.Tunnel_index model = new Tunnel.Model.Tunnel_index();
                model.Id         = indexId;
                model.Title      = title;
                model.TypeId     = typeid;
                model.HtmlSource = htmlsourcce;
                model.ImagePaht  = imagepaht;
                model.Content    = content;
                model.UserId     = userid;
                HttpPostedFile hpf = file1.PostedFile;
                if (Convert.ToDouble(hpf.ContentLength) / 1024 / 1024 > 10)
                {
                    Response.Write("<script>alert('附件大小不能大于10MB');</script>");

                    return;
                }
                else
                {
                    CreateMdAndFilePaht(hpf);
                }
                model.Files = filePaht; //infofiles


                //string str = titleName;

                Tunnel.BLL.Tunnel_information bllf  = new Tunnel.BLL.Tunnel_information();
                Tunnel.BLL.Tunnel_Index       index = new Tunnel.BLL.Tunnel_Index();
                int relt = -1;
                relt = index.Update(model);
                if (relt > 0)
                {
                    Tunnel.Common.Message.Show("修改成功!", "N_InformationManage.aspx?type=" + Request.QueryString["type"]);
                }
                else
                {
                    Tunnel.Common.Message.Show("修改失败!", "N_InformationManage.aspx?type=" + Request.QueryString["type"]);
                }

                // MessageBox(str, url);
            }
            else
            {
                Tunnel.Common.Message.Show("请选择子栏目!");
            }
        }
        else
        {
            if (!"0".Equals(Request.Form["DropDownList1"]))
            {
                string title       = this.tb_Title.Text.Trim();
                int    typeid      = Convert.ToInt32(this.DropDownList1.SelectedValue);
                string htmlsourcce = this.FCKeditor.Value; // Request.Form["content1"];  //this.FCKeditor.Value;
                string imagepaht   = stringFormat(From_Content(htmlsourcce)).Trim();
                string content     = FCKeditor.Value;      //Request.Form["content1"]; //FreeTextBox1.HtmlStrippedText;
                int    userid      = ul.LoginID;
                if (!string.IsNullOrEmpty(imagepaht))
                {
                    if (imagepaht.Substring(0, 1) == "/")
                    {
                        imagepaht = imagepaht.Substring(1, imagepaht.Length - 1);
                    }
                    imagepaht = imagepaht.Replace("src=/sdoa/", "");
                }

                Tunnel.Model.Tunnel_index model = new Tunnel.Model.Tunnel_index();
                model.Title      = title;
                model.TypeId     = typeid;
                model.HtmlSource = htmlsourcce;
                model.ImagePaht  = imagepaht;
                model.Content    = content;
                model.UserId     = userid;
                HttpPostedFile hpf = file1.PostedFile;
                if (Convert.ToDouble(hpf.ContentLength) / 1024 / 1024 > 10)
                {
                    Response.Write("<script>alert('附件大小不能大于10MB');</script>");

                    return;
                }
                else
                {
                    CreateMdAndFilePaht(hpf);
                }
                model.Files = filePaht; //infofiles


                //string str = titleName;

                Tunnel.BLL.Tunnel_information bllf = new Tunnel.BLL.Tunnel_information();
                int relt = -1;
                relt = bllf.Add(model);
                if (relt > 0)
                {
                    Tunnel.Common.Message.Show("增加成功!", "N_InformationManage.aspx?type=" + Request.QueryString["type"]);
                    string strsql = "";
                    strsql = "insert into tunnel_log(l_user,l_time,l_content,l_ip,l_sort) values(" + ul.LoginID + ",'" + DateTime.Now + "','公司事务>>党工团信息>>修改党工团信息。标题:" + model.Title + "','" + Tunnel.Common.Common.GetIp() + "',1)";
                    Tunnel.Data.DbHelperSQL.ExecuteSql(strsql);
                }
                else
                {
                    Tunnel.Common.Message.Show("增加失败!", "N_InformationManage.aspx?type=" + Request.QueryString["type"]);
                }

                // MessageBox(str, url);
            }
            else
            {
                Tunnel.Common.Message.Show("请选择子栏目!");
            }
        }
    }
示例#4
0
    protected void Button5_Click(object sender, EventArgs e)
    {
        //这里为存储当前步骤
        mtb = btb.GetModel(int.Parse(Request.Params["bid"]));
        mf  = bf.GetModel(mtb.b_sort);
        if (mtb.b_state == 3)
        {
            Tunnel.Common.Message.back("此流程己审批结束,请勿重复审批!"); return;
        }
        else
        {
            string currbid = Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "e_nextbid", "e_gid=" + Request.Params["bid"] + " order by e_id desc");
            if ("".Equals(currbid) || "0".Equals(currbid))
            {
                currbid = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_id", "s_lid=" + mtb.b_sort + " and s_num=1");
            }
            mts = bts.GetModel(Convert.ToInt32(currbid));
            int    cunum     = mts.s_num;
            bool   iscshened = true;
            int    sum       = bts.GetCount("s_lid=" + mtb.b_sort);
            string curruser  = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_zid", "s_id=" + mts.s_id);
            if (!string.IsNullOrEmpty(curruser))
            {
                string[] users = curruser.Split(',');
                foreach (string user in users)
                {
                    if (!string.IsNullOrEmpty(user))
                    {
                        if (user == ul.LoginID.ToString())
                        {
                            iscshened = false;
                        }
                    }
                }
            }
            if (!iscshened || ul.JiaoSe(ul.LoginID) == "系统管理员")
            {
                //将当前步骤存入数据库表:Tunnel_exam
                Tunnel.BLL.Tunnel_exam   bte = new Tunnel.BLL.Tunnel_exam();
                Tunnel.Model.Tunnel_exam mte = new Tunnel.Model.Tunnel_exam();
                mte.e_bid     = Convert.ToInt32(mts.s_id);
                mte.e_endtime = DateTime.Now;
                mte.e_gid     = Convert.ToInt32(Request.Params["bid"]);
                mte.e_user    = ul.LoginID;
                string lastendtime = Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "e_endtime", "e_gid=" + Request.Params["bid"] + " order by e_id desc");
                if (!string.IsNullOrEmpty(lastendtime))
                {
                    mte.e_time = Convert.ToDateTime(lastendtime);//取得上一步的最后执行时间
                }
                else
                {
                    mte.e_time = mtb.b_time;
                }
                //如果为最后一步则结束流程
                if (cunum == sum)
                {
                    mte.e_nextbid = 0;
                    string pid = Tunnel.Common.GetValue.getDataValue("Tunnel_flow", "f_sort", "f_id=" + mtb.b_sort);
                    //插入到公司发文
                    if ("18".Equals(pid))
                    {
                        tmt.Title      = mtb.b_title;
                        tmt.TypeId     = 5;
                        tmt.HtmlSource = fc.From_Content(mtb.b_formcontent, mtb.b_content, true);//取得替换后的表单数据
                        tmt.UserId     = mtb.b_user;
                        Tunnel.BLL.Tunnel_information bllf = new Tunnel.BLL.Tunnel_information();
                        int relt = -1;
                        relt = bllf.Add(tmt);
                    }
                    Tunnel.Data.DbHelperSQL.ExecuteSql("UPDATE TUNNEL_BUMF SET B_STATE=3 WHERE B_ID=" + Request.Params["bid"]);
                    Tunnel.Data.DbHelperSQL.ExecuteSql("DELETE TUNNEL_REMIND WHERE m_type=1 and m_bid=" + currbid + " and m_typeid=" + mtb.b_id);//删除待办事项
                    Tunnel.Common.Message.Show("流程结束成功!", "Apply_Sp.aspx");
                }
                else
                {
                    string currs = "";
                    if (!"".Equals(currbid) || !"0".Equals(currbid))
                    {
                        string nid = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_id", "s_lid=" + mtb.b_sort + " and s_num>" + mts.s_num + " order by s_num asc");
                        currs = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_zid", "s_lid=" + mtb.b_sort + " and s_num>" + mts.s_num + " order by s_num asc");
                        if (string.IsNullOrEmpty(nid))
                        {
                            nid = "0";
                        }
                        mte.e_nextbid = long.Parse(nid);
                    }
                    else
                    {
                        mte.e_nextbid = 0;
                    }
                    if (!string.IsNullOrEmpty(currs))
                    {
                        Tunnel.Model.Tunnel_Remind tr = new Tunnel.Model.Tunnel_Remind();
                        Tunnel.BLL.Tunnel_Remind   br = new Tunnel.BLL.Tunnel_Remind();
                        string[] users = currs.Split(',');
                        foreach (string user in users)
                        {
                            if (!string.IsNullOrEmpty(user))
                            {
                                tr.m_title    = mtb.b_title + "<font color=red>(待审批)</font>";
                                tr.m_url      = "N_WorkFlow/MyApply/Apply_zSp.aspx?bid=" + mtb.b_id;
                                tr.m_touser   = Convert.ToInt32(user);
                                tr.m_time     = DateTime.Now;
                                tr.m_type     = 1;
                                tr.m_typeid   = Convert.ToInt32(mtb.b_id);
                                tr.m_bid      = Convert.ToInt32(mte.e_nextbid);
                                tr.m_callTime = Convert.ToDateTime("1800-1-1 00:00:00");
                                tr.m_isread   = 0;
                                long messge = br.Add(tr);
                            }
                        }
                    }
                }

                bte.Add(mte);
                string contents = FCKeditor1.Value;
                //添加审批意见
                if (!string.IsNullOrEmpty(contents))
                {
                    Tunnel.BLL.Tunnel_Advice   ta = new Tunnel.BLL.Tunnel_Advice();
                    Tunnel.Model.Tunnel_Advice ma = new Tunnel.Model.Tunnel_Advice();
                    ma.a_content = contents;
                    ma.a_bid     = Convert.ToInt32(mts.s_id);
                    ma.a_gid     = Convert.ToInt32(mtb.b_id);
                    ma.a_time    = DateTime.Now;
                    ma.a_user    = ul.LoginID;
                    string count = Tunnel.Common.GetValue.getDataValue("Tunnel_Advice", "count(*)", "a_bid=" + mf.f_id + " and a_gid=" + Request.Params["bid"]);
                    if (int.Parse(count) > 0)
                    {
                        ta.Update(ma);
                    }
                    else
                    {
                        ta.Add(ma);
                    }
                }
                Tunnel.Data.DbHelperSQL.ExecuteSql("DELETE TUNNEL_REMIND WHERE m_type=1 and m_bid=" + currbid + " and m_typeid=" + mtb.b_id);//删除待办事项
                Tunnel.Common.Message.Show("操作成功!", "Apply_Sp.aspx");
            }
            else
            {
                Tunnel.Common.Message.back("此流程己审批通过,请勿重复审批!"); return;
            }
        }
    }