Пример #1
0
 /// <summary>
 /// 流程修改数据显示
 /// </summary>
 void editbind()
 {
     try
     {
         Tunnel.BLL.Tunnel_flow   bf = new Tunnel.BLL.Tunnel_flow();
         Tunnel.Model.Tunnel_flow mf = new Tunnel.Model.Tunnel_flow();
         mf = bf.GetModel(int.Parse(Request.Params["editid"]));
         if (mf.f_sort != 0 && tfc.Exists(mf.f_sort))
         {
             DropDownList1.SelectedValue = mf.f_sort.ToString();
         }
         if (mf.f_bum != 0 && bt.Exists(mf.f_bum))
         {
             DropDownList2.SelectedValue = mf.f_bum.ToString();
         }
         if (mf.f_form != 0 && btf.Exists(mf.f_form))
         {
             DropDownList4.SelectedValue = mf.f_form.ToString();
         }
         TextBox1.Text = mf.f_name;
         TextBox2.Text = mf.f_depict;
         RadioButtonList1.SelectedValue = mf.f_isfile.ToString();
         RadioButtonList2.SelectedValue = mf.f_state.ToString();
         //RadioButtonList3.SelectedValue = mf.f_stype.ToString();
     }
     catch {
         Tunnel.Common.Message.back("不正确的ID!");
     }
 }
Пример #2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Tunnel.Model.Tunnel_flow> DataTableToList(DataTable dt)
        {
            List <Tunnel.Model.Tunnel_flow> modelList = new List <Tunnel.Model.Tunnel_flow>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Tunnel.Model.Tunnel_flow model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Tunnel.Model.Tunnel_flow();
                    //model.f_id=dt.Rows[n]["f_id"].ToString();
                    model.f_name = dt.Rows[n]["f_name"].ToString();
                    if (dt.Rows[n]["f_bum"].ToString() != "")
                    {
                        model.f_bum = int.Parse(dt.Rows[n]["f_bum"].ToString());
                    }
                    if (dt.Rows[n]["f_form"].ToString() != "")
                    {
                        model.f_form = int.Parse(dt.Rows[n]["f_form"].ToString());
                    }
                    if (dt.Rows[n]["f_isfile"].ToString() != "")
                    {
                        model.f_isfile = int.Parse(dt.Rows[n]["f_isfile"].ToString());
                    }
                    model.f_depict = dt.Rows[n]["f_depict"].ToString();
                    if (dt.Rows[n]["f_sort"].ToString() != "")
                    {
                        model.f_sort = int.Parse(dt.Rows[n]["f_sort"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #3
0
    private int sava()
    {
        ArrayList list      = new ArrayList();
        string    datalist  = "";
        string    datafield = "";

        System.Collections.Specialized.NameObjectCollectionBase.KeysCollection keys = Request.Params.Keys;//取得所有Request的Key值
        for (int i = 0; i < keys.Count; i++)
        {
            //过滤其它Request的Key值留以DATA_开头的Key
            if (keys[i].ToString().IndexOf("DATA_") >= 0)
            {
                list.Add(keys[i].ToString());          //将key值存入数组
                datafield += keys[i].ToString() + ","; //将key值存入字符串
            }
        }
        //获取表单提交过来的值
        for (int j = 0; j < list.Count; j++)
        {
            datalist += Request.Form[list[j].ToString()] + "<@Sep@>";//值用<@Sep@>隔开以便存入数据库
        }
        mtb.b_content = datalist;
        if (!string.IsNullOrEmpty(datafield))
        {
            datafield = datafield.Substring(0, datafield.Length - 1);//去掉最后的的','
        }
        mtb.b_datefield = datafield;
        if (!"".Equals(this.SaveFiles()))
        {
            if (null != Request.Form["hfile"] && !"".Equals(Request.Form["hfile"]))
            {
                mtb.b_file = Request.Form["hfile"] + "," + this.SaveFiles();//批量附件上传
            }
            else
            {
                mtb.b_file = this.SaveFiles();//批量附件上传
            }
        }
        else
        {
            if (null != Request.Form["hfile"] && !"".Equals(Request.Form["hfile"]))
            {
                mtb.b_file = Request.Form["hfile"];
            }
            else
            {
                mtb.b_file = "";
            }
        }
        mf                = bf.GetModel(int.Parse(Request.Params["Flow"]));
        mtb.b_title       = TextBox1.Text.Trim();
        mtb.b_time        = DateTime.Now;
        mtb.b_user        = ul.LoginID;
        mtf               = tf.GetModel(mf.f_form);
        mtb.b_formcontent = mtf.f_content;
        mtb.b_sort        = int.Parse(Request.Params["Flow"]);
        mtb.b_state       = (mf.f_state == 0 ? 1 : 2);
        mtb.b_suser       = (RadioButtonList3.SelectedValue == "1" ? int.Parse(m_value.Value) : 0);
        return(btb.Add(mtb));
    }
Пример #4
0
    void Bind()
    {
        mf  = bf.GetModel(int.Parse(DropDownList1.SelectedValue));
        mtf = tf.GetModel(mf.f_form);
        if (mtf == null)
        {
            Tunnel.Common.Message.back("表单不存在或已删除,请与管理员联系"); return;
        }
        Label1.Text  = fc.From_Content(mtf.f_content, "", false);//取得替换后的表单数据
        ul.UsbnLogin = ul.getUserModel(ul.LoginID);
        string bumname = Tunnel.Common.GetValue.getDataValue("Tunnel_bum", "b_name", "b_id=" + ul.UsbnLogin.m_bum);

        TextBox1.Text = bumname + mf.f_name;
        if (mf.f_isfile.ToString() == "1")
        {
            isuploads = false;
        }
        Repeater1.DataSource = bs.GetList("s_lid=" + mf.f_id);
        Repeater1.DataBind();
        if (Repeater1.Items.Count <= 0)
        {
            Label2.Text = "本公文未设置流程,将不能保存!"; HiddenField2.Value = "0";
        }
        else
        {
            Label2.Text = ""; HiddenField2.Value = "1";
        }
    }
Пример #5
0
 protected void Button4_Click(object sender, EventArgs e)
 {
     Tunnel.Model.Tunnel_menber tm = ul.GetUserBean(ul.LoginID);
     if (!Tunnel.Data.DESEncrypt.Encrypt(spPassword.Text.Trim()).Equals(tm.m_spassword))
     {
         Tunnel.Common.Message.back("审批密码错误"); return;
     }
     else
     {
         //这里为存储当前步骤
         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
         {
             //将当前步骤存入数据库表: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       = 0;
             mte.e_endtime   = DateTime.Now;
             mte.e_gid       = Convert.ToInt32(Request.Params["bid"]);
             mte.e_user      = ul.LoginID;
             mte.e_nextbuser = m_value.Value;
             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;
             }
             mte.e_nextbid = 1;
             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=1024 and a_gid=" + Request.Params["bid"]);
                 ta.Add(ma);
             }
             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=1 and m_touser="******" and m_typeid=" + mtb.b_id); //删除待办事项
             Tunnel.Common.Message.Show("流程结束成功!", "../MyApply/Apply_Sp.aspx");
         }
     }
 }
Пример #6
0
 void Bind()
 {
     mtb = btb.GetModel(Convert.ToInt32(Request.Params["bid"]));
     mf  = bf.GetModel(mtb.b_sort);
     mtf = tf.GetModel(mf.f_form);
     if (mtf == null)
     {
         Tunnel.Common.Message.back("表单不存在或已删除,请与管理员联系"); return;
     }
     Label1.Text = fc.From_Content(mtf.f_content, mtb.b_content, false);//取得替换后的表单数据
     if (mf.f_isfile.ToString() == "1")
     {
         isuploads = false;
     }
     TextBox1.Text = mtb.b_title;
     if (mtb.b_suser == 0)
     {
         RadioButtonList3.SelectedIndex = 0;
         isusered = false;
     }
     else
     {
         TextBox2.Text = Tunnel.Common.GetValue.getDataValue("Tunnel_menber", "m_name", "m_id=" + mtb.b_suser);
         RadioButtonList3.SelectedIndex = 1;
         isusered = true;
     }
     m_value.Value = mtb.b_suser.ToString();
     hfile.Value   = mtb.b_file;
     if (!"".Equals(mtb.b_file))
     {
         string[] filelist = mtb.b_file.Split(',');
         foreach (string list in filelist)
         {
             string flist = list.Substring(list.LastIndexOf('/') + 1, list.Length - list.LastIndexOf('/') - 1);
             hfilelist += "<span><img src=\"../../image/attach.png\">" + flist + "<img style='cursor:hand' onclick=\"del(this,'" + list + "')\" alt='删除附件' src=\"../../image/remove.png\">;</span>";
         }
     }
     if (mf.f_state.ToString() == "0")
     {
         scontent = "审核→"; issheng = true;
     }
     else
     {
         scontent = ""; issheng = false;
     }
     Repeater1.DataSource = bs.GetList("s_lid=" + mf.f_id);
     Repeater1.DataBind();
     if (Repeater1.Items.Count <= 0)
     {
         Label2.Text = "本申请未设置流程,将不能保存!"; HiddenField2.Value = "0"; scontent = "";
     }
     else
     {
         Label2.Text = ""; HiddenField2.Value = "1";
     }
 }
Пример #7
0
    void Bind()
    {
        try
        {
            mtb = btb.GetModel(int.Parse(Request.Params["bid"]));

            mf  = bf.GetModel(mtb.b_sort);
            mtf = tf.GetModel(mf.f_form);
            if (mtf == null)
            {
                Tunnel.Common.Message.back("表单不存在或已删除,请与管理员联系"); return;
            }
            Label1.Text = fc.From_Content(mtf.f_content, mtb.b_content, true);//取得替换后的表单数据
            Label4.Text = mtb.b_title + " (" + mtb.b_time + ")";
            Label5.Text = "<font color=red>(注:红色代表当前执行步骤,<font color=green>绿色代表已经审批通过</font>)</font>";
            formfile    = Tunnel.Common.GetValue.getFile(mtb.b_file);
            if (mf.f_isfile.ToString() == "1")
            {
                isuploads = false;
            }
            if (mf.f_state.ToString() == "0" && mf.f_sort != 18)
            {
                scontent = "<font color='green'>审核→</font>";
            }
            else
            {
                scontent = "";
            }
            Repeater1.DataSource = bts.GetList("s_lid=" + mf.f_id);
            Repeater1.DataBind();
            Button4.Visible = false;
            Button5.Visible = false;
            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));
            if (mts.s_isbak == 1)
            {
                Button5.Visible     = true;
                Button1.Visible     = false;
                Button2.Visible     = false;
                spPassword.Enabled  = false;
                spPassword.TextMode = TextBoxMode.SingleLine;
                spPassword.Text     = "不需填写审批密码";
            }
        }
        catch
        {
            Tunnel.Common.Message.back("不正确的ID"); return;
        }
    }
Пример #8
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Tunnel.Model.Tunnel_flow mt = new Tunnel.Model.Tunnel_flow();
     Tunnel.BLL.Tunnel_flow   bt = new Tunnel.BLL.Tunnel_flow();
     mt.f_sort   = int.Parse(DropDownList1.SelectedValue);
     mt.f_name   = TextBox1.Text.Trim();
     mt.f_isfile = int.Parse(RadioButtonList1.SelectedValue);
     mt.f_bum    = int.Parse(DropDownList2.SelectedValue);
     mt.f_depict = TextBox2.Text.Trim();
     mt.f_form   = int.Parse(DropDownList4.SelectedValue);
     mt.f_state  = int.Parse(RadioButtonList2.SelectedValue);
     mt.f_stype  = 0;// int.Parse(RadioButtonList3.SelectedValue);
     bt.Add(mt);
     Tunnel.Common.Message.ShowAndReLoad("添加成功!", "Tunnel_LiuList.aspx?id=" + mt.f_sort);
 }
Пример #9
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Tunnel.Model.Tunnel_flow mt = new Tunnel.Model.Tunnel_flow();
     Tunnel.BLL.Tunnel_flow   bt = new Tunnel.BLL.Tunnel_flow();
     mt.f_sort   = int.Parse(DropDownList1.SelectedValue);
     mt.f_name   = TextBox1.Text.Trim();
     mt.f_isfile = int.Parse(RadioButtonList1.SelectedValue);
     mt.f_bum    = int.Parse(DropDownList2.SelectedValue);
     mt.f_depict = TextBox2.Text.Trim();
     mt.f_form   = int.Parse(DropDownList4.SelectedValue);
     mt.f_state  = int.Parse(RadioButtonList2.SelectedValue);
     mt.f_stype  = 0;//int.Parse(RadioButtonList3.SelectedValue);
     mt.f_id     = int.Parse(Request.Params["editid"]);
     bt.Update(mt);
     Tunnel.Common.Message.Show("修改成功!", "Flow_Manage.aspx");
 }
Пример #10
0
 void Bind()
 {
     try
     {
         mf  = bf.GetModel(int.Parse(Request.Params["Flow"]));
         mtf = tf.GetModel(mf.f_form);
         if (mtf == null)
         {
             Tunnel.Common.Message.back("表单不存在或已删除,请与管理员联系"); return; return;
         }
         Label1.Text  = fc.From_Content(mtf.f_content, "", false);//取得替换后的表单数据
         ul.UsbnLogin = ul.getUserModel(ul.LoginID);
         string bumname = Tunnel.Common.GetValue.getDataValue("Tunnel_bum", "b_name", "b_id=" + ul.UsbnLogin.m_bum);
         TextBox1.Text = bumname + mf.f_name;
         if (mf.f_isfile.ToString() == "1")
         {
             isuploads = false;
         }
         if (mf.f_state.ToString() == "0")
         {
             scontent = "审核→"; issheng = true; isshen = true;
         }
         else
         {
             scontent = ""; issheng = false; isshen = false;
         }
         Repeater1.DataSource = bs.GetList("s_lid=" + mf.f_id);
         Repeater1.DataBind();
         if (Repeater1.Items.Count <= 0)
         {
             Label2.Text = "本申请未设置流程,将不能保存!"; HiddenField2.Value = "0";
         }
         else
         {
             Label2.Text = ""; HiddenField2.Value = "1";
         }
     }
     catch {
         Tunnel.Common.Message.back("不正确的ID"); return;
     }
 }
Пример #11
0
 void Bind()
 {
     try
     {
         mtb         = btb.GetModel(int.Parse(Request.Params["bid"]));
         mf          = bf.GetModel(mtb.b_sort);
         mtf         = tf.GetModel(mf.f_form);
         Label1.Text = fc.From_Content(mtf.f_content, mtb.b_content, true);//取得替换后的表单数据
         Label4.Text = mtb.b_title + " (" + mtb.b_time + ")";
         formfile    = Tunnel.Common.GetValue.getFile(mtb.b_file);
         if (mf.f_isfile.ToString() == "1")
         {
             isuploads = false;
         }
         Repeater1.DataSource = bts.GetList("s_lid=" + mf.f_id);
         Repeater1.DataBind();
     }
     catch {
         Tunnel.Common.Message.back("不正确的ID"); return;
     }
 }
Пример #12
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         System.Web.HttpFileCollection uploadFiles = Request.Files;
         System.Web.HttpPostedFile     theFile;
         for (int i = 0; i < uploadFiles.Count; i++)
         {
             theFile = uploadFiles[i];
             if (Convert.ToDouble(theFile.ContentLength) / 1024 / 1024 > 10)
             {
                 Tunnel.Common.Message.back("附件大小不能大于10MB");
                 return;
             }
             else
             {
                 continue;
             }
         }
         Tunnel.Model.Tunnel_menber tm = ul.GetUserBean(ul.LoginID);
         //下一步骤ID
         string currbid  = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_id", "s_lid=" + Request.Params["Flow"] + " and s_num=1");
         string curruser = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_zid", "s_lid=" + Request.Params["Flow"] + " and s_num=1");
         //如果流程没有预设步骤
         if ("".Equals(currbid))
         {
             Tunnel.Common.Message.back("本流程未预设步骤,请与管理员联系!"); return;
         }
         Tunnel.Model.Tunnel_Remind tr = new Tunnel.Model.Tunnel_Remind();
         Tunnel.BLL.Tunnel_Remind   br = new Tunnel.BLL.Tunnel_Remind();
         mf = bf.GetModel(int.Parse(Request.Params["Flow"]));
         if (mf.f_state.ToString() == "0")
         {
             isshen = true;
         }
         else
         {
             isshen = false;
         }
         if (!isshen)
         {
             //将当前步骤存入数据库表: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     = 0;
             mte.e_endtime = DateTime.Now;
             mte.e_gid     = this.sava();
             mte.e_user    = ul.LoginID;
             mte.e_time    = DateTime.Now;
             mte.e_nextbid = Convert.ToInt32(currbid);
             bte.Add(mte);
             string[] users = curruser.Split(',');
             foreach (string user in users)
             {
                 if (!string.IsNullOrEmpty(user))
                 {
                     tr.m_title    = TextBox1.Text.Trim() + "<font color=red>(待审批)</font>";
                     tr.m_url      = "N_WorkFlow/MyApply/Apply_zSp.aspx?bid=" + mte.e_gid;
                     tr.m_touser   = Convert.ToInt32(user);
                     tr.m_time     = DateTime.Now;
                     tr.m_type     = 1;
                     tr.m_typeid   = mte.e_gid;
                     tr.m_bid      = Convert.ToInt32(currbid);
                     tr.m_callTime = Convert.ToDateTime("1800-1-1 00:00:00");
                     tr.m_isread   = 0;
                     long messge = br.Add(tr);
                 }
             }
         }
         else
         {
             int s = this.sava();
             ul.UsbnLogin = bm.GetModel(ul.LoginID);
             DataSet dss      = bm.GetList("m_bum=" + ul.UsbnLogin.m_bum);
             string  userlist = "";
             foreach (DataRow dr in dss.Tables[0].Rows)
             {
                 if (Tunnel.BLL.Permission.IfHasPrimision(dr["m_id"].ToString(), "流程审核", "我的工作", false))
                 {
                     userlist = dr["m_id"].ToString();
                 }
             }
             tr.m_title    = TextBox1.Text.Trim() + "<font color=red>(待审核)</font>";
             tr.m_url      = "N_WorkFlow/MyApply/Apply_zSh.aspx?bid=" + s;
             tr.m_touser   = (RadioButtonList3.SelectedValue == "1" ? int.Parse(m_value.Value) : Convert.ToInt32(userlist));
             tr.m_time     = DateTime.Now;
             tr.m_type     = 1;
             tr.m_typeid   = s;
             tr.m_bid      = 0;
             tr.m_callTime = Convert.ToDateTime("1800-1-1 00:00:00");
             tr.m_isread   = 0;
             long messge = br.Add(tr);
         }
         Tunnel.Common.Message.Show("提交成功!", "Apply_Add.aspx?Flow=" + Request.Params["Flow"]);
     }
     catch
     {
         Tunnel.Common.Message.back("流程错误,请与管理员联系!");
     }
 }
Пример #13
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Tunnel.Model.Tunnel_menber tm = ul.GetUserBean(ul.LoginID);
        if (!Tunnel.Data.DESEncrypt.Encrypt(spPassword.Text.Trim()).Equals(tm.m_spassword))
        {
            Tunnel.Common.Message.back("审批密码错误"); return;
        }
        else
        {
            //这里为存储当前步骤
            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
            {
                //将当前步骤存入数据库表: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       = 0;
                mte.e_endtime   = DateTime.Now;
                mte.e_gid       = Convert.ToInt32(Request.Params["bid"]);
                mte.e_user      = ul.LoginID;
                mte.e_nextbuser = m_value.Value;
                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;
                }
                mte.e_nextbid = 1;

                Tunnel.Model.Tunnel_Remind tr = new Tunnel.Model.Tunnel_Remind();
                Tunnel.BLL.Tunnel_Remind   br = new Tunnel.BLL.Tunnel_Remind();
                string[] users = m_value.Value.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/OtherDocument/Other_zSp.aspx?bid=" + Request.Params["bid"];
                        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      = 1;
                        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=1024 and a_gid=" + Request.Params["bid"]);
                    ta.Add(ma);
                }
                Tunnel.Data.DbHelperSQL.ExecuteSql("DELETE TUNNEL_REMIND WHERE m_type=1 and m_bid=1 and m_touser="******" and m_typeid=" + mtb.b_id);//删除待办事项

                Tunnel.Common.Message.Show("操作成功!", "../MyApply/Apply_Sp.aspx");
            }
        }
    }
Пример #14
0
    void bindflow()
    {
        string bWhere = "";

        mtb = btb.GetModel(int.Parse(Request.Params["bid"]));
        mf  = bf.GetModel(mtb.b_sort);
        if (mf.f_sort == 18)
        {
            bWhere = " and e_bid<>0";
        }
        else
        {
            bWhere = "";
        }
        Page.Title = mtb.b_title;
        DataSet       ds      = bte.GetList("e_gid=" + mtb.b_id + bWhere + " order by e_id asc");
        StringBuilder text    = new StringBuilder();
        StringBuilder texttop = new StringBuilder();

        texttop.Append("<tr>");
        texttop.Append("<td align=\"center\" style=\"height: 30px; width: 10%;\">第<font color=red>1</font>步</td>");
        texttop.Append("<td align=\"left\" style=\"height: 30px; width: 20%\">&nbsp;&nbsp;发起</td>");
        texttop.Append("<td align=\"left\" style=\"height: 30%\">&nbsp;&nbsp;<strong style=\"color:Red\">" + getUname(mtb.b_user.ToString()) + "</strong> [<font color=Green>发起</font>]");
        texttop.Append("<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发起于:" + mtb.b_time.ToString() + "</td>");
        texttop.Append("<td align=\"left\" style=\"height: 30px; width: 40%\">&nbsp;<td>");
        texttop.Append("</tr> ");
        if (mtb.b_state == 3)
        {
            nextb = ""; isend = true;
        }
        else if (mtb.b_state == 1)
        {
            string suser = "";
            if (mtb.b_suser == 0)
            {
                ul.UsbnLogin = bm.GetModel(mtb.b_user);
                DataSet dss = new DataSet();
                dss = bm.GetList("m_bum=" + ul.UsbnLogin.m_bum);
                foreach (DataRow dr in dss.Tables[0].Rows)
                {
                    if (Tunnel.BLL.Permission.IfHasPrimision(dr["m_id"].ToString(), "流程审核", "我的工作", false))
                    {
                        suser += dr["m_id"].ToString() + ",";
                    }
                }
                if (!string.IsNullOrEmpty(suser))
                {
                    text.Append("<tr>");
                    text.Append("<td align=\"center\" style=\"height: 30px; width: 10%;\">第<font color=red>2</font>步</td>");
                    text.Append("<td align=\"left\" style=\"height: 30px; width: 20%\">&nbsp;&nbsp;审核</td>");
                    text.Append("<td align=\"left\" style=\"height: 30%\">&nbsp;&nbsp;<strong style=\"color:Red\">" + getallUname(suser) + " 主办</strong> [<font color=blue>审核中</font>]");
                    text.Append("<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;开始于:" + mtb.b_time.ToString() + "</td>");
                    text.Append("<td align=\"left\" style=\"height: 30px; width: 40%\">&nbsp;&nbsp;</td>");
                    text.Append("</tr> ");
                }
                else
                {
                    text.Append("<tr>");
                    text.Append("<td align=\"center\" colspan='4' style=\"height: 30px; width: 10%;color:red\">没有设置审核人,请与管理员联系!</td>");
                    text.Append("</tr> ");
                }
            }
            else
            {
                text.Append("<tr>");
                text.Append("<td align=\"center\" style=\"height: 30px; width: 10%;\">第<font color=red>2</font>步</td>");
                text.Append("<td align=\"left\" style=\"height: 30px; width: 20%\">&nbsp;&nbsp;审核</td>");
                text.Append("<td align=\"left\" style=\"height: 30%\">&nbsp;&nbsp;<strong style=\"color:Red\">" + getUname(mtb.b_suser.ToString()) + " 主办</strong> [<font color=blue>审核中</font>]");
                text.Append("<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;开始于:" + mtb.b_time.ToString() + "</td>");
                text.Append("<td align=\"left\" style=\"height: 30px; width: 40%\">&nbsp;&nbsp;</td>");
                text.Append("</tr> ");
            }
            nextb = text.ToString();
        }
        else
        {
            if (mtb.b_state > 0)
            {
                string currbid  = Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "e_nextbid", "e_gid=" + mtb.b_id + " order by e_id desc");
                string currtime = Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "e_time", "e_gid=" + mtb.b_id + " order by e_id desc");
                int    currnum  = Convert.ToInt32(Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "count(*)", "e_gid=" + mtb.b_id));
                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 = ts.GetModel(Convert.ToInt32(currbid));
                string nextnum  = "";
                string nextname = "";
                string nextuser = "";
                if (mts != null)
                {
                    nextnum  = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_num", "s_id=" + mts.s_id);
                    nextname = getname(mts.s_id.ToString());
                    nextuser = getallUname(mts.s_zid.ToString());
                }
                else
                {
                    nextname = "步骤不存在或已删除";
                    nextuser = nextnum = "无";
                }
                text.Append("<tr>");
                text.Append("<td align=\"center\" style=\"height: 30px; width: 10%;\">第<font color=red>" + (currnum + (bWhere == "" ? 2 : 1)) + "</font>步</td>");
                text.Append("<td align=\"left\" style=\"height: 30px; width: 20%\">&nbsp;&nbsp;" + "序号" + nextnum + ":" + nextname + "</td>");
                text.Append("<td align=\"left\" style=\"height: 30%\">&nbsp;&nbsp;<strong style=\"color:Red\">" + nextuser + " 主办</strong> [<font color=blue>办理中</font>]");
                text.Append("<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;开始于:" + currtime + "</td>");
                text.Append("<td align=\"left\" style=\"height: 30px; width: 40%\">&nbsp;&nbsp;</td>");
                text.Append("</tr> ");
                nextb = text.ToString();
            }
        }
        toptb = texttop.ToString();
        Repeater2.DataSource = ds;
        Repeater2.DataBind();
    }
Пример #15
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;
            }
        }
    }
Пример #16
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        Tunnel.Model.Tunnel_menber tm = ul.GetUserBean(ul.LoginID);
        if (!Tunnel.Data.DESEncrypt.Encrypt(spPassword.Text.Trim()).Equals(tm.m_spassword))
        {
            Tunnel.Common.Message.back("审批密码错误"); return;
        }
        else
        {
            //这里为存储当前步骤
            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));
                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     = 0;
                    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=" + mtb.b_id + " order by e_id desc");
                    if (!string.IsNullOrEmpty(lastendtime))
                    {
                        mte.e_time = Convert.ToDateTime(lastendtime);//取得上一步的最后执行时间
                    }
                    else
                    {
                        mte.e_time = mtb.b_time;
                    }
                    mte.e_nextbid = 0;
                    bte.Add(mte);

                    #region 消息提示
                    Tunnel.Model.Tunnel_Remind tr = new Tunnel.Model.Tunnel_Remind();
                    Tunnel.BLL.Tunnel_Remind   br = new Tunnel.BLL.Tunnel_Remind();
                    tr.m_title = mtb.b_title + "<font color=red>(审批没有通过)</font>";
                    string flowtype = Tunnel.Common.GetValue.getDataValue("Tunnel_flow", "f_sort", "f_id=" + mtb.b_sort);
                    if ("18".Equals(flowtype))
                    {
                        tr.m_url = "N_WorkFlow/ODocument/Document_Edit.aspx?Bid=" + mtb.b_id;
                    }
                    else
                    {
                        tr.m_url = "N_WorkFlow/MyApply/Apply_Edit.aspx?Bid=" + mtb.b_id + "&Flow=" + mtb.b_sort;
                    }
                    tr.m_touser   = Convert.ToInt32(mtb.b_user);
                    tr.m_time     = DateTime.Now;
                    tr.m_type     = 1;
                    tr.m_typeid   = Convert.ToInt32(mtb.b_id);
                    tr.m_bid      = -1;
                    tr.m_callTime = Convert.ToDateTime("1800-1-1 00:00:00");
                    tr.m_isread   = 0;
                    long messge = br.Add(tr);
                    #endregion

                    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=" + mtb.b_id);
                        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.Data.DbHelperSQL.ExecuteSql("UPDATE TUNNEL_BUMF SET B_STATE=0 WHERE B_ID=" + mtb.b_id);                                //改变公文状态
                    Tunnel.Common.Message.Show("操作成功!", "Apply_Sp.aspx");
                }
                else
                {
                    Tunnel.Common.Message.back("此流程己审批通过,请勿重复审批!"); return;
                }
            }
        }
    }
Пример #17
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Tunnel.Model.Tunnel_flow model)
 {
     return(dal.Add(model));
 }
Пример #18
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Tunnel.Model.Tunnel_flow model)
 {
     dal.Update(model);
 }