Example #1
0
        ///<Summary>
        ///Select all rows
        ///This method returns all data rows in the table identityuser
        ///</Summary>
        ///<returns>
        ///List-IDAOIdentityuser.
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static List <IDAOIdentityuser> SelectAll()
        {
            Doing(null);
            MySqlCommand command = new MySqlCommand();

            command.CommandText = "ctpr_identityuser_getall";
            command.CommandType = CommandType.StoredProcedure;
            MySqlConnection staticConnection = StaticSqlConnection;

            command.Connection = staticConnection;

            DataTable        dt         = new DataTable("identityuser");
            MySqlDataAdapter sqlAdapter = new MySqlDataAdapter(command);

            try
            {
                staticConnection.Open();
                sqlAdapter.Fill(dt);
                Done(null);


                List <IDAOIdentityuser> objList = new List <IDAOIdentityuser>();
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        DAOIdentityuser retObj = new DAOIdentityuser();
                        retObj._userId               = Convert.IsDBNull(row["UserId"]) ? null : (string)row["UserId"];
                        retObj._email                = Convert.IsDBNull(row["Email"]) ? null : (string)row["Email"];
                        retObj._emailConfirmed       = Convert.IsDBNull(row["EmailConfirmed"]) ? null : (string)row["EmailConfirmed"];
                        retObj._passwordHash         = Convert.IsDBNull(row["PasswordHash"]) ? null : (string)row["PasswordHash"];
                        retObj._securityStamp        = Convert.IsDBNull(row["SecurityStamp"]) ? null : (string)row["SecurityStamp"];
                        retObj._phoneNumber          = Convert.IsDBNull(row["PhoneNumber"]) ? null : (string)row["PhoneNumber"];
                        retObj._phoneNumberConfirmed = Convert.IsDBNull(row["PhoneNumberConfirmed"]) ? null : (string)row["PhoneNumberConfirmed"];
                        retObj._twoFactorEnabled     = Convert.IsDBNull(row["TwoFactorEnabled"]) ? null : (string)row["TwoFactorEnabled"];
                        retObj._lockoutEndDateUtc    = Convert.IsDBNull(row["LockoutEndDateUtc"]) ? null : (string)row["LockoutEndDateUtc"];
                        retObj._lockoutEnabled       = Convert.IsDBNull(row["LockoutEnabled"]) ? null : (string)row["LockoutEnabled"];
                        retObj._accessFailedCount    = Convert.IsDBNull(row["AccessFailedCount"]) ? null : (string)row["AccessFailedCount"];
                        retObj._username             = Convert.IsDBNull(row["Username"]) ? null : (string)row["Username"];
                        retObj._ctrVersion           = Convert.IsDBNull(row["ctr_version"]) ? null : (string)row["ctr_version"];
                        objList.Add(retObj);
                    }
                }
                return(objList);
            }
            catch (Exception ex)
            {
                Failed(null, ex);
                Handle(null, ex);
                return(null);
            }
            finally
            {
                staticConnection.Close();
                command.Dispose();
            }
        }
Example #2
0
        ///<Summary>
        ///Select one row by primary key(s)
        ///This method returns one row from the table identityuser based on the primary key(s)
        ///</Summary>
        ///<returns>
        ///IDAOIdentityuser
        ///</returns>
        ///<parameters>
        ///string userId
        ///</parameters>
        public static IDAOIdentityuser SelectOne(string userId)
        {
            Doing(null);
            MySqlCommand command = new MySqlCommand();

            command.CommandText = "ctpr_identityuser_getone";
            command.CommandType = CommandType.StoredProcedure;
            MySqlConnection staticConnection = StaticSqlConnection;

            command.Connection = staticConnection;

            DataTable        dt         = new DataTable("identityuser");
            MySqlDataAdapter sqlAdapter = new MySqlDataAdapter(command);

            try
            {
                command.Parameters.Add(new MySqlParameter("?P_USERID", MySqlDbType.VarChar, 0, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, (object)userId ?? (object)DBNull.Value));

                staticConnection.Open();
                sqlAdapter.Fill(dt);
                Done(null);


                DAOIdentityuser retObj = null;
                if (dt.Rows.Count > 0)
                {
                    retObj                       = new DAOIdentityuser();
                    retObj._userId               = Convert.IsDBNull(dt.Rows[0]["UserId"]) ? null : (string)dt.Rows[0]["UserId"];
                    retObj._email                = Convert.IsDBNull(dt.Rows[0]["Email"]) ? null : (string)dt.Rows[0]["Email"];
                    retObj._emailConfirmed       = Convert.IsDBNull(dt.Rows[0]["EmailConfirmed"]) ? null : (string)dt.Rows[0]["EmailConfirmed"];
                    retObj._passwordHash         = Convert.IsDBNull(dt.Rows[0]["PasswordHash"]) ? null : (string)dt.Rows[0]["PasswordHash"];
                    retObj._securityStamp        = Convert.IsDBNull(dt.Rows[0]["SecurityStamp"]) ? null : (string)dt.Rows[0]["SecurityStamp"];
                    retObj._phoneNumber          = Convert.IsDBNull(dt.Rows[0]["PhoneNumber"]) ? null : (string)dt.Rows[0]["PhoneNumber"];
                    retObj._phoneNumberConfirmed = Convert.IsDBNull(dt.Rows[0]["PhoneNumberConfirmed"]) ? null : (string)dt.Rows[0]["PhoneNumberConfirmed"];
                    retObj._twoFactorEnabled     = Convert.IsDBNull(dt.Rows[0]["TwoFactorEnabled"]) ? null : (string)dt.Rows[0]["TwoFactorEnabled"];
                    retObj._lockoutEndDateUtc    = Convert.IsDBNull(dt.Rows[0]["LockoutEndDateUtc"]) ? null : (string)dt.Rows[0]["LockoutEndDateUtc"];
                    retObj._lockoutEnabled       = Convert.IsDBNull(dt.Rows[0]["LockoutEnabled"]) ? null : (string)dt.Rows[0]["LockoutEnabled"];
                    retObj._accessFailedCount    = Convert.IsDBNull(dt.Rows[0]["AccessFailedCount"]) ? null : (string)dt.Rows[0]["AccessFailedCount"];
                    retObj._username             = Convert.IsDBNull(dt.Rows[0]["Username"]) ? null : (string)dt.Rows[0]["Username"];
                    retObj._ctrVersion           = Convert.IsDBNull(dt.Rows[0]["ctr_version"]) ? null : (string)dt.Rows[0]["ctr_version"];
                }
                return(retObj);
            }
            catch (Exception ex)
            {
                Failed(null, ex);
                Handle(null, ex);
                return(null);
            }
            finally
            {
                staticConnection.Close();
                command.Dispose();
            }
        }
Example #3
0
        ///<Summary>
        ///Select all rows by filter criteria
        ///This method returns all data rows in the table using criteriaquery api identityuser
        ///</Summary>
        ///<returns>
        ///List-IDAOIdentityuser.
        ///</returns>
        ///<parameters>
        ///IList<IDataCriterion> listCriterion, IList<IDataOrderBy> listOrder, IDataSkip dataSkip, IDataTake dataTake
        ///</parameters>
        public static List <IDAOIdentityuser> SelectAllByCriteria(IList <IDataCriterion> listCriterion, IList <IDataOrderBy> listOrder, IDataSkip dataSkip, IDataTake dataTake)
        {
            Doing(null);
            MySqlCommand command = new MySqlCommand();

            command.CommandText = "ctpr_identityuser_getbycriteria";
            command.CommandType = CommandType.StoredProcedure;
            MySqlConnection staticConnection = StaticSqlConnection;

            command.Connection = staticConnection;

            DataTable        dt         = new DataTable("identityuser");
            MySqlDataAdapter sqlAdapter = new MySqlDataAdapter(command);

            try
            {
                string whereClause = GetSelectionCriteria(listCriterion);
                string orderClause = GetSelectionOrder(listOrder);
                string skipClause  = GetSelectionSkip(dataSkip);
                string takeClause  = GetSelectionTake(dataTake);
                command.Parameters.Add(new MySqlParameter("?P_SKİPCLAUSE", MySqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, (object)skipClause ?? (object)DBNull.Value));
                command.Parameters.Add(new MySqlParameter("?P_TAKECLAUSE", MySqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, (object)takeClause ?? (object)DBNull.Value));
                command.Parameters.Add(new MySqlParameter("?P_WHERECLAUSE", MySqlDbType.VarChar, 500, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, (object)whereClause ?? (object)DBNull.Value));
                command.Parameters.Add(new MySqlParameter("?P_ORDERCLAUSE", MySqlDbType.VarChar, 500, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, (object)orderClause ?? (object)DBNull.Value));
                command.Parameters.Add(new MySqlParameter("?P_SKİPCLAUSE", MySqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, (object)skipClause ?? (object)DBNull.Value));
                command.Parameters.Add(new MySqlParameter("?P_TAKECLAUSE", MySqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, (object)takeClause ?? (object)DBNull.Value));

                staticConnection.Open();
                sqlAdapter.Fill(dt);
                Done(null);


                List <IDAOIdentityuser> objList = new List <IDAOIdentityuser>();
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        DAOIdentityuser retObj = new DAOIdentityuser();
                        retObj._userId               = Convert.IsDBNull(row["UserId"]) ? null : (string)row["UserId"];
                        retObj._email                = Convert.IsDBNull(row["Email"]) ? null : (string)row["Email"];
                        retObj._emailConfirmed       = Convert.IsDBNull(row["EmailConfirmed"]) ? null : (string)row["EmailConfirmed"];
                        retObj._passwordHash         = Convert.IsDBNull(row["PasswordHash"]) ? null : (string)row["PasswordHash"];
                        retObj._securityStamp        = Convert.IsDBNull(row["SecurityStamp"]) ? null : (string)row["SecurityStamp"];
                        retObj._phoneNumber          = Convert.IsDBNull(row["PhoneNumber"]) ? null : (string)row["PhoneNumber"];
                        retObj._phoneNumberConfirmed = Convert.IsDBNull(row["PhoneNumberConfirmed"]) ? null : (string)row["PhoneNumberConfirmed"];
                        retObj._twoFactorEnabled     = Convert.IsDBNull(row["TwoFactorEnabled"]) ? null : (string)row["TwoFactorEnabled"];
                        retObj._lockoutEndDateUtc    = Convert.IsDBNull(row["LockoutEndDateUtc"]) ? null : (string)row["LockoutEndDateUtc"];
                        retObj._lockoutEnabled       = Convert.IsDBNull(row["LockoutEnabled"]) ? null : (string)row["LockoutEnabled"];
                        retObj._accessFailedCount    = Convert.IsDBNull(row["AccessFailedCount"]) ? null : (string)row["AccessFailedCount"];
                        retObj._username             = Convert.IsDBNull(row["Username"]) ? null : (string)row["Username"];
                        retObj._ctrVersion           = Convert.IsDBNull(row["ctr_version"]) ? null : (string)row["ctr_version"];
                        objList.Add(retObj);
                    }
                }
                return(objList);
            }
            catch (Exception ex)
            {
                Failed(null, ex);
                Handle(null, ex);
                return(null);
            }
            finally
            {
                staticConnection.Close();
                command.Dispose();
            }
        }