public T ExecuteReturnLastId <T>(Ms.Data.IDbCommand command, string identityColumnName = null)
        {
            T lastId;

            if (0 == 0)
            {
                lastId = default(T);
            }
            command.Data.x876bc5bb5331d9cc.xa266202b32508032(false, delegate {
                lastId = this.x520945fbc2e8bb0a <T>(command, null);
            });
            return(lastId);
        }
        public void OnCommandExecuting(Ms.Data.IDbCommand command)
        {
            bool flag = command.Data.InnerCommand.CommandType != CommandType.Text;

            while (!flag)
            {
                dynamic innerCommand = command.Data.InnerCommand;
                innerCommand.BindByName = true;
                if (-1 != 0)
                {
                    break;
                }
            }
        }
        public T ExecuteReturnLastId <T>(Ms.Data.IDbCommand command, string identityColumnName = null)
        {
            System.Data.IDbCommand command1;
            T    local;
            bool flag;
            T    lastId;

            if (0 == 0)
            {
                flag = command.Data.InnerCommand.CommandText[command.Data.InnerCommand.CommandText.Length - 1] == ';';
                if ((((uint)flag) <= uint.MaxValue) && flag)
                {
                    if ((((uint)flag) + ((uint)flag)) <= uint.MaxValue)
                    {
                        goto Label_0062;
                    }
                    goto Label_0026;
                }
                System.Data.IDbCommand innerCommand = command.Data.InnerCommand;
                innerCommand.CommandText = innerCommand.CommandText + ';';
                if (0 != 0)
                {
                    return(local);
                }
                goto Label_0062;
            }
Label_000C:
            if (((uint)flag) > uint.MaxValue)
            {
                goto Label_0062;
            }
            return(local);

Label_0026:
            lastId = default(T);
            command.Data.x876bc5bb5331d9cc.xa266202b32508032(false, delegate {
                object obj2 = command.Data.InnerCommand.ExecuteScalar();
                if (obj2.GetType() == typeof(T))
                {
                    lastId = (T)obj2;
                }
                lastId = (T)Convert.ChangeType(obj2, typeof(T));
            });
            local = lastId;
            goto Label_000C;
Label_0062:
            command1             = command.Data.InnerCommand;
            command1.CommandText = command1.CommandText + "select LAST_INSERT_ID() as `LastInsertedId`";
            goto Label_0026;
        }
Ejemplo n.º 4
0
        private T x520945fbc2e8bb0a <T>(Ms.Data.IDbCommand xfd6dd6e53b1a26d5, string xaaf21d32e46e8fc5 = null)
        {
            T      local;
            object obj2;
            T      local2;
            bool   flag;
            int    num = xfd6dd6e53b1a26d5.Data.InnerCommand.ExecuteNonQuery();

            if ((((uint)flag) - ((uint)num)) >= 0)
            {
                goto Label_00B7;
            }
            goto Label_0082;
Label_006C:
            local2 = local;
            if (((uint)flag) <= uint.MaxValue)
            {
                if ((((uint)num) & 0) == 0)
                {
                    if ((((uint)num) & 0) == 0)
                    {
                        return(local2);
                    }
                    goto Label_00B7;
                }
                goto Label_00A3;
            }
            return(local2);

Label_0082:
            if (num > 0)
            {
                xfd6dd6e53b1a26d5.Data.InnerCommand.CommandText = "select cast(@@identity as int)";
            }
            else
            {
                goto Label_006C;
            }
Label_00A3:
            obj2  = xfd6dd6e53b1a26d5.Data.InnerCommand.ExecuteScalar();
            local = (T)obj2;
            goto Label_006C;
Label_00B7:
            local = default(T);
            goto Label_0082;
        }
        private T x520945fbc2e8bb0a <T>(Ms.Data.IDbCommand xfd6dd6e53b1a26d5, string xaaf21d32e46e8fc5 = null)
        {
            T    local;
            bool flag;
            int  num = xfd6dd6e53b1a26d5.Data.InnerCommand.ExecuteNonQuery();

            if ((((uint)num) - ((uint)flag)) > uint.MaxValue)
            {
                return(local);
            }
            local = default(T);
            if (num <= 0)
            {
                return(local);
            }
            xfd6dd6e53b1a26d5.Data.InnerCommand.CommandText = "select @@Identity";
            return((T)xfd6dd6e53b1a26d5.Data.InnerCommand.ExecuteScalar());
        }
        public T ExecuteReturnLastId <T>(Ms.Data.IDbCommand command, string identityColumnName = null)
        {
            T lastId;

            if (0 == 0)
            {
                if (0x7fffffff == 0)
                {
                    return(lastId);
                }
                command.ParameterOut("Ms_Data_LastId", command.Data.Context.Data.Provider.GetDbTypeForClrType(typeof(T)), 0);
            }
            command.Sql(" returning " + identityColumnName + " into :Ms_Data_LastId");
            lastId = default(T);
            command.Data.x876bc5bb5331d9cc.xa266202b32508032(false, delegate {
                command.Data.InnerCommand.ExecuteNonQuery();
                lastId = command.ParameterValue <T>("Ms_Data_LastId");
            });
            return(lastId);
        }
        public T ExecuteReturnLastId <T>(Ms.Data.IDbCommand command, string identityColumnName = null)
        {
            T lastId;

            if (command.Data.InnerCommand.CommandText[command.Data.InnerCommand.CommandText.Length - 1] != ';')
            {
                System.Data.IDbCommand innerCommand = command.Data.InnerCommand;
                innerCommand.CommandText = innerCommand.CommandText + ';';
            }
            while (true)
            {
                bool flag;
                System.Data.IDbCommand command1 = command.Data.InnerCommand;
                command1.CommandText = command1.CommandText + "select lastval();";
                lastId = default(T);
                command.Data.x876bc5bb5331d9cc.xa266202b32508032(false, delegate {
                    object obj2 = command.Data.InnerCommand.ExecuteScalar();
                    bool flag   = !(obj2.GetType() == typeof(T));
                    while (true)
                    {
                        while (!flag)
                        {
                            lastId = (T)obj2;
                            break;
                        }
                        lastId = (T)Convert.ChangeType(obj2, typeof(T));
                        if (15 != 0)
                        {
                            return;
                        }
                    }
                });
                T local = lastId;
                if ((((uint)flag) - ((uint)flag)) >= 0)
                {
                    return(local);
                }
            }
        }
Ejemplo n.º 8
0
        public T ExecuteReturnLastId <T>(Ms.Data.IDbCommand command, string identityColumnName = null)
        {
            T    lastId;
            bool flag = command.Data.InnerCommand.CommandText[command.Data.InnerCommand.CommandText.Length - 1] == ';';

Label_0049:
            if (!flag)
            {
                System.Data.IDbCommand command2 = command.Data.InnerCommand;
                command2.CommandText = command2.CommandText + ';';
                if ((((uint)flag) + ((uint)flag)) > uint.MaxValue)
                {
                    goto Label_000B;
                }
                if (((uint)flag) < 0)
                {
                    goto Label_0049;
                }
            }
            System.Data.IDbCommand innerCommand = command.Data.InnerCommand;
            innerCommand.CommandText = innerCommand.CommandText + "select SCOPE_IDENTITY()";
Label_000B:
            lastId = default(T);
            command.Data.x876bc5bb5331d9cc.xa266202b32508032(false, delegate {
                bool flag;
                object obj2 = command.Data.InnerCommand.ExecuteScalar();
                if (((uint)flag) >= 0)
                {
                    flag = !(obj2.GetType() == typeof(T));
                }
                if (!flag)
                {
                    lastId = (T)obj2;
                }
                lastId = (T)Convert.ChangeType(obj2, typeof(T));
            });
            return(lastId);
        }
        public T ExecuteReturnLastId <T>(Ms.Data.IDbCommand command, string identityColumnName = null)
        {
            if (command.Data.InnerCommand.CommandText[command.Data.InnerCommand.CommandText.Length - 1] != ';')
            {
                System.Data.IDbCommand command1 = command.Data.InnerCommand;
                command1.CommandText = command1.CommandText + ';';
            }
            System.Data.IDbCommand innerCommand = command.Data.InnerCommand;
            innerCommand.CommandText = innerCommand.CommandText + "select IDENTITY_VAL_LOCAL() as LastId from sysibm.sysdummy1;";
            T lastId = default(T);

            command.Data.x876bc5bb5331d9cc.xa266202b32508032(false, delegate {
                object obj2 = command.Data.InnerCommand.ExecuteScalar();
                while (true)
                {
                    bool flag = !(obj2.GetType() == typeof(T));
                    do
                    {
                        while (!flag)
                        {
                            lastId = (T)obj2;
                            if ((((uint)flag) - ((uint)flag)) >= 0)
                            {
                                break;
                            }
                        }
                    }while ((((uint)flag) + ((uint)flag)) > uint.MaxValue);
                    lastId = (T)Convert.ChangeType(obj2, typeof(T));
                    if ((((uint)flag) - ((uint)flag)) <= uint.MaxValue)
                    {
                        return;
                    }
                }
            });
            return(lastId);
        }
 public void OnCommandExecuting(Ms.Data.IDbCommand command)
 {
 }
Ejemplo n.º 11
0
        public T ExecuteReturnLastId <T>(Ms.Data.IDbCommand command, string identityColumnName = null)
        {
            System.Data.IDbCommand command1;
            bool flag;

            if ((((uint)flag) | 0x80000000) == 0)
            {
                goto Label_00BF;
            }
            flag = command.Data.InnerCommand.CommandText[command.Data.InnerCommand.CommandText.Length - 1] == ';';
Label_0010:
            if (!flag)
            {
                System.Data.IDbCommand innerCommand = command.Data.InnerCommand;
                innerCommand.CommandText = innerCommand.CommandText + ';';
                goto Label_00BF;
            }
Label_0016:
            command1             = command.Data.InnerCommand;
            command1.CommandText = command1.CommandText + "select last_insert_rowid();";
            T lastId = default(T);

            command.Data.x876bc5bb5331d9cc.xa266202b32508032(false, delegate {
                bool flag;
                object obj2 = command.Data.InnerCommand.ExecuteScalar();
                if ((((uint)flag) - ((uint)flag)) <= uint.MaxValue)
                {
                    goto Label_004F;
                }
                Label_002F:
                if (!flag)
                {
                    goto Label_0080;
                }
                Label_0032:
                lastId = (T)Convert.ChangeType(obj2, typeof(T));
                return;

                Label_004F:
                flag = !(obj2.GetType() == typeof(T));
                if ((((uint)flag) + ((uint)flag)) <= uint.MaxValue)
                {
                    goto Label_002F;
                }
                Label_0080:
                lastId = (T)obj2;
                if (-1 == 0)
                {
                    goto Label_004F;
                }
                goto Label_0032;
            });
            if (((uint)flag) >= 0)
            {
            }
            T local = lastId;

            if (0x7fffffff == 0)
            {
            }
            return(local);

Label_00BF:
            if (-1 != 0)
            {
                goto Label_0016;
            }
            goto Label_0010;
        }