Ejemplo n.º 1
0
        /// *******************************************************************************************
        /// <summary>
        /// 添加角色
        /// </summary>
        /// *******************************************************************************************
        private void SaveRoleData()
        {
            try
            {
                Procedure    procedure  = (Procedure)Session["Procedure"];
                UltraWebGrid UWGridCase = ((UltraWebGrid)this.UltraWebTab1.Tabs.GetTab(2).FindControl("UltraWebGrid3"));

                for (int i = 0; i < UWGridCase.Rows.Count; i++)
                {
                    bool isNew    = (UWGridCase.Rows[i].Cells[0].Text == null);
                    Role RoleCase = null;
                    if (isNew)
                    {
                        RoleCase = Rms.WorkFlow.DefinitionManager.NewRole();
                        RoleCase.ProcedureCode = procedure.ProcedureCode;
                        procedure.AddNewRole(RoleCase);
                    }
                    else
                    {
                        RoleCase = procedure.GetRole(UWGridCase.Rows[i].Cells[0].Text);
                    }

                    RoleCase.RoleName = (string)UWGridCase.Rows[i].Cells[1].Value;

                    if ((bool)UWGridCase.Rows[i].Cells[2].Value)
                    {
                        //RoleCase.ProcedureCode = "";???因为要求在父表中存在子键值所以当前不能使用该模式
                        RoleCase.RoleType = "1";
                    }
                    else
                    {
                        RoleCase.RoleType = "0";
                    }
                    RoleCase.Remak = (string)UWGridCase.Rows[i].Cells[3].Value;
                }
                Session["Procedure"] = procedure;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }