Example #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;
            }
        }
    }