예제 #1
0
        ///<Summary>
        ///Select all rows by filter criteria
        ///This method returns all data rows in the table using criteriaquery api identityuserclaim
        ///</Summary>
        ///<returns>
        ///List-IDAOIdentityuserclaim.
        ///</returns>
        ///<parameters>
        ///IList<IDataCriterion> listCriterion, IList<IDataOrderBy> listOrder, IDataSkip dataSkip, IDataTake dataTake
        ///</parameters>
        public static List <IDAOIdentityuserclaim> SelectAllByCriteria(IList <IDataCriterion> listCriterion, IList <IDataOrderBy> listOrder, IDataSkip dataSkip, IDataTake dataTake)
        {
            Doing(null);
            MySqlCommand command = new MySqlCommand();

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

            command.Connection = staticConnection;

            DataTable        dt         = new DataTable("identityuserclaim");
            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 <IDAOIdentityuserclaim> objList = new List <IDAOIdentityuserclaim>();
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        DAOIdentityuserclaim retObj = new DAOIdentityuserclaim();
                        retObj._ıd         = Convert.IsDBNull(row["Id"]) ? null : (string)row["Id"];
                        retObj._userId     = Convert.IsDBNull(row["UserId"]) ? null : (string)row["UserId"];
                        retObj._claimType  = Convert.IsDBNull(row["ClaimType"]) ? null : (string)row["ClaimType"];
                        retObj._claimValue = Convert.IsDBNull(row["ClaimValue"]) ? null : (string)row["ClaimValue"];
                        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();
            }
        }
예제 #2
0
        ///<Summary>
        ///Select all rows by foreign key
        ///This method returns all data rows in the table identityuserclaim based on a foreign key
        ///</Summary>
        ///<returns>
        ///List-IDAOIdentityuserclaim.
        ///</returns>
        ///<parameters>
        ///string userId
        ///</parameters>
        public static List <IDAOIdentityuserclaim> SelectAllByUserId(string userId)
        {
            Doing(null);
            MySqlCommand command = new MySqlCommand();

            command.CommandText = "ctpr_identityuserclaim_getbyuserıd";
            command.CommandType = CommandType.StoredProcedure;
            MySqlConnection staticConnection = StaticSqlConnection;

            command.Connection = staticConnection;

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

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

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


                List <IDAOIdentityuserclaim> objList = new List <IDAOIdentityuserclaim>();
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        DAOIdentityuserclaim retObj = new DAOIdentityuserclaim();
                        retObj._ıd         = Convert.IsDBNull(row["Id"]) ? null : (string)row["Id"];
                        retObj._userId     = Convert.IsDBNull(row["UserId"]) ? null : (string)row["UserId"];
                        retObj._claimType  = Convert.IsDBNull(row["ClaimType"]) ? null : (string)row["ClaimType"];
                        retObj._claimValue = Convert.IsDBNull(row["ClaimValue"]) ? null : (string)row["ClaimValue"];
                        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();
            }
        }
예제 #3
0
        ///<Summary>
        ///Select all rows
        ///This method returns all data rows in the table identityuserclaim
        ///</Summary>
        ///<returns>
        ///List-IDAOIdentityuserclaim.
        ///</returns>
        ///<parameters>
        ///
        ///</parameters>
        public static List <IDAOIdentityuserclaim> SelectAll()
        {
            Doing(null);
            MySqlCommand command = new MySqlCommand();

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

            command.Connection = staticConnection;

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

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


                List <IDAOIdentityuserclaim> objList = new List <IDAOIdentityuserclaim>();
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        DAOIdentityuserclaim retObj = new DAOIdentityuserclaim();
                        retObj._ıd         = Convert.IsDBNull(row["Id"]) ? null : (string)row["Id"];
                        retObj._userId     = Convert.IsDBNull(row["UserId"]) ? null : (string)row["UserId"];
                        retObj._claimType  = Convert.IsDBNull(row["ClaimType"]) ? null : (string)row["ClaimType"];
                        retObj._claimValue = Convert.IsDBNull(row["ClaimValue"]) ? null : (string)row["ClaimValue"];
                        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();
            }
        }
예제 #4
0
        ///<Summary>
        ///Select one row by primary key(s)
        ///This method returns one row from the table identityuserclaim based on the primary key(s)
        ///</Summary>
        ///<returns>
        ///IDAOIdentityuserclaim
        ///</returns>
        ///<parameters>
        ///string ıd
        ///</parameters>
        public static IDAOIdentityuserclaim SelectOne(string ıd)
        {
            Doing(null);
            MySqlCommand command = new MySqlCommand();

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

            command.Connection = staticConnection;

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

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

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


                DAOIdentityuserclaim retObj = null;
                if (dt.Rows.Count > 0)
                {
                    retObj             = new DAOIdentityuserclaim();
                    retObj._ıd         = Convert.IsDBNull(dt.Rows[0]["Id"]) ? null : (string)dt.Rows[0]["Id"];
                    retObj._userId     = Convert.IsDBNull(dt.Rows[0]["UserId"]) ? null : (string)dt.Rows[0]["UserId"];
                    retObj._claimType  = Convert.IsDBNull(dt.Rows[0]["ClaimType"]) ? null : (string)dt.Rows[0]["ClaimType"];
                    retObj._claimValue = Convert.IsDBNull(dt.Rows[0]["ClaimValue"]) ? null : (string)dt.Rows[0]["ClaimValue"];
                    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();
            }
        }