///<Summary> ///Select all rows by filter criteria ///This method returns all data rows in the table using criteriaquery api identityuserprofile ///</Summary> ///<returns> ///List-IDAOIdentityuserprofile. ///</returns> ///<parameters> ///IList<IDataCriterion> listCriterion, IList<IDataOrderBy> listOrder, IDataSkip dataSkip, IDataTake dataTake ///</parameters> public static List <IDAOIdentityuserprofile> SelectAllByCriteria(IList <IDataCriterion> listCriterion, IList <IDataOrderBy> listOrder, IDataSkip dataSkip, IDataTake dataTake) { Doing(null); MySqlCommand command = new MySqlCommand(); command.CommandText = "ctpr_identityuserprofile_getbycriteria"; command.CommandType = CommandType.StoredProcedure; MySqlConnection staticConnection = StaticSqlConnection; command.Connection = staticConnection; DataTable dt = new DataTable("identityuserprofile"); 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 <IDAOIdentityuserprofile> objList = new List <IDAOIdentityuserprofile>(); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { DAOIdentityuserprofile retObj = new DAOIdentityuserprofile(); retObj._userId = Convert.IsDBNull(row["UserId"]) ? null : (string)row["UserId"]; retObj._firstName = Convert.IsDBNull(row["FirstName"]) ? null : (string)row["FirstName"]; retObj._lastName = Convert.IsDBNull(row["LastName"]) ? null : (string)row["LastName"]; retObj._fullName = Convert.IsDBNull(row["FullName"]) ? null : (string)row["FullName"]; 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(); } }
///<Summary> ///Select all rows ///This method returns all data rows in the table identityuserprofile ///</Summary> ///<returns> ///List-IDAOIdentityuserprofile. ///</returns> ///<parameters> /// ///</parameters> public static List <IDAOIdentityuserprofile> SelectAll() { Doing(null); MySqlCommand command = new MySqlCommand(); command.CommandText = "ctpr_identityuserprofile_getall"; command.CommandType = CommandType.StoredProcedure; MySqlConnection staticConnection = StaticSqlConnection; command.Connection = staticConnection; DataTable dt = new DataTable("identityuserprofile"); MySqlDataAdapter sqlAdapter = new MySqlDataAdapter(command); try { staticConnection.Open(); sqlAdapter.Fill(dt); Done(null); List <IDAOIdentityuserprofile> objList = new List <IDAOIdentityuserprofile>(); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { DAOIdentityuserprofile retObj = new DAOIdentityuserprofile(); retObj._userId = Convert.IsDBNull(row["UserId"]) ? null : (string)row["UserId"]; retObj._firstName = Convert.IsDBNull(row["FirstName"]) ? null : (string)row["FirstName"]; retObj._lastName = Convert.IsDBNull(row["LastName"]) ? null : (string)row["LastName"]; retObj._fullName = Convert.IsDBNull(row["FullName"]) ? null : (string)row["FullName"]; 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(); } }
///<Summary> ///Select one row by primary key(s) ///This method returns one row from the table identityuserprofile based on the primary key(s) ///</Summary> ///<returns> ///IDAOIdentityuserprofile ///</returns> ///<parameters> ///string userId ///</parameters> public static IDAOIdentityuserprofile SelectOne(string userId) { Doing(null); MySqlCommand command = new MySqlCommand(); command.CommandText = "ctpr_identityuserprofile_getone"; command.CommandType = CommandType.StoredProcedure; MySqlConnection staticConnection = StaticSqlConnection; command.Connection = staticConnection; DataTable dt = new DataTable("identityuserprofile"); 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); DAOIdentityuserprofile retObj = null; if (dt.Rows.Count > 0) { retObj = new DAOIdentityuserprofile(); retObj._userId = Convert.IsDBNull(dt.Rows[0]["UserId"]) ? null : (string)dt.Rows[0]["UserId"]; retObj._firstName = Convert.IsDBNull(dt.Rows[0]["FirstName"]) ? null : (string)dt.Rows[0]["FirstName"]; retObj._lastName = Convert.IsDBNull(dt.Rows[0]["LastName"]) ? null : (string)dt.Rows[0]["LastName"]; retObj._fullName = Convert.IsDBNull(dt.Rows[0]["FullName"]) ? null : (string)dt.Rows[0]["FullName"]; 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(); } }