Beispiel #1
0
 protected void FlowID_SelectedIndexChanged(object sender, EventArgs e)
 {
     //流程名称
     FlowName.DataSource     = WebBLL.Tbl_FlowManager.GetTbl_FlowType(FlowID.SelectedValue);
     FlowName.DataTextField  = "FlowName";
     FlowName.DataValueField = "ID";
     FlowName.DataBind();
     FlowName.Items.Insert(0, new ListItem("选择流程", ""));
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //流程名称
         FlowName.DataSource     = WebBLL.Tbl_FlowManager.GetTbl_FlowAll();
         FlowName.DataTextField  = "FlowName";
         FlowName.DataValueField = "ID";
         FlowName.DataBind();
         FlowName.Items.Insert(0, new ListItem("选择流程", ""));
         Bind();
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //设置只读权限
                if (Request.QueryString["type"] == "read")
                {
                    btn_submit.Visible = false;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "$(function(){$('input').attr('readonly', 'readonly');$('select').attr('disabled', 'true');$('textarea').attr('readonly', 'readonly');});", true);
                }
                //流程名称
                FlowName.DataSource     = WebBLL.Tbl_FlowManager.GetTbl_FlowAll();
                FlowName.DataTextField  = "FlowName";
                FlowName.DataValueField = "ID";
                FlowName.DataBind();
                FlowName.Items.Insert(0, new ListItem("选择流程", ""));

                //遍历绑定人员列表
                WebBLL.Tbl_UserManager.GetUsersByListBox(NodeUser);

                Bind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //流程名称
                FlowName.DataSource     = WebBLL.Tbl_FlowManager.GetTbl_FlowAll();
                FlowName.DataTextField  = "FlowName";
                FlowName.DataValueField = "ID";
                FlowName.DataBind();
                FlowName.Items.Insert(0, "选择流程");

                //获取当前工作ID
                ID = Convert.ToInt32(Request.QueryString["id"]);

                //如果是项目流程发起的表单
                int projectid = WebCommon.Public.ToInt(Request.QueryString["ProjectID"]);
                if (projectid > 0)
                {
                    ID = WebCommon.Public.ToInt(WebBLL.Tbl_FlowWorkManager.GetDataTableByPage(1, 1, "projectid=" + projectid.ToString(), "id desc").Rows[0]["ID"]);
                }
                FlowWorkID.Value = ID.ToString();

                //获取当前工作内容
                WebModels.Tbl_FlowWork flowwork = WebBLL.Tbl_FlowWorkManager.GetTbl_FlowWorkById(ID);
                this.NodeLocal.Value        = WebBLL.Tbl_FlowNodeManager.GetTbl_FlowNodeById(flowwork.NodeID).NodeName;
                this.WorkName.Value         = flowwork.WorkName;
                this.FlowName.SelectedValue = flowwork.FlowID.ToString();
                this.FormContent.InnerHtml  = flowwork.FormContent;

                //获取表单常用短语
                string FromWords = "";
                foreach (WebModels.Tbl_FlowFormWord formword in WebBLL.Tbl_FlowFormWordManager.GetTbl_FlowFormWordAll())
                {
                    FromWords += "<div onclick=InputText($(this).text()) style=margin:5px>" + formword.IFW_Name + "</div>";
                }
                //向表单注册验证程序
                string LocalPwd    = WebBLL.Tbl_UserManager.GetTbl_UserByUserName(WebCommon.Public.GetUserName()).UserPwd;
                string LimitScript = "" +
                                     "$('.formctrl[disabled]').removeAttr('disabled');" +
                                     "$('.formctrl[data-node!=" + flowwork.NodeNo + "]').attr('disabled','disabled');" +
                                     "$('.formctrl[type^=text]').dblclick(function(){$(this).attr('lock','1');$$.MsgBox('常用短语', '" + FromWords + "', '关闭窗口');});" +
                                     "$('.formctrl[value=电子签名]').click(function(){$$.MsgBox('密码验证', '<input type=password id=password>', '确定:InsertSign()', '取消');});" +
                                     "function InsertSign(){" +
                                     "if($.md5($('#password').val())=='" + LocalPwd + "'){$('.formctrl[value=电子签名]').hide();$$.MsgBox(0);" +
                                     "$('.formctrl[value=电子签名]').after('<img src=" + WebBLL.Tbl_UserManager.GetTbl_UserByUserName(WebCommon.Public.GetUserName()).U_Sign + ">');" +
                                     "}else{alert('密码不正确');}}" +
                                     "function InputText(info){" +
                                     "$('.formctrl[lock=1]').val(info);$('.formctrl[lock=1]').removeAttr('lock');$$.MsgBox(0);}";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "message", LimitScript, true);

                //流程的当前节点绑定
                NodeID.DataSource     = WebBLL.Tbl_FlowNodeManager.GetTbl_FlowNodesByFlowID(flowwork.FlowID);
                NodeID.DataTextField  = "NodeName";
                NodeID.DataValueField = "NodeNo";
                NodeID.DataBind();
                NodeID.Enabled       = false;
                NodeID.SelectedValue = (Convert.ToInt32(flowwork.NodeNo) + 1).ToString();
                //如果是最后一个节点那么不再跳转
                if (NodeID.SelectedValue == "1")
                {
                    NodeID.SelectedIndex = NodeID.Items.Count - 1;
                }

                //判断节点权限
                DataRow dr = WebBLL.Tbl_FlowNodeManager.GetDataTableByPage(1, 1, "flowid=" + flowwork.FlowID.ToString() + " and nodeno=" + flowwork.NodeNo, "").Rows[0];
                if (flowwork.Status == "结束")
                {
                    btn_submit.Visible = false;
                }
                if (!dr["NodeUserLimit"].ToString().Contains("允许驳回"))
                {
                    Button1.Visible = false;
                }
                if (!dr["NodeUserLimit"].ToString().Contains("允许跳过"))
                {
                    Button2.Visible = false;
                }
                if (!dr["NodeUserLimit"].ToString().Contains("允许终止"))
                {
                    Button3.Visible = false;
                }
                if (!dr["NodeUser"].ToString().Contains(WebCommon.Public.GetUserName()))
                {
                    btn_submit.Visible = false;
                }
            }
        }