///<Summary> ///Select all rows by filter criteria ///This method returns all data rows in the table using criteriaquery api employee_privileges ///</Summary> ///<returns> ///List-IDAOEmployeePrivileges. ///</returns> ///<parameters> ///IList<IDataCriterion> listCriterion, IList<IDataOrderBy> listOrder, IDataSkip dataSkip, IDataTake dataTake ///</parameters> public static List <IDAOEmployeePrivileges> SelectAllByCriteria(IList <IDataCriterion> listCriterion, IList <IDataOrderBy> listOrder, IDataSkip dataSkip, IDataTake dataTake) { Doing(null); MySqlCommand command = new MySqlCommand(); command.CommandText = "ctpr_employee_privileges_getbycriteria"; command.CommandType = CommandType.StoredProcedure; MySqlConnection staticConnection = StaticSqlConnection; command.Connection = staticConnection; DataTable dt = new DataTable("employee_privileges"); 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 <IDAOEmployeePrivileges> objList = new List <IDAOEmployeePrivileges>(); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { DAOEmployeePrivileges retObj = new DAOEmployeePrivileges(); retObj._employeeİd = Convert.IsDBNull(row["employee_id"]) ? null : (string)row["employee_id"]; retObj._privilegeİd = Convert.IsDBNull(row["privilege_id"]) ? null : (string)row["privilege_id"]; 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 by foreign key ///This method returns all data rows in the table employee_privileges based on a foreign key ///</Summary> ///<returns> ///List-IDAOEmployeePrivileges. ///</returns> ///<parameters> ///string privilegeİd ///</parameters> public static List <IDAOEmployeePrivileges> SelectAllByPrivilegeİd(string privilegeİd) { Doing(null); MySqlCommand command = new MySqlCommand(); command.CommandText = "ctpr_employee_privileges_getbyprivilegeid"; command.CommandType = CommandType.StoredProcedure; MySqlConnection staticConnection = StaticSqlConnection; command.Connection = staticConnection; DataTable dt = new DataTable("employee_privileges"); MySqlDataAdapter sqlAdapter = new MySqlDataAdapter(command); try { command.Parameters.Add(new MySqlParameter("?P_PRİVİLEGE_İD", MySqlDbType.VarChar, 0, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, (object)privilegeİd ?? (object)DBNull.Value)); staticConnection.Open(); sqlAdapter.Fill(dt); Done(null); List <IDAOEmployeePrivileges> objList = new List <IDAOEmployeePrivileges>(); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { DAOEmployeePrivileges retObj = new DAOEmployeePrivileges(); retObj._employeeİd = Convert.IsDBNull(row["employee_id"]) ? null : (string)row["employee_id"]; retObj._privilegeİd = Convert.IsDBNull(row["privilege_id"]) ? null : (string)row["privilege_id"]; 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 employee_privileges ///</Summary> ///<returns> ///List-IDAOEmployeePrivileges. ///</returns> ///<parameters> /// ///</parameters> public static List <IDAOEmployeePrivileges> SelectAll() { Doing(null); MySqlCommand command = new MySqlCommand(); command.CommandText = "ctpr_employee_privileges_getall"; command.CommandType = CommandType.StoredProcedure; MySqlConnection staticConnection = StaticSqlConnection; command.Connection = staticConnection; DataTable dt = new DataTable("employee_privileges"); MySqlDataAdapter sqlAdapter = new MySqlDataAdapter(command); try { staticConnection.Open(); sqlAdapter.Fill(dt); Done(null); List <IDAOEmployeePrivileges> objList = new List <IDAOEmployeePrivileges>(); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { DAOEmployeePrivileges retObj = new DAOEmployeePrivileges(); retObj._employeeİd = Convert.IsDBNull(row["employee_id"]) ? null : (string)row["employee_id"]; retObj._privilegeİd = Convert.IsDBNull(row["privilege_id"]) ? null : (string)row["privilege_id"]; objList.Add(retObj); } } return(objList); } catch (Exception ex) { Failed(null, ex); Handle(null, ex); return(null); } finally { staticConnection.Close(); command.Dispose(); } }