Esempio n. 1
0
        internal ActionResult SaveRole(RoleMTRModel model, string accountID)
        {
            return(DoSecurity <ActionResult, string>((result, sqlConn) =>
            {
                var cmd = sqlConn.CreateCommand();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "cuRoleMTR_C2018";
                if (string.IsNullOrEmpty(model.ID) == false)
                {
                    cmd.Parameters.Add(GetSqlParameter("ID", model.ID));
                }

                cmd.Parameters.Add(GetSqlParameter("RoleName", model.Name));

                cmd.Parameters.Add(GetSqlParameter("LastUpdateUserID", accountID));
                cmd.Parameters.Add(GetSqlParameter("Effectiveness", model.Effectiveness));
                cmd.Parameters.Add(new SqlParameter("RoleModuleTable", toTable(model.Modules)));
                cmd.Parameters.Add(new SqlParameter("RoleRightTable", toTable(model.Rights)));

                cmd.ExecuteNonQuery();

                result.Pass();
            }));
        }
Esempio n. 2
0
 public ActionResult SaveRole(RoleMTRModel model, string accountID)
 {
     return(dal.SaveRole(model, accountID));
 }