Beispiel #1
0
    protected void SetViewState(string businessCode, string businessClass, System.Guid recordID, string projectCode, string userCode)
    {
        string[]  array     = new string[3];
        DataTable dataTable = FlowTemplateAction.QueryTemplateByClass(businessClass, businessCode, userCode);
        int       count     = dataTable.Rows.Count;

        if (count == 1)
        {
            int num             = System.Convert.ToInt32(dataTable.Rows[0]["TemplateID"].ToString());
            int posPositionNode = FlowChartAction.GetPosPositionNode(0, num);
            if (posPositionNode > 1)
            {
                array = FlowAuditAction.SelectOffSet(num, "0", 0, businessClass, recordID);
                if (array[2].ToString() != "0")
                {
                    this.TemplateCount = count;
                }
                if (this.TemplateCount == 1)
                {
                    this.OffsetCount = posPositionNode;
                    this.NodeID      = System.Convert.ToInt32(array[0]);
                    return;
                }
            }
            else
            {
                if (posPositionNode == 1)
                {
                    DataTable dataTable2 = FlowTemplateAction.QueryOffsetNodeFirst("0", num);
                    this.TemplateCount = count;
                    string a      = dataTable2.Rows[0]["IsSelReceiver"].ToString();
                    int    nodeID = System.Convert.ToInt32(dataTable2.Rows[0]["NodeID"].ToString());
                    if (a != "0")
                    {
                        this.NodeID = nodeID;
                        return;
                    }
                }
            }
        }
        else
        {
            if (count > 1)
            {
                this.TemplateCount = count;
            }
        }
    }
Beispiel #2
0
    protected void ImgDelete_Click(object sender, ImageClickEventArgs e)
    {
        string text  = this.hdnNodeID.Value.Trim();
        string text2 = this.hdnPos.Value.Trim();

        if (text != "" && text != null)
        {
            int nodeID          = System.Convert.ToInt32(text);
            int num             = text2.IndexOf(",");
            int xpos            = System.Convert.ToInt32(text2.Substring(0, num));
            int ypos            = System.Convert.ToInt32(text2.Substring(num + 1, text2.Length - num - 1));
            int posPositionNode = FlowChartAction.GetPosPositionNode(nodeID, this.TemplateID);
            if (posPositionNode > 1)
            {
                this.JS.Text = "alert('此节点不能删除!');";
            }
            else
            {
                if ((posPositionNode == 1 || posPositionNode == 0) && !FlowChartAction.DelNode(xpos, ypos, nodeID, this.TemplateID))
                {
                    this.JS.Text = "alert('节点删除失败!');";
                }
            }
        }
        this.hdnNodeID.Value = "";
        string.Concat(new string[]
        {
            "TemplateList.aspx?ti=",
            this.businessCode.ToString(),
            "&class=",
            this.BusinessClass.ToString(),
            "&flg=",
            this.IsGeneral
        });
        this.fmNavigation.Attributes["src"] = "WorkFlowChart.aspx?tid=" + this.TemplateID.ToString();
    }