コード例 #1
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>
        ///IList-IDAOIdentityUserClaim.
        ///</returns>
        ///<parameters>
        ///Int32? userId
        ///</parameters>
        public static IList <IDAOIdentityUserClaim> SelectAllByUserId(Int32?userId)
        {
            Doing(null);
            SqlCommand command = new SqlCommand();

            command.CommandText = InlineProcs.ctprIdentityUserClaim_SelectAllByUserId;
            command.CommandType = CommandType.Text;
            SqlConnection staticConnection = StaticSqlConnection;

            command.Connection = staticConnection;

            DataTable      dt         = new DataTable("IdentityUserClaim");
            SqlDataAdapter sqlAdapter = new SqlDataAdapter(command);

            try
            {
                command.Parameters.Add(CtSqlParameter.Get("@UserId", SqlDbType.Int, 4, 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"]) ? (Int32?)null : (Int32?)row["Id"];
                        retObj._userId     = Convert.IsDBNull(row["UserId"]) ? (Int32?)null : (Int32?)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"]) ? (Int32?)null : (Int32?)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 filter criteria
        ///This method returns all data rows in the table using criteriaquery api IdentityUserClaim
        ///</Summary>
        ///<returns>
        ///IList-IDAOIdentityUserClaim.
        ///</returns>
        ///<parameters>
        ///IList<IDataCriterion> listCriterion, IList<IDataOrderBy> listOrder, IDataSkip dataSkip, IDataTake dataTake
        ///</parameters>
        public static IList <IDAOIdentityUserClaim> SelectAllByCriteria(IList <IDataCriterion> listCriterion, IList <IDataOrderBy> listOrder, IDataSkip dataSkip, IDataTake dataTake)
        {
            Doing(null);
            SqlCommand command = new SqlCommand();

            command.CommandText = GetSelectionCriteria(InlineProcs.ctprIdentityUserClaim_SelectAllByCriteria, null, listCriterion, listOrder, dataSkip, dataTake);
            command.CommandType = CommandType.Text;
            SqlConnection staticConnection = StaticSqlConnection;

            command.Connection = staticConnection;

            DataTable      dt         = new DataTable("IdentityUserClaim");
            SqlDataAdapter sqlAdapter = new SqlDataAdapter(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"]) ? (Int32?)null : (Int32?)row["Id"];
                        retObj._userId     = Convert.IsDBNull(row["UserId"]) ? (Int32?)null : (Int32?)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"]) ? (Int32?)null : (Int32?)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 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>
        ///Int32? ıd
        ///</parameters>
        public static IDAOIdentityUserClaim SelectOne(Int32?ıd)
        {
            Doing(null);
            SqlCommand command = new SqlCommand();

            command.CommandText = InlineProcs.ctprIdentityUserClaim_SelectOne;
            command.CommandType = CommandType.Text;
            SqlConnection staticConnection = StaticSqlConnection;

            command.Connection = staticConnection;

            DataTable      dt         = new DataTable("IdentityUserClaim");
            SqlDataAdapter sqlAdapter = new SqlDataAdapter(command);

            try
            {
                command.Parameters.Add(CtSqlParameter.Get("@Id", SqlDbType.Int, 4, 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"]) ? (Int32?)null : (Int32?)dt.Rows[0]["Id"];
                    retObj._userId     = Convert.IsDBNull(dt.Rows[0]["UserId"]) ? (Int32?)null : (Int32?)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"]) ? (Int32?)null : (Int32?)dt.Rows[0]["ctr_version"];
                }
                return(retObj);
            }
            catch (Exception ex)
            {
                Failed(null, ex);
                Handle(null, ex);
                return(null);
            }
            finally
            {
                staticConnection.Close();
                command.Dispose();
            }
        }