Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();
            ZWL.BLL.ERPNWorkFlowNode Model = new ZWL.BLL.ERPNWorkFlowNode();
            Model.GetModel(int.Parse(Request.QueryString["ID"].ToString()));

            this.lblNodeSerils.Text    = Model.NodeSerils.ToString();
            this.lblNodeName.Text      = Model.NodeName.ToString();
            this.lblNodeAddr.Text      = Model.NodeAddr.ToString();
            this.lblNextNode.Text      = Model.NextNode.ToString();
            this.lblIFCanJump.Text     = Model.IFCanJump.ToString();
            this.lblIFCanView.Text     = Model.IFCanView.ToString();
            this.lblIFCanEdit.Text     = Model.IFCanEdit.ToString();
            this.lblIFCanDel.Text      = Model.IFCanDel.ToString();
            this.lblJieShuHours.Text   = Model.JieShuHours.ToString();
            this.lblPSType.Text        = Model.PSType.ToString();
            this.lblSPType.Text        = Model.SPType.ToString();
            this.lblSPDefaultList.Text = Model.SPDefaultList.ToString();
            this.lblCanWriteSet.Text   = Model.CanWriteSet.ToString();
            this.lblSecretSet.Text     = Model.SecretSet.ToString();
            this.lblConditionSet.Text  = Model.ConditionSet.ToString();

            //写系统日志
            ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
            MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            MyRiZhi.DoSomething = "用户查看节点定义信息(" + this.lblNodeName.Text + ")";
            MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
            MyRiZhi.Add();
        }
    }
Beispiel #2
0
    /// <summary>
    /// 设置具体属性、当前判断权限、可写、保密等
    /// </summary>
    public void SetNodeInfoAndSet()
    {
        //当前开始节点是否有查看、编辑、删除按钮?当前按钮属性
        string NowNodeID = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select JieDianID from ERPNWorkToDo where ID=" + Request.QueryString["ID"].ToString());

        ZWL.BLL.ERPNWorkFlowNode MyJieDianNow = new ZWL.BLL.ERPNWorkFlowNode();
        MyJieDianNow.GetModel(int.Parse(NowNodeID));
        if (MyJieDianNow.IFCanDel == "否")
        {
            this.ImageButton3.Visible = false;
        }
        if (MyJieDianNow.IFCanView == "否")
        {
            this.ImageButton4.Visible = false;
        }
        if (MyJieDianNow.IFCanEdit == "否")
        {
            this.ImageButton5.Visible = false;
        }
        if (MyJieDianNow.IFCanJump == "否")
        {
            this.Button3.Visible = false;
        }

        ZWL.BLL.ERPNWorkToDo MyModelWork = new ZWL.BLL.ERPNWorkToDo();
        MyModelWork.GetModel(int.Parse(Request.QueryString["ID"].ToString()));

        //获取当前表单对应的工作数据列
        string[] FormItemList = ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 ItemsList from ERPNForm where ID=" + MyModelWork.FormID.ToString()).Split('|');
        //获取当前节点的可写权限、保密权限
        string CanWriteStr = MyJieDianNow.CanWriteSet;
        string SecretStr   = MyJieDianNow.SecretSet;

        for (int ItemNum = 0; ItemNum < FormItemList.Length; ItemNum++)
        {
            if (FormItemList[ItemNum].ToString().Trim().Length > 0)
            {
                if (ZWL.Common.PublicMethod.StrIFIn(FormItemList[ItemNum].ToString(), CanWriteStr) == false)                                        //不属于可写字段
                {
                    PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").disabled=true;"; //readOnly
                }
                else
                {
                    PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").disabled=false;"; //readOnly
                }
                if (ZWL.Common.PublicMethod.StrIFIn(FormItemList[ItemNum].ToString(), SecretStr) == true)                                            //属于保密字段
                {
                    PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").style.visibility=\"hidden\";";
                }
                else
                {
                    PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").style.visibility=\"visible\";";
                }
            }
        }
    }
Beispiel #3
0
    /// <summary>
    /// 设置下一节点具体属性、当前判断权限、可写、保密等
    /// </summary>
    public void SetNodeInfoAndSet()
    {
        try
        {
            //根据选择的节点,绑定人员等信息。
            ZWL.BLL.ERPNWorkFlowNode MyJieDian = new ZWL.BLL.ERPNWorkFlowNode();
            MyJieDian.GetModel(int.Parse(this.DropDownList3.SelectedItem.Value.ToString()));
            this.TextBox1.Text = MyJieDian.PSType;
            this.TextBox2.Text = MyJieDian.SPType;
            //根据审批模式设置页面
            SetPageFromPSStr(MyJieDian.SPType, MyJieDian.SPDefaultList);

            //当前开始节点是否有查看、编辑、删除按钮?当前按钮属性
            string NowNodeID = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select ID from ERPNWorkFlowNode where WorkFlowID=" + Request.QueryString["WorkFlowID"].ToString() + " and NodeAddr='开始'");
            ZWL.BLL.ERPNWorkFlowNode MyJieDianNow = new ZWL.BLL.ERPNWorkFlowNode();
            MyJieDianNow.GetModel(int.Parse(NowNodeID));
            if (MyJieDianNow.IFCanDel == "否")
            {
                this.ImageButton3.Visible = false;
            }

            //获取当前表单对应的工作数据列
            string[] FormItemList = ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 ItemsList from ERPNForm where ID=" + Request.QueryString["FormID"].ToString()).Split('|');
            //获取当前节点的可写权限、保密权限
            string CanWriteStr = MyJieDianNow.CanWriteSet;
            string SecretStr   = MyJieDianNow.SecretSet;

            for (int ItemNum = 0; ItemNum < FormItemList.Length; ItemNum++)
            {
                if (FormItemList[ItemNum].ToString().Trim().Length > 0)
                {
                    if (ZWL.Common.PublicMethod.StrIFIn(FormItemList[ItemNum].ToString(), CanWriteStr) == false)                                        //不属于可写字段
                    {
                        PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").disabled=true;"; //readOnly
                    }
                    else
                    {
                        PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").disabled=false;"; //readOnly
                    }
                    if (ZWL.Common.PublicMethod.StrIFIn(FormItemList[ItemNum].ToString(), SecretStr) == true)                                            //属于保密字段
                    {
                        PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").style.visibility=\"hidden\";";
                    }
                    else
                    {
                        PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").style.visibility=\"visible\";";
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ZWL.Common.MessageBox.ShowAndRedirect(this, "该流程下一节点未定义完整,请配置完整!", "NWorkToDoSelect.aspx");
        }
    }
Beispiel #4
0
    protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            //根据选择的节点,绑定人员等信息。
            ZWL.BLL.ERPNWorkFlowNode MyJieDian = new ZWL.BLL.ERPNWorkFlowNode();
            MyJieDian.GetModel(int.Parse(this.DropDownList3.SelectedItem.Value.ToString()));
            this.TextBox1.Text = MyJieDian.PSType;
            this.TextBox2.Text = MyJieDian.SPType;

            SetPageFromPSStr(MyJieDian.SPType, MyJieDian.SPDefaultList);
        }
        catch
        { }
    }
Beispiel #5
0
    public string PiLiangSet = ""; //批量设置字段的可写、保密属性

    #endregion Fields

    #region Methods

    /// <summary>
    /// 设置具体属性、当前判断权限、可写、保密等
    /// </summary>
    public void SetNodeInfoAndSet()
    {
        //当前开始节点是否有查看、编辑、删除按钮?当前按钮属性
        string NowNodeID = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select JieDianID from ERPNWorkToDo where ID=" + Request.QueryString["ID"].ToString());
        ZWL.BLL.ERPNWorkFlowNode MyJieDianNow = new ZWL.BLL.ERPNWorkFlowNode();
        MyJieDianNow.GetModel(int.Parse(NowNodeID));
        if (MyJieDianNow.IFCanDel == "否")
        {
            this.ImageButton3.Visible = false;
        }

        if (MyJieDianNow.IFCanJump == "否")
        {
            this.Button3.Visible = false;
        }

        ZWL.BLL.ERPNWorkToDo MyModelWork = new ZWL.BLL.ERPNWorkToDo();
        MyModelWork.GetModel(int.Parse(Request.QueryString["ID"].ToString()));

        //获取当前表单对应的工作数据列
        string[] FormItemList = ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 ItemsList from ERPNForm where ID=" + MyModelWork.FormID.ToString()).Split('|');
        //获取当前节点的可写权限、保密权限
        string CanWriteStr = MyJieDianNow.CanWriteSet;
        string SecretStr = MyJieDianNow.SecretSet;

        for (int ItemNum = 0; ItemNum < FormItemList.Length; ItemNum++)
        {
            if (FormItemList[ItemNum].ToString().Trim().Length > 0)
            {
                if (ZWL.Common.PublicMethod.StrIFIn(FormItemList[ItemNum].ToString(), CanWriteStr) == false)//不属于可写字段
                {
                    PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").disabled=true;";//readOnly
                }
                else
                {
                    PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").disabled=false;";//readOnly
                }
                if (ZWL.Common.PublicMethod.StrIFIn(FormItemList[ItemNum].ToString(), SecretStr) == true)//属于保密字段
                {
                    PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").style.visibility=\"hidden\";";
                }
                else
                {
                    PiLiangSet = PiLiangSet + "document.getElementById(\"" + FormItemList[ItemNum].ToString().Split('_')[0] + "\").style.visibility=\"visible\";";
                }
            }
        }
    }
Beispiel #6
0
 public void DataBindToGridview(string IDList)
 {
     ZWL.BLL.ERPNWorkFlowNode MyModel = new ZWL.BLL.ERPNWorkFlowNode();
     if (IDList.Trim().Length > 0)
     {
         GVData.DataSource = MyModel.GetList(" WorkFlowID=" + Request.QueryString["WorkFlowID"].ToString() + " and ID in(" + IDList + ") order by NodeSerils asc,ID desc");
     }
     else
     {
         GVData.DataSource = MyModel.GetList(" WorkFlowID=" + Request.QueryString["WorkFlowID"].ToString() + " order by NodeSerils asc,ID desc");
     }
     GVData.DataBind();
     LabPageSum.Text     = Convert.ToString(GVData.PageCount);
     LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
     this.GoPage.Text    = LabCurrentPage.Text.ToString();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         ZWL.Common.PublicMethod.CheckSession();
         ZWL.BLL.ERPNWorkFlowNode Model = new ZWL.BLL.ERPNWorkFlowNode();
         Model.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
         this.txtNodeSerils.Text          = Model.NodeSerils.ToString();
         this.txtNodeName.Text            = Model.NodeName.ToString();
         this.DropDownList1.SelectedValue = Model.NodeAddr.ToString();
         this.txtNextNode.Text            = Model.NextNode.ToString();
         this.DropDownList2.SelectedValue = Model.IFCanJump.ToString();
         this.DropDownList3.SelectedValue = Model.IFCanView.ToString();
         this.DropDownList4.SelectedValue = Model.IFCanEdit.ToString();
         this.DropDownList5.SelectedValue = Model.IFCanDel.ToString();
         this.txtJieShuHours.Text         = Model.JieShuHours.ToString();
         this.DropDownList6.SelectedValue = Model.PSType.ToString();
         this.DropDownList7.SelectedValue = Model.SPType.ToString();
         this.txtSPDefaultList.Text       = Model.SPDefaultList.ToString();
     }
 }
Beispiel #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //该节点根据传过来的工作的ID信息,查询到使用的工作流、当前节点信息(全部通过往下流转、一个通过往下流转)
        //根据节点信息、该工作的通过人列表信息、审批人列表信息===>该节点是否应该继续往下流转
        //如果要往下流转则显示页面上的下一节点设置信息,否则用程序跳转回待办事项页面。

        //根据Type参数属性,Type为0时为正常下一节点,Type为1时为绑定所有节点供选择。
        if (!Page.IsPostBack)
        {
            ZWL.BLL.ERPNWorkToDo MyModel = new ZWL.BLL.ERPNWorkToDo();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.Label1.Text = MyModel.WorkName;
            this.Label4.Text = MyModel.FormContent.Replace("disabled", "").Replace("hidden", "visible");

            //判断 当前节点信息(全部通过可向下流转、一人通过可向下流转)  该工作的通过人列表信息、审批人列表信息
            string SPMoShi = ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 PSType from ERPNWorkFlowNode where ID=" + MyModel.JieDianID.ToString());
            if (CheCkIfOk(MyModel.OKUserList, MyModel.ShenPiUserList, SPMoShi) == true)
            {
                //绑定下一个节点
                try
                {
                    //绑定下一节点  正常状态
                    if (Request.QueryString["Type"].ToString().Trim() == "0")
                    {
                        //绑定下一节点
                        string[] NextStrList = ZWL.DBUtility.DbHelperSQL.GetSHSL("select NextNode from ERPNWorkFlowNode where ID=" + MyModel.JieDianID.ToString()).Split(',');
                        for (int i = 0; i < NextStrList.Length; i++)
                        {
                            ListItem MyItem = new ListItem();
                            MyItem.Value = ZWL.DBUtility.DbHelperSQL.GetSHSL("select ID from ERPNWorkFlowNode where NodeSerils='" + NextStrList[i].ToString() + "' and WorkFlowID=" + MyModel.WorkFlowID.ToString());//根据序号和workflowID获得节点ID
                            MyItem.Text  = "节点序号:" + NextStrList[i].ToString() + "--节点名称:" + ZWL.DBUtility.DbHelperSQL.GetSHSL("select NodeName from ERPNWorkFlowNode where NodeSerils='" + NextStrList[i].ToString() + "' and WorkFlowID=" + MyModel.WorkFlowID.ToString());
                            if (MyItem.Value.ToString().Length > 0)
                            {
                                this.DropDownList3.Items.Add(MyItem);
                            }
                        }
                    }
                    else //绑定所有节点(除开始节点)
                    {
                        //清除根据条件决定下一节点选项
                        this.CheckBox1.Checked = false;
                        this.CheckBox1.Enabled = false;


                        DataSet MyDS = ZWL.DBUtility.DbHelperSQL.GetDataSet("select ID,NodeSerils,NodeName from ERPNWorkFlowNode where WorkFlowID=" + MyModel.WorkFlowID.ToString());
                        for (int jjj = 0; jjj < MyDS.Tables[0].Rows.Count; jjj++)
                        {
                            ListItem MyItem = new ListItem();
                            MyItem.Value = MyDS.Tables[0].Rows[jjj]["ID"].ToString();
                            MyItem.Text  = "节点序号:" + MyDS.Tables[0].Rows[jjj]["NodeSerils"].ToString() + "--节点名称:" + MyDS.Tables[0].Rows[jjj]["NodeName"].ToString();
                            if (MyItem.Value.ToString().Length > 0)
                            {
                                this.DropDownList3.Items.Add(MyItem);
                            }
                        }
                    }

                    //根据选择的节点,绑定人员等信息。
                    ZWL.BLL.ERPNWorkFlowNode MyJieDian = new ZWL.BLL.ERPNWorkFlowNode();
                    MyJieDian.GetModel(int.Parse(this.DropDownList3.SelectedItem.Value.ToString()));
                    this.TextBox1.Text = MyJieDian.PSType;
                    this.TextBox2.Text = MyJieDian.SPType;

                    SetPageFromPSStr(MyJieDian.SPType, MyJieDian.SPDefaultList);
                }
                catch
                { }
            }
            else
            {
                ZWL.Common.MessageBox.ShowAndRedirect(this, "该节点工作需要等待其他人全部办理后才能继续往下流转,请继续等待!", "NowWorkFlow.aspx");
            }

            //~~~~~~~~~~~~~~~~~当前节点为空!并且下一节点的下拉框也为空!······直接进行提交操作!
            if (this.DropDownList3.Items.Count <= 0 && ZWL.DBUtility.DbHelperSQL.GetSHSL("select NodeAddr from ERPNWorkFlowNode where ID=" + MyModel.JieDianID.ToString()) == "结束")
            {
                ZWL.Common.MessageBox.ResponseScript(this, "document.getElementById('ImageButton1').click();");
            }
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        //判断开始、结束两个节点的唯一性,中间节点必须指定下一节点
        if (this.DropDownList1.SelectedItem.Text == "开始")
        {
            string ExsistID = ZWL.DBUtility.DbHelperSQL.GetSHSL("select ID from ERPNWorkFlowNode where WorkFlowID=" + Request.QueryString["WorkFlowID"].ToString() + " and NodeAddr='开始' and ID!=" + Request.QueryString["ID"].ToString());
            if (ExsistID.Trim().Length > 0)
            {
                ZWL.Common.MessageBox.Show(this, "该流程已经存在“开始”节点,请不要重复添加!");
                return;
            }
        }
        if (this.DropDownList1.SelectedItem.Text == "结束")
        {
            string ExsistID = ZWL.DBUtility.DbHelperSQL.GetSHSL("select ID from ERPNWorkFlowNode where WorkFlowID=" + Request.QueryString["WorkFlowID"].ToString() + " and NodeAddr='结束' and ID!=" + Request.QueryString["ID"].ToString());
            if (ExsistID.Trim().Length > 0)
            {
                ZWL.Common.MessageBox.Show(this, "该流程已经存在“结束”节点,请不要重复添加!");
                return;
            }
        }

        if (this.DropDownList1.SelectedItem.Text == "中间段" || this.DropDownList1.SelectedItem.Text == "开始")
        {
            string ExsistID = this.txtNextNode.Text.Trim();
            if (ExsistID.Trim().Length <= 0)
            {
                ZWL.Common.MessageBox.Show(this, "中间段和开始节点必须指定下一节点序号!");
                return;
            }
        }
        //判断节点序号的唯一性
        string NodeSerils = ZWL.DBUtility.DbHelperSQL.GetSHSL("select ID from ERPNWorkFlowNode where WorkFlowID=" + Request.QueryString["WorkFlowID"].ToString() + " and NodeSerils='" + this.txtNodeSerils.Text.Trim() + "' and ID!=" + Request.QueryString["ID"].ToString());

        if (NodeSerils.Trim().Length > 0)
        {
            ZWL.Common.MessageBox.Show(this, "该节点序号已经存在,请不要重复添加!");
            return;
        }

        ZWL.BLL.ERPNWorkFlowNode Model = new ZWL.BLL.ERPNWorkFlowNode();

        Model.ID            = int.Parse(Request.QueryString["ID"].ToString());
        Model.WorkFlowID    = int.Parse(Request.QueryString["WorkFlowID"].ToString());
        Model.NodeSerils    = this.txtNodeSerils.Text.ToString().Trim();
        Model.NodeName      = this.txtNodeName.Text.ToString().Trim();
        Model.NodeAddr      = this.DropDownList1.SelectedItem.Text.ToString();
        Model.NextNode      = this.txtNextNode.Text.ToString().Trim();
        Model.IFCanJump     = this.DropDownList2.SelectedItem.Text.ToString();
        Model.IFCanView     = this.DropDownList3.SelectedItem.Text.ToString();
        Model.IFCanEdit     = this.DropDownList4.SelectedItem.Text.ToString();
        Model.IFCanDel      = this.DropDownList5.SelectedItem.Text.ToString();
        Model.JieShuHours   = int.Parse(this.txtJieShuHours.Text.Trim());
        Model.PSType        = this.DropDownList6.SelectedItem.Text.ToString();
        Model.SPType        = this.DropDownList7.SelectedItem.Text.ToString();
        Model.SPDefaultList = this.txtSPDefaultList.Text.ToString().Trim();

        Model.Update();

        //写系统日志
        ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
        MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyRiZhi.DoSomething = "用户修改节点定义信息(" + this.txtNodeName.Text + ")";
        MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
        MyRiZhi.Add();

        ZWL.Common.MessageBox.ShowAndRedirect(this, "节点定义信息修改成功!", "NWorkFlowNode.aspx?WorkFlowID=" + Request.QueryString["WorkFLowID"].ToString());
    }
Beispiel #10
0
    public void BanLiWork()
    {
        ZWL.BLL.ERPNWorkToDo XMyModel = new ZWL.BLL.ERPNWorkToDo();
        XMyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));

        //初始化
        string XJieDianIDStr      = "0";
        string XJieDianNameStr    = "";
        string XShenPiRenListStr  = "";
        string XTongGuoRenListStr = "";
        string XStateNowStr       = "正在办理";

        string JingBanRenStr = "";//条件判断时读取经办人

        try
        {
            #region 添加默认审批人检查 Andy 20130925

            //根据选择的节点,绑定人员等信息。
            ZWL.BLL.ERPNWorkFlowNode MyJieDian = new ZWL.BLL.ERPNWorkFlowNode();
            MyJieDian.GetModel(int.Parse(this.DropDownList3.SelectedItem.Value.ToString()));

            if (MyJieDian.SPType == "从默认审批人中选择")
            {
                if (!String.IsNullOrEmpty(MyJieDian.SPDefaultList))
                {
                    ArrayList CurrentSP = new ArrayList(this.TextBox5.Text.Trim().Split(','));
                    ArrayList SPDefault = new ArrayList(MyJieDian.SPDefaultList.Split(','));

                    foreach (string sp in CurrentSP)
                    {
                        if (!SPDefault.Contains(sp))
                        {
                            ZWL.Common.MessageBox.Show(this, "请从默认审批人中选择,默认审批人:" + MyJieDian.SPDefaultList + " !");
                            return;
                        }
                    }
                }
            }
            else if (MyJieDian.SPType == "从默认审批部门中选择")
            {
                string   SqlWhere   = "";
                string[] DefultList = MyJieDian.SPDefaultList.Split(',');
                for (int i = 0; i < DefultList.Length; i++)
                {
                    if (SqlWhere.Trim().Length > 0)
                    {
                        SqlWhere = SqlWhere + " or  " + " ','+Department+',' like '%," + DefultList[i].ToString() + ",%' ";
                    }
                    else
                    {
                        SqlWhere = " ','+Department+',' like '%," + DefultList[i].ToString() + ",%' ";
                    }
                }

                string SPDefaultStr = ZWL.DBUtility.DbHelperSQL.GetStringList("select UserName from ERPUser where " + SqlWhere).Replace("|", ",");

                if (!String.IsNullOrEmpty(SPDefaultStr))
                {
                    ArrayList CurrentSP = new ArrayList(this.TextBox5.Text.Trim().Split(','));
                    ArrayList SPDefault = new ArrayList(SPDefaultStr.Split(','));

                    foreach (string sp in CurrentSP)
                    {
                        if (!SPDefault.Contains(sp))
                        {
                            ZWL.Common.MessageBox.Show(this, "请从默认审批部门中选择,默认审批部门:" + MyJieDian.SPDefaultList + " !");
                            return;
                        }
                    }
                }
            }
            else if (MyJieDian.SPType == "从默认审批角色中选择")
            {
                string   SqlWhere   = "";
                string[] DefultList = MyJieDian.SPDefaultList.Split(',');
                for (int i = 0; i < DefultList.Length; i++)
                {
                    if (SqlWhere.Trim().Length > 0)
                    {
                        SqlWhere = SqlWhere + " or  " + " ','+JiaoSe+',' like '%," + DefultList[i].ToString() + ",%' ";
                    }
                    else
                    {
                        SqlWhere = " ','+JiaoSe+',' like '%," + DefultList[i].ToString() + ",%' ";
                    }
                }

                string SPDefaultStr = ZWL.DBUtility.DbHelperSQL.GetStringList("select UserName from ERPUser where " + SqlWhere).Replace("|", ",");

                if (!String.IsNullOrEmpty(SPDefaultStr))
                {
                    ArrayList CurrentSP = new ArrayList(this.TextBox5.Text.Trim().Split(','));
                    ArrayList SPDefault = new ArrayList(SPDefaultStr.Split(','));

                    foreach (string sp in CurrentSP)
                    {
                        if (!SPDefault.Contains(sp))
                        {
                            ZWL.Common.MessageBox.Show(this, "请从默认审批角色中选择,默认审批角色:" + MyJieDian.SPDefaultList + " !");
                            return;
                        }
                    }
                }
            }
            #endregion


            if (CheckBox1.Checked == true)
            {
                //条件未找到或者没有匹配项时,采用选择好的节点
                XJieDianIDStr = this.DropDownList3.SelectedValue.ToString();
                try
                {
                    ///////////根据条件获取下一审批节点信息
                    XJieDianIDStr = CheckCondition(this.DropDownList3.SelectedValue.ToString()).ToString();
                }
                catch
                {
                    XJieDianIDStr = this.DropDownList3.SelectedValue.ToString();
                }
            }
            else
            {
                XJieDianIDStr = this.DropDownList3.SelectedValue.ToString();
            }
            XStateNowStr    = "正在办理";
            XJieDianNameStr = ZWL.DBUtility.DbHelperSQL.GetSHSL("select NodeName from ERPNWorkFlowNode where ID=" + XJieDianIDStr);
        }
        catch
        {
            if (ZWL.DBUtility.DbHelperSQL.GetSHSL("select NodeAddr from ERPNWorkFlowNode where ID=" + XMyModel.JieDianID.ToString()) == "结束")
            {
                XStateNowStr  = "正常结束";
                XJieDianIDStr = XMyModel.JieDianID.ToString();
                GetDetailsData();//写入明细表
            }
            else
            {
                XStateNowStr  = "强制结束";
                XJieDianIDStr = XMyModel.JieDianID.ToString();
                GetDetailsData();//写入明细表
            }
            XJieDianNameStr = "结束";
        }
        if (JingBanRenStr == "")
        {
            XShenPiRenListStr = ZWL.Common.PublicMethod.WorkWeiTuoUserList(this.TextBox5.Text);
        }
        else
        {
            XShenPiRenListStr = ZWL.Common.PublicMethod.WorkWeiTuoUserList(JingBanRenStr);
        }
        if (XShenPiRenListStr.Trim().Length <= 0)
        {
            XShenPiRenListStr = "工作已办结";
        }
        XTongGuoRenListStr = "默认";

        //执行uodate语句
        ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPNWorkToDo set LateTime='" + DateTime.Now.AddHours(double.Parse(ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 JieShuHours from ERPNWorkFlowNode where ID=" + XJieDianIDStr))).ToString() + "',JieDianID=" + XJieDianIDStr + ",JieDianName='" + XJieDianNameStr + "',ShenPiUserList='" + XShenPiRenListStr + "',OKUserList='" + XTongGuoRenListStr + "',StateNow='" + XStateNowStr + "' where ID=" + Request.QueryString["ID"].ToString());


        if (XStateNowStr == "正在办理")
        {
            //发送短信
            SendMainAndSms.SendMessage(CHKSMS, CHKMOB, "您有新的工作需要办理!(" + this.Label1.Text + ")", ZWL.Common.PublicMethod.WorkWeiTuoUserList(this.TextBox5.Text.Trim()));
        }
        else if (XStateNowStr == "正常结束")
        {
            SendMainAndSms.SendMessage(CHKSMS, CHKMOB, "您的工作已经正常结束!(" + this.Label1.Text + ")", XMyModel.UserName);
        }
        else
        {
            SendMainAndSms.SendMessage(CHKSMS, CHKMOB, "您的工作已经被强制结束!(" + this.Label1.Text + ")", XMyModel.UserName);
        }

        //Andy 20130925 添加委托人审批记录
        string[] UserArray = this.TextBox5.Text.Trim().Split(',');
        for (int i = 0; i < UserArray.Length; i++)
        {
            if (UserArray[i].ToString().Trim().Length > 0)
            {
                string WeiTuoUser = ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 ToUser from ERPNWorkFlowWT where FromUser='******'");
                if (WeiTuoUser.Trim().Length > 0)
                {
                    ZWL.DBUtility.DbHelperSQL.ExecuteSQL("insert into ERPNWorkFlowWTLog(FromUser,ToUser,ToDoid,InTime) values('" + UserArray[i].ToString() + "','" + WeiTuoUser.Trim() + "'," + int.Parse(Request.QueryString["ID"].ToString()) + ",'" + DateTime.Now.ToString() + "')");
                }
            }
        }

        //写系统日志
        ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
        MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyRiZhi.DoSomething = "用户办理工作(" + this.Label1.Text + ")";
        MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
        MyRiZhi.Add();

        ZWL.Common.MessageBox.ShowAndRedirect(this, "工作办理成功!", "NowWorkFlow.aspx");
    }
Beispiel #11
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        ZWL.BLL.ERPNWorkToDo Model = new ZWL.BLL.ERPNWorkToDo();
        Model.WorkName     = this.txtWorkName.Text.Trim();
        Model.WenHao       = this.txtWenHao.Text.Trim();
        Model.FormID       = int.Parse(Request.QueryString["FormID"].ToString());
        Model.WorkFlowID   = int.Parse(Request.QueryString["WorkFlowID"].ToString());
        Model.UserName     = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        Model.TimeStr      = DateTime.Now;
        Model.FormContent  = this.TextBox3.Text;
        Model.FuJianList   = ZWL.Common.PublicMethod.GetSessionValue("WenJianList");
        Model.ShenPiYiJian = "";
        try
        {
            #region 添加默认审批人检查 Andy 20130925

            //根据选择的节点,绑定人员等信息。
            ZWL.BLL.ERPNWorkFlowNode MyJieDian = new ZWL.BLL.ERPNWorkFlowNode();
            MyJieDian.GetModel(int.Parse(this.DropDownList3.SelectedItem.Value.ToString()));

            if (MyJieDian.SPType == "从默认审批人中选择")
            {
                if (!String.IsNullOrEmpty(MyJieDian.SPDefaultList))
                {
                    ArrayList CurrentSP = new ArrayList(this.TextBox5.Text.Trim().Split(','));
                    ArrayList SPDefault = new ArrayList(MyJieDian.SPDefaultList.Split(','));

                    foreach (string sp in CurrentSP)
                    {
                        if (!SPDefault.Contains(sp))
                        {
                            ZWL.Common.MessageBox.Show(this, "请从默认审批人中选择,默认审批人:" + MyJieDian.SPDefaultList + " !");
                            return;
                        }
                    }
                }
            }
            else if (MyJieDian.SPType == "从默认审批部门中选择")
            {
                string   SqlWhere   = "";
                string[] DefultList = MyJieDian.SPDefaultList.Split(',');
                for (int i = 0; i < DefultList.Length; i++)
                {
                    if (SqlWhere.Trim().Length > 0)
                    {
                        SqlWhere = SqlWhere + " or  " + " ','+Department+',' like '%," + DefultList[i].ToString() + ",%' ";
                    }
                    else
                    {
                        SqlWhere = " ','+Department+',' like '%," + DefultList[i].ToString() + ",%' ";
                    }
                }

                string SPDefaultStr = ZWL.DBUtility.DbHelperSQL.GetStringList("select UserName from ERPUser where " + SqlWhere).Replace("|", ",");

                if (!String.IsNullOrEmpty(SPDefaultStr))
                {
                    ArrayList CurrentSP = new ArrayList(this.TextBox5.Text.Trim().Split(','));
                    ArrayList SPDefault = new ArrayList(SPDefaultStr.Split(','));

                    foreach (string sp in CurrentSP)
                    {
                        if (!SPDefault.Contains(sp))
                        {
                            ZWL.Common.MessageBox.Show(this, "请从默认审批部门中选择,默认审批部门:" + MyJieDian.SPDefaultList + " !");
                            return;
                        }
                    }
                }
            }
            else if (MyJieDian.SPType == "从默认审批角色中选择")
            {
                string   SqlWhere   = "";
                string[] DefultList = MyJieDian.SPDefaultList.Split(',');
                for (int i = 0; i < DefultList.Length; i++)
                {
                    if (SqlWhere.Trim().Length > 0)
                    {
                        SqlWhere = SqlWhere + " or  " + " ','+JiaoSe+',' like '%," + DefultList[i].ToString() + ",%' ";
                    }
                    else
                    {
                        SqlWhere = " ','+JiaoSe+',' like '%," + DefultList[i].ToString() + ",%' ";
                    }
                }

                string SPDefaultStr = ZWL.DBUtility.DbHelperSQL.GetStringList("select UserName from ERPUser where " + SqlWhere).Replace("|", ",");

                if (!String.IsNullOrEmpty(SPDefaultStr))
                {
                    ArrayList CurrentSP = new ArrayList(this.TextBox5.Text.Trim().Split(','));
                    ArrayList SPDefault = new ArrayList(SPDefaultStr.Split(','));

                    foreach (string sp in CurrentSP)
                    {
                        if (!SPDefault.Contains(sp))
                        {
                            ZWL.Common.MessageBox.Show(this, "请从默认审批角色中选择,默认审批角色:" + MyJieDian.SPDefaultList + " !");
                            return;
                        }
                    }
                }
            }
            #endregion

            if (CheckBox1.Checked == true)
            {
                //条件未找到或者没有匹配项时,采用选择好的节点
                Model.JieDianID = int.Parse(this.DropDownList3.SelectedValue.ToString());
                try
                {
                    ///////////根据条件获取下一审批节点信息
                    Model.JieDianID = CheckCondition(this.DropDownList3.SelectedValue.ToString());
                }
                catch
                {
                    Model.JieDianID = int.Parse(this.DropDownList3.SelectedValue.ToString());
                }
            }
            else
            {
                Model.JieDianID = int.Parse(this.DropDownList3.SelectedValue.ToString());
            }
            Model.JieDianName = ZWL.DBUtility.DbHelperSQL.GetSHSL("select NodeName from ERPNWorkFlowNode where ID=" + Model.JieDianID.ToString());
            Model.StateNow    = "正在办理";
        }
        catch
        {
            Model.JieDianName = "结束";
            Model.StateNow    = "强制结束";
        }
        Model.ShenPiUserList = ZWL.Common.PublicMethod.WorkWeiTuoUserList(this.TextBox5.Text.Trim());
        Model.OKUserList     = "默认";
        Model.LateTime       = DateTime.Now.AddHours(double.Parse(ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 JieShuHours from ERPNWorkFlowNode where ID=" + Model.JieDianID.ToString())));
        int todoid = Model.Add();

        if (Model.StateNow == "正在办理")
        {
            //发送短信
            SendMainAndSms.SendMessage(CHKSMS, CHKMOB, "您有新的工作需要办理!(" + this.txtWorkName.Text + ")", ZWL.Common.PublicMethod.WorkWeiTuoUserList(this.TextBox5.Text.Trim()));
        }
        else
        {
            SendMainAndSms.SendMessage(CHKSMS, CHKMOB, "您的工作已经被强制结束!(" + this.txtWorkName.Text + ")", ZWL.Common.PublicMethod.GetSessionValue("UserName"));
        }

        //Andy 20130925 添加委托人审批记录
        string[] UserArray = this.TextBox5.Text.Trim().Split(',');
        for (int i = 0; i < UserArray.Length; i++)
        {
            if (UserArray[i].ToString().Trim().Length > 0)
            {
                string WeiTuoUser = ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 ToUser from ERPNWorkFlowWT where FromUser='******'");
                if (WeiTuoUser.Trim().Length > 0)
                {
                    ZWL.DBUtility.DbHelperSQL.ExecuteSQL("insert into ERPNWorkFlowWTLog(FromUser,ToUser,ToDoid,InTime) values('" + UserArray[i].ToString() + "','" + WeiTuoUser.Trim() + "'," + todoid + ",'" + DateTime.Now.ToString() + "')");
                }
            }
        }

        //写系统日志
        ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
        MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyRiZhi.DoSomething = "用户添加新工作信息(" + this.txtWorkName.Text + ")";
        MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
        MyRiZhi.Add();

        ZWL.Common.MessageBox.ShowAndRedirect(this, "审批工作添加成功!", "NWorkToDo.aspx?FormID=" + Request.QueryString["FormID"].ToString() + "&WorkFlowID=" + Request.QueryString["WorkFlowID"].ToString());
    }
Beispiel #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //该节点根据传过来的工作的ID信息,查询到使用的工作流、当前节点信息(全部通过往下流转、一个通过往下流转)
        //根据节点信息、该工作的通过人列表信息、审批人列表信息===>该节点是否应该继续往下流转
        //如果要往下流转则显示页面上的下一节点设置信息,否则用程序跳转回待办事项页面。

        //根据Type参数属性,Type为0时为正常下一节点,Type为1时为绑定所有节点供选择。
        if (!Page.IsPostBack)
        {
            ZWL.BLL.ERPNWorkToDo MyModel = new ZWL.BLL.ERPNWorkToDo();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.Label1.Text = MyModel.WorkName;
            this.Label4.Text = MyModel.FormContent.Replace("disabled", "").Replace("hidden", "visible");

            //判断 当前节点信息(全部通过可向下流转、一人通过可向下流转)  该工作的通过人列表信息、审批人列表信息
            string SPMoShi = ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 PSType from ERPNWorkFlowNode where ID=" + MyModel.JieDianID.ToString());
            if (CheCkIfOk(MyModel.OKUserList, MyModel.ShenPiUserList, SPMoShi) == true)
            {
                //绑定下一个节点
                try
                {
                    //绑定下一节点  正常状态
                    if (Request.QueryString["Type"].ToString().Trim() == "0")
                    {
                        //绑定下一节点
                        string[] NextStrList = ZWL.DBUtility.DbHelperSQL.GetSHSL("select NextNode from ERPNWorkFlowNode where ID=" + MyModel.JieDianID.ToString()).Split(',');
                        for (int i = 0; i < NextStrList.Length; i++)
                        {
                            ListItem MyItem = new ListItem();
                            MyItem.Value = ZWL.DBUtility.DbHelperSQL.GetSHSL("select ID from ERPNWorkFlowNode where NodeSerils='" + NextStrList[i].ToString() + "' and WorkFlowID=" + MyModel.WorkFlowID.ToString());//根据序号和workflowID获得节点ID
                            MyItem.Text = "节点序号:" + NextStrList[i].ToString() + "--节点名称:" + ZWL.DBUtility.DbHelperSQL.GetSHSL("select NodeName from ERPNWorkFlowNode where NodeSerils='" + NextStrList[i].ToString() + "' and WorkFlowID=" + MyModel.WorkFlowID.ToString());
                            if (MyItem.Value.ToString().Length > 0)
                            {
                                this.DropDownList3.Items.Add(MyItem);
                            }
                        }
                    }
                    else //绑定所有节点(除开始节点)
                    {
                        //清除根据条件决定下一节点选项
                        this.CheckBox1.Checked = false;
                        this.CheckBox1.Enabled = false;

                        DataSet MyDS = ZWL.DBUtility.DbHelperSQL.GetDataSet("select ID,NodeSerils,NodeName from ERPNWorkFlowNode where WorkFlowID=" + MyModel.WorkFlowID.ToString());
                        for (int jjj = 0; jjj < MyDS.Tables[0].Rows.Count; jjj++)
                        {
                            ListItem MyItem = new ListItem();
                            MyItem.Value = MyDS.Tables[0].Rows[jjj]["ID"].ToString();
                            MyItem.Text = "节点序号:" + MyDS.Tables[0].Rows[jjj]["NodeSerils"].ToString() + "--节点名称:" + MyDS.Tables[0].Rows[jjj]["NodeName"].ToString();
                            if (MyItem.Value.ToString().Length > 0)
                            {
                                this.DropDownList3.Items.Add(MyItem);
                            }
                        }
                    }

                    //根据选择的节点,绑定人员等信息。
                    ZWL.BLL.ERPNWorkFlowNode MyJieDian = new ZWL.BLL.ERPNWorkFlowNode();
                    MyJieDian.GetModel(int.Parse(this.DropDownList3.SelectedItem.Value.ToString()));
                    this.TextBox1.Text = MyJieDian.PSType;
                    this.TextBox2.Text = MyJieDian.SPType;

                    SetPageFromPSStr(MyJieDian.SPType, MyJieDian.SPDefaultList);
                }
                catch
                { }
            }
            else
            {
                ZWL.Common.MessageBox.ShowAndRedirect(this, "该节点工作需要等待其他人全部办理后才能继续往下流转,请继续等待!", "NowWorkFlow.aspx");
            }

            //~~~~~~~~~~~~~~~~~当前节点为空!并且下一节点的下拉框也为空!······直接进行提交操作!
            if (this.DropDownList3.Items.Count <= 0 && ZWL.DBUtility.DbHelperSQL.GetSHSL("select NodeAddr from ERPNWorkFlowNode where ID=" + MyModel.JieDianID.ToString()) == "结束")
            {
                ZWL.Common.MessageBox.ResponseScript(this, "document.getElementById('ImageButton1').click();");
            }
            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        }
    }
Beispiel #13
0
    protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            //根据选择的节点,绑定人员等信息。
            ZWL.BLL.ERPNWorkFlowNode MyJieDian = new ZWL.BLL.ERPNWorkFlowNode();
            MyJieDian.GetModel(int.Parse(this.DropDownList3.SelectedItem.Value.ToString()));
            this.TextBox1.Text = MyJieDian.PSType;
            this.TextBox2.Text = MyJieDian.SPType;

            SetPageFromPSStr(MyJieDian.SPType, MyJieDian.SPDefaultList);
        }
        catch
        { }
    }