public List <CsModeApplicationTarif> LoadAllModeApplicationTarif() { try { //return TarificationProcedure.LoadAllModeApplicationTarif(); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("MODEAPPLICATIONTARIF"); return(Galatee.Tools.Utility.GetEntityListFromQuery <CsModeApplicationTarif>(dt)); } catch (Exception ex) { throw ex; } }
/* * public DBTDEM() : base() { } * * private SqlConnection cn = null; * * private bool _Transaction; * * public bool Transaction * { * get { return _Transaction; } * set { _Transaction = value; } * * } * * private SqlCommand cmd = null; * * public static List<CsTdem> Fill(IDataReader reader, List<CsTdem> rows, int start, int pageLength) * { * // advance to the starting row * for (int i = 0; i < start; i++) * { * if (!reader.Read()) * return rows; // not enough rows, just return * } * * for (int i = 0; i < pageLength; i++) * { * if (!reader.Read()) * break; // we are done * * CsTdem c = new CsTdem(); * c.Id = (Convert.IsDBNull(reader["Id"])) ? (int)0 : (System.Int32)reader["Id"]; * c.OriginalId = (Convert.IsDBNull(reader["Id"])) ? (int)0 : (System.Int32)reader["Id"]; * c.Libelle = (Convert.IsDBNull(reader["Libelle"])) ? string.Empty : (System.String)reader["Libelle"]; * c.CodeProduit = (Convert.IsDBNull(reader["CodeProduit"])) ? string.Empty : (System.String)reader["CodeProduit"]; * rows.Add(c); * } * return rows; * } * * public static CsTdem GetById(int? id) * { * CsTdem row = new CsTdem(); * * //Jab 06.02.2013 * //string connectString = GalateeConfig.ConnectionStrings[Enumere.Connexion].ConnectionString; * //Objet connection * SqlConnection connection = new SqlConnection(Session.GetSqlConnexionString()); * //Objet Command * //Fin Jab * SqlCommand command = new SqlCommand("spx_TDEM_GetById", connection); * command.CommandType = CommandType.StoredProcedure; * * SqlParameter param = command.Parameters.Add(new SqlParameter("@Id", id)); * param.Direction = ParameterDirection.Input; * * try * { * //Ouverture * connection.Open(); * * //Object datareader * SqlDataReader reader = command.ExecuteReader(); * * List<CsTdem> tmp = new List<CsTdem>(); * Fill(reader, tmp, 0, int.MaxValue); * reader.Close(); * * if (tmp.Count == 1) * { * row = tmp[0]; * } * else if (tmp.Count == 0) * { * row = null; * } * return row; * } * catch (Exception ex) * { * throw new Exception(ex.Message); * } * finally * { * if (connection.State == ConnectionState.Open) * connection.Close(); * command.Dispose(); * * } * } * * public static List<CsTdem> GetByCodeProduit(System.String codeProduit) * { * //Jab 06.02.2013 * //string connectString = GalateeConfig.ConnectionStrings[Enumere.Connexion].ConnectionString; * //Objet connection * SqlConnection connection = new SqlConnection(Session.GetSqlConnexionString()); * //Objet Command * //Fin Jab * //Objet Command * SqlCommand command = new SqlCommand("spx_TDEM_GetByCodeProduit", connection); * command.CommandType = CommandType.StoredProcedure; * * command.Parameters.Add("@CodeProduit", SqlDbType.VarChar, 2).Value = codeProduit; * * try * { * //Ouverture * connection.Open(); * * //Object datareader * SqlDataReader reader = command.ExecuteReader(); * * List<CsTdem> rows = new List<CsTdem>(); * Fill(reader, rows, 0, int.MaxValue); * reader.Close(); * return rows; * } * catch (Exception ex) * { * throw new Exception(ex.Message); * } * finally * { * if (connection.State == ConnectionState.Open) * connection.Close(); * command.Dispose(); * } * } * * public static List<CsTdem> GetAll() * { * //Jab 06.02.2013 * //string connectString = GalateeConfig.ConnectionStrings[Enumere.Connexion].ConnectionString; * //Objet connection * SqlConnection connection = new SqlConnection(Session.GetSqlConnexionString()); * //Objet Command * //Fin Jab * //Objet Command * SqlCommand command = new SqlCommand("SPX_PARAM_TDEM_RETOURNE", connection); * command.CommandType = CommandType.StoredProcedure; * * try * { * //Ouverture * connection.Open(); * * //Object datareader * SqlDataReader reader = command.ExecuteReader(); * * List<CsTdem> rows = new List<CsTdem>(); * Fill(reader, rows, 0, int.MaxValue); * reader.Close(); * return rows; * } * catch (Exception ex) * { * throw new Exception(ex.Message); * } * finally * { * if (connection.State == ConnectionState.Open) * connection.Close(); * command.Dispose(); * } * } * * public bool Delete(CsTdem pTypeDevis) * { * try * { * cn = new SqlConnection(Session.GetSqlConnexionString()); * cmd = new SqlCommand * { * Connection = cn, * CommandType = CommandType.StoredProcedure, * CommandText = "SPX_PARAM_TDEM_SUPPRIMER" * }; * cmd.Parameters.Clear(); * cmd.Parameters.AddWithValue("@Id", pTypeDevis.Id); * if (cn.State == ConnectionState.Closed) * cn.Open(); * StartTransaction(cn); * int rowsAffected = cmd.ExecuteNonQuery(); * CommitTransaction(cmd.Transaction); * return Convert.ToBoolean(rowsAffected); * } * catch (Exception ex) * { * RollBackTransaction(cmd.Transaction); * throw ex; * } * finally * { * if (cn.State == ConnectionState.Open) * cn.Close(); * cmd.Dispose(); * } * } * * public bool Delete(List<CsTdem> pTypeDevisCollection) * { * int number = 0; * foreach (CsTdem entity in pTypeDevisCollection) * { * if (Delete(entity)) * { * number++; * } * } * return number != 0; * } * * public bool Update(CsTdem pTypeDevis) * { * cn = new SqlConnection(Session.GetSqlConnexionString()); * cmd = new SqlCommand * { * Connection = cn, * CommandType = CommandType.StoredProcedure, * CommandText = "SPX_PARAM_TDEM_UPDATE" * }; * cmd.Parameters.Clear(); * * try * { * cmd.Parameters.AddWithValue("@Id", pTypeDevis.Id); * cmd.Parameters.AddWithValue("@OriginalId", pTypeDevis.OriginalId); * cmd.Parameters.AddWithValue("@LIBELLE", pTypeDevis.Libelle); * cmd.Parameters.AddWithValue("@CodeProduit", pTypeDevis.CodeProduit); * if (cn.State == ConnectionState.Closed) * cn.Open(); * StartTransaction(cn); * SetDBNullParametre(cmd.Parameters); * int rowsAffected = cmd.ExecuteNonQuery(); * CommitTransaction(cmd.Transaction); * return Convert.ToBoolean(rowsAffected); * } * catch (Exception ex) * { * RollBackTransaction(cmd.Transaction); * throw ex; * } * finally * { * if (cn.State == ConnectionState.Open) * cn.Close(); // Fermeture de la connection * cmd.Dispose(); * } * } * * public bool Update(List<CsTdem> pTypeDevisCollection) * { * int number = 0; * foreach (CsTdem entity in pTypeDevisCollection) * { * if (Update(entity)) * { * number++; * } * } * return number != 0; * } * * public bool Insert(CsTdem pTypeDevis) * { * cn = new SqlConnection(Session.GetSqlConnexionString()); * cmd = new SqlCommand * { * Connection = cn, * CommandType = CommandType.StoredProcedure, * CommandText = "SPX_PARAM_TDEM_INSERER" * }; * cmd.Parameters.Clear(); * * try * { * cmd.Parameters.AddWithValue("@Id", pTypeDevis.Id); * cmd.Parameters.AddWithValue("@LIBELLE", pTypeDevis.Libelle); * cmd.Parameters.AddWithValue("@CodeProduit", pTypeDevis.CodeProduit); * if (cn.State == ConnectionState.Closed) * cn.Open(); * StartTransaction(cn); * * SetDBNullParametre(cmd.Parameters); * int rowsAffected = cmd.ExecuteNonQuery(); * CommitTransaction(cmd.Transaction); * return Convert.ToBoolean(rowsAffected); * } * catch (Exception ex) * { * RollBackTransaction(cmd.Transaction); * throw ex; * } * finally * { * if (cn.State == ConnectionState.Open) * cn.Close(); // Fermeture de la connection * cmd.Dispose(); * } * } * * public bool Insert(List<CsTdem> pTypeDevisCollection) * { * int number = 0; * foreach (CsTdem entity in pTypeDevisCollection) * { * if (Insert(entity)) * { * number++; * } * } * return number != 0; * } * * private void StartTransaction(SqlConnection _conn) * { * if ((_Transaction) && (_conn != null)) * { * cmd.Transaction = this.BeginTransaction(_conn); * } * } * * private void CommitTransaction(SqlTransaction _pSqlTransaction) * { * if ((_Transaction) && (_pSqlTransaction != null)) * { * this.Commit(_pSqlTransaction); * } * } * * private void RollBackTransaction(SqlTransaction _pSqlTransaction) * { * if ((_Transaction) && (_pSqlTransaction != null)) * { * this.RollBack(_pSqlTransaction); * } * } * */ //public static CsTdem GetById(int id) //{ // try // { // return Entities.GetEntityFromQuery<CsTdem>(ParamProcedure.PARAM_TDEM_RETOURNEById(id)); // } // catch (Exception ex) // { // throw ex; // } //} //public static List<CsTdem> GetByProduitId(int ProduitId) //{ // try // { // return Entities.GetEntityListFromQuery<CsTdem>(ParamProcedure.PARAM_TDEM_RETOURNEByProduitId(ProduitId)); // } // catch (Exception ex) // { // throw ex; // } //} public static List <CsTdem> GetAll() { try { //return Entities.GetEntityListFromQuery<CsTdem>(ParamProcedure.PARAM_TDEM_RETOURNE()); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("TYPEDEMANDE"); return(Entities.GetEntityListFromQuery <CsTdem>(dt)); } catch (Exception ex) { throw ex; } }
//TriggerMenuView public List <CsTypeReclamationRcl> SelectAllTypeReclamationRcl() { try { //DataTable dt = Galatee.Entity.Model.ReclamationProcedure.RetourneListeTypeReclamation(); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("Rcl.RCL_TypeReclamation"); return(Entities.GetEntityListFromQuery <CsTypeReclamationRcl>(dt)); } catch (Exception ex) { throw ex; } }
public List <CsTypeClient> SelectAllTypeClient() { try { //return Entities.GetEntityListFromQuery<CsTypeClient>(ParamProcedure.RetourneTypeClient(null)); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("TYPECLIENT"); return(Entities.GetEntityListFromQuery <CsTypeClient>(dt)); } catch (Exception ex) { throw ex; } }
/* * private string ConnectionString; * * public DB_StatutJuridique() * { * try * { * ConnectionString = Session.GetSqlConnexionString(); * } * catch (Exception ex) * { * * throw ex; * } * } * * public DB_StatutJuridique(string ConnStr) * { * ConnectionString = ConnStr; * } * * private SqlConnection cn = null; * * private bool _Transaction; * * public bool Transaction * { * get { return _Transaction; } * set { _Transaction = value; } * * } * * private SqlCommand cmd = null; * * public List<CsStatutJuridique> SelectAllStatutJuridique() * { * cn = new SqlConnection(ConnectionString); * try * { * if (cn.State == ConnectionState.Closed) * cn.Open(); * cmd = new SqlCommand * { * Connection = cn, * CommandType = CommandType.StoredProcedure, * CommandText = EnumProcedureStockee.SelectStatutJuridique * }; * IDataReader reader = cmd.ExecuteReader(); * var rows = new List<CsStatutJuridique>(); * Fill(reader, rows, int.MinValue, int.MaxValue); * reader.Close(); * return rows; * } * catch (Exception ex) * { * throw new Exception(EnumProcedureStockee.SelectStatutJuridique + ":" + ex.Message); * } * finally * { * if (cn.State == ConnectionState.Open) * cn.Close(); // Fermeture de la connection * cmd.Dispose(); * } * } * * public bool Delete(CsStatutJuridique pStatutJuridique) * { * try * { * cn = new SqlConnection(ConnectionString); * cmd = new SqlCommand * { * Connection = cn, * CommandType = CommandType.StoredProcedure, * CommandText = EnumProcedureStockee.DeleteStatutJuridique * }; * cmd.Parameters.Clear(); * //cmd.Parameters.AddWithValue("@ID", pStatutJuridique.ID); * if (cn.State == ConnectionState.Closed) * cn.Open(); * StartTransaction(cn); * int rowsAffected = cmd.ExecuteNonQuery(); * CommitTransaction(cmd.Transaction); * return Convert.ToBoolean(rowsAffected); * } * catch (Exception ex) * { * RollBackTransaction(cmd.Transaction); * throw new Exception(EnumProcedureStockee.DeleteStatutJuridique + ":" + ex.Message); * } * finally * { * if (cn.State == ConnectionState.Open) * cn.Close(); * cmd.Dispose(); * } * } * * public bool Delete(List<CsStatutJuridique> pStatutJuridiqueCollection) * { * int number = 0; * foreach (CsStatutJuridique entity in pStatutJuridiqueCollection) * { * if (Delete(entity)) * { * number++; * } * } * return number != 0; * } * * private static List<CsStatutJuridique> Fill(IDataReader reader, List<CsStatutJuridique> rows, int start, int pageLength) * { * // advance to the starting row * for (int i = 0; i < start; i++) * { * if (!reader.Read()) * return rows; // not enough rows, just return * } * * for (int i = 0; i < pageLength; i++) * { * if (!reader.Read()) * break; // we are done * * var c = new CsStatutJuridique * { * //ID = (Convert.IsDBNull(reader["ID"])) ? (byte) 0 : (System.Byte) reader["ID"], * //CODE = * // (Convert.IsDBNull(reader["CODE"])) * // ? string.Empty * // : (System.String) reader["CODE"], * LIBELLE = * (Convert.IsDBNull(reader["LIBELLE"])) * ? null * : (System.String) reader["LIBELLE"], * DATECREATION = * (Convert.IsDBNull(reader["DATECREATION"])) * ? DateTime.MinValue * : (System.DateTime) reader["DATECREATION"] * }; * if (Convert.IsDBNull(reader["DATEMODIFICATION"])) * c.DATEMODIFICATION = null; * else * c.DATEMODIFICATION = (System.DateTime)reader["DATEMODIFICATION"]; * c.USERCREATION = (Convert.IsDBNull(reader["USERCREATION"])) ? string.Empty : (System.String)reader["USERCREATION"]; * c.USERMODIFICATION = (Convert.IsDBNull(reader["USERMODIFICATION"])) ? null : (System.String)reader["USERMODIFICATION"]; * rows.Add(c); * } * return rows; * } * * private bool Update(CsStatutJuridique pStatutJuridique) * { * cn = new SqlConnection(ConnectionString); * cmd = new SqlCommand * { * Connection = cn, * CommandType = CommandType.StoredProcedure, * CommandText = EnumProcedureStockee.UpdateStatutJuridique * }; * cmd.Parameters.Clear(); * * try * { * //cmd.Parameters.AddWithValue("@ID", pStatutJuridique.ID); * //cmd.Parameters.AddWithValue("@CODE", pStatutJuridique.CODE); * cmd.Parameters.AddWithValue("@LIBELLE", pStatutJuridique.LIBELLE); * cmd.Parameters.AddWithValue("@DATECREATION", pStatutJuridique.DATECREATION); * cmd.Parameters.AddWithValue("@DATEMODIFICATION", pStatutJuridique.DATEMODIFICATION); * cmd.Parameters.AddWithValue("@USERCREATION", pStatutJuridique.USERCREATION); * cmd.Parameters.AddWithValue("@USERMODIFICATION", pStatutJuridique.USERMODIFICATION); * if (cn.State == ConnectionState.Closed) * cn.Open(); * StartTransaction(cn); * SetDBNullParametre(cmd.Parameters); * int rowsAffected = cmd.ExecuteNonQuery(); * CommitTransaction(cmd.Transaction); * return Convert.ToBoolean(rowsAffected); * } * catch (Exception ex) * { * RollBackTransaction(cmd.Transaction); * throw ex; * } * finally * { * if (cn.State == ConnectionState.Open) * cn.Close(); // Fermeture de la connection * cmd.Dispose(); * } * } * * public bool Update(List<CsStatutJuridique> pStatutJuridiqueCollection) * { * int number = 0; * foreach (CsStatutJuridique entity in pStatutJuridiqueCollection) * { * if (Update(entity)) * { * number++; * } * } * return number != 0; * } * * private bool Insert(CsStatutJuridique pStatutJuridique) * { * cn = new SqlConnection(ConnectionString); * cmd = new SqlCommand * { * Connection = cn, * CommandType = CommandType.StoredProcedure, * CommandText = EnumProcedureStockee.InsertStatutJuridique * }; * cmd.Parameters.Clear(); * * try * { * //cmd.Parameters.AddWithValue("@CODE", pStatutJuridique.CODE); * cmd.Parameters.AddWithValue("@LIBELLE", pStatutJuridique.LIBELLE); * cmd.Parameters.AddWithValue("@DATECREATION", pStatutJuridique.DATECREATION); * cmd.Parameters.AddWithValue("@DATEMODIFICATION", pStatutJuridique.DATEMODIFICATION); * cmd.Parameters.AddWithValue("@USERCREATION", pStatutJuridique.USERCREATION); * cmd.Parameters.AddWithValue("@USERMODIFICATION", pStatutJuridique.USERMODIFICATION); * if (cn.State == ConnectionState.Closed) * cn.Open(); * StartTransaction(cn); * * SetDBNullParametre(cmd.Parameters); * int rowsAffected = cmd.ExecuteNonQuery(); * CommitTransaction(cmd.Transaction); * return Convert.ToBoolean(rowsAffected); * } * catch (Exception ex) * { * RollBackTransaction(cmd.Transaction); * throw ex; * } * finally * { * if (cn.State == ConnectionState.Open) * cn.Close(); // Fermeture de la connection * cmd.Dispose(); * } * } * * public bool Insert(List<CsStatutJuridique> pStatutJuridiqueCollection) * { * int number = 0; * foreach (CsStatutJuridique entity in pStatutJuridiqueCollection) * { * if (Insert(entity)) * { * number++; * } * } * return number != 0; * } * * private void StartTransaction(SqlConnection _conn) * { * if ((_Transaction) && (_conn != null)) * { * cmd.Transaction = this.BeginTransaction(_conn); * } * } * * private void CommitTransaction(SqlTransaction _pSqlTransaction) * { * if ((_Transaction) && (_pSqlTransaction != null)) * { * this.Commit(_pSqlTransaction); * } * } * * private void RollBackTransaction(SqlTransaction _pSqlTransaction) * { * if ((_Transaction) && (_pSqlTransaction != null)) * { * this.RollBack(_pSqlTransaction); * } * } * */ public List <CsStatutJuridique> SelectAllStatutJuridique() { try { //return Entities.GetEntityListFromQuery<CsStatutJuridique>(ParamProcedure.RetourneStatutJuridique(null)); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("STATUTJURIQUE"); return(Entities.GetEntityListFromQuery <CsStatutJuridique>(dt)); } catch (Exception ex) { throw ex; } }
public List <CsFonction> SELECT_All_Fonction() { try { //DataTable dt = Galatee.Entity.Model.CommonProcedures.RetourneTousFonctions(); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("FONCTION"); return(Galatee.Tools.Utility.GetEntityFromQuery <CsFonction>(dt).ToList()); } catch (Exception ex) { throw new Exception(EnumProcedureStockee.SelectTaCodeLibelleByNum + ":" + ex.Message); } }
public static List <ObjAPPAREILS> GetAll() { try { //return Entities.GetEntityListFromQuery<ObjAPPAREILS>(ParamProcedure.PARAM_APPAREILS_RETOURNE()); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("APPAREILS"); return(Entities.GetEntityListFromQuery <ObjAPPAREILS>(dt)); } catch (Exception ex) { throw ex; } }
/* * private string ConnectionString; * * public DB_Usage() * { * try * { * ConnectionString = Session.GetSqlConnexionString(); * } * catch (Exception ex) * { * * throw ex; * } * } * * public DB_Usage(string ConnStr) * { * ConnectionString = ConnStr; * } * * private SqlConnection cn = null; * * private bool _Transaction; * * public bool Transaction * { * get { return _Transaction; } * set { _Transaction = value; } * * } * * private SqlCommand cmd = null; * * public List<CsUsage> SelectAllUsage() * { * cn = new SqlConnection(ConnectionString); * try * { * if (cn.State == ConnectionState.Closed) * cn.Open(); * cmd = new SqlCommand * { * Connection = cn, * CommandType = CommandType.StoredProcedure, * CommandText = EnumProcedureStockee.SelectUsage * }; * IDataReader reader = cmd.ExecuteReader(); * var rows = new List<CsUsage>(); * Fill(reader, rows, int.MinValue, int.MaxValue); * reader.Close(); * return rows; * } * catch (Exception ex) * { * throw new Exception(EnumProcedureStockee.SelectUsage + ":" + ex.Message); * } * finally * { * if (cn.State == ConnectionState.Open) * cn.Close(); // Fermeture de la connection * cmd.Dispose(); * } * } * * public bool Delete(CsUsage pUsage) * { * try * { * cn = new SqlConnection(ConnectionString); * cmd = new SqlCommand * { * Connection = cn, * CommandType = CommandType.StoredProcedure, * CommandText = EnumProcedureStockee.DeleteUsage * }; * cmd.Parameters.Clear(); * //cmd.Parameters.AddWithValue("@ID", pUsage.ID); * if (cn.State == ConnectionState.Closed) * cn.Open(); * StartTransaction(cn); * int rowsAffected = cmd.ExecuteNonQuery(); * CommitTransaction(cmd.Transaction); * return Convert.ToBoolean(rowsAffected); * } * catch (Exception ex) * { * RollBackTransaction(cmd.Transaction); * throw new Exception(EnumProcedureStockee.DeleteUsage + ":" + ex.Message); * } * finally * { * if (cn.State == ConnectionState.Open) * cn.Close(); * cmd.Dispose(); * } * } * * public bool Delete(List<CsUsage> pUsageCollection) * { * int number = 0; * foreach (CsUsage entity in pUsageCollection) * { * if (Delete(entity)) * { * number++; * } * } * return number != 0; * } * * private static List<CsUsage> Fill(IDataReader reader, List<CsUsage> rows, int start, int pageLength) * { * // advance to the starting row * for (int i = 0; i < start; i++) * { * if (!reader.Read()) * return rows; // not enough rows, just return * } * * for (int i = 0; i < pageLength; i++) * { * if (!reader.Read()) * break; // we are done * * var c = new CsUsage * { * //ID = (Convert.IsDBNull(reader["ID"])) ? (byte) 0 : (System.Byte) reader["ID"], * //CODE = * // (Convert.IsDBNull(reader["CODE"])) * // ? string.Empty * // : (System.String) reader["CODE"], * LIBELLE = * (Convert.IsDBNull(reader["LIBELLE"])) * ? null * : (System.String) reader["LIBELLE"], * DATECREATION = * (Convert.IsDBNull(reader["DATECREATION"])) * ? DateTime.MinValue * : (System.DateTime) reader["DATECREATION"] * }; * if (Convert.IsDBNull(reader["DATEMODIFICATION"])) * c.DATEMODIFICATION = null; * else * c.DATEMODIFICATION = (System.DateTime)reader["DATEMODIFICATION"]; * c.USERCREATION = (Convert.IsDBNull(reader["USERCREATION"])) ? string.Empty : (System.String)reader["USERCREATION"]; * c.USERMODIFICATION = (Convert.IsDBNull(reader["USERMODIFICATION"])) ? null : (System.String)reader["USERMODIFICATION"]; * rows.Add(c); * } * return rows; * } * * private bool Update(CsUsage pUsage) * { * cn = new SqlConnection(ConnectionString); * cmd = new SqlCommand * { * Connection = cn, * CommandType = CommandType.StoredProcedure, * CommandText = EnumProcedureStockee.UpdateUsage * }; * cmd.Parameters.Clear(); * * try * { * //cmd.Parameters.AddWithValue("@ID", pUsage.ID); * //cmd.Parameters.AddWithValue("@CODE", pUsage.CODE); * cmd.Parameters.AddWithValue("@LIBELLE", pUsage.LIBELLE); * cmd.Parameters.AddWithValue("@DATECREATION", pUsage.DATECREATION); * cmd.Parameters.AddWithValue("@DATEMODIFICATION", pUsage.DATEMODIFICATION); * cmd.Parameters.AddWithValue("@USERCREATION", pUsage.USERCREATION); * cmd.Parameters.AddWithValue("@USERMODIFICATION", pUsage.USERMODIFICATION); * if (cn.State == ConnectionState.Closed) * cn.Open(); * StartTransaction(cn); * SetDBNullParametre(cmd.Parameters); * int rowsAffected = cmd.ExecuteNonQuery(); * CommitTransaction(cmd.Transaction); * return Convert.ToBoolean(rowsAffected); * } * catch (Exception ex) * { * RollBackTransaction(cmd.Transaction); * throw ex; * } * finally * { * if (cn.State == ConnectionState.Open) * cn.Close(); // Fermeture de la connection * cmd.Dispose(); * } * } * * public bool Update(List<CsUsage> pUsageCollection) * { * int number = 0; * foreach (CsUsage entity in pUsageCollection) * { * if (Update(entity)) * { * number++; * } * } * return number != 0; * } * * private bool Insert(CsUsage pUsage) * { * cn = new SqlConnection(ConnectionString); * cmd = new SqlCommand * { * Connection = cn, * CommandType = CommandType.StoredProcedure, * CommandText = EnumProcedureStockee.InsertUsage * }; * cmd.Parameters.Clear(); * * try * { * //cmd.Parameters.AddWithValue("@CODE", pUsage.CODE); * cmd.Parameters.AddWithValue("@LIBELLE", pUsage.LIBELLE); * cmd.Parameters.AddWithValue("@DATECREATION", pUsage.DATECREATION); * cmd.Parameters.AddWithValue("@DATEMODIFICATION", pUsage.DATEMODIFICATION); * cmd.Parameters.AddWithValue("@USERCREATION", pUsage.USERCREATION); * cmd.Parameters.AddWithValue("@USERMODIFICATION", pUsage.USERMODIFICATION); * if (cn.State == ConnectionState.Closed) * cn.Open(); * StartTransaction(cn); * * SetDBNullParametre(cmd.Parameters); * int rowsAffected = cmd.ExecuteNonQuery(); * CommitTransaction(cmd.Transaction); * return Convert.ToBoolean(rowsAffected); * } * catch (Exception ex) * { * RollBackTransaction(cmd.Transaction); * throw ex; * } * finally * { * if (cn.State == ConnectionState.Open) * cn.Close(); // Fermeture de la connection * cmd.Dispose(); * } * } * * public bool Insert(List<CsUsage> pUsageCollection) * { * int number = 0; * foreach (CsUsage entity in pUsageCollection) * { * if (Insert(entity)) * { * number++; * } * } * return number != 0; * } * * private void StartTransaction(SqlConnection _conn) * { * if ((_Transaction) && (_conn != null)) * { * cmd.Transaction = this.BeginTransaction(_conn); * } * } * * private void CommitTransaction(SqlTransaction _pSqlTransaction) * { * if ((_Transaction) && (_pSqlTransaction != null)) * { * this.Commit(_pSqlTransaction); * } * } * * private void RollBackTransaction(SqlTransaction _pSqlTransaction) * { * if ((_Transaction) && (_pSqlTransaction != null)) * { * this.RollBack(_pSqlTransaction); * } * } * */ public List <CsUsage> SelectAllUsage() { try { //return Entities.GetEntityListFromQuery<CsUsage>(ParamProcedure.RetourneUsage(null)); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("USAGE"); return(Entities.GetEntityListFromQuery <CsUsage>(dt)); } catch (Exception ex) { throw ex; } }
//26-01-2019 public List <CsProfil> GetAll() { try { //DataTable objet = Galatee.Entity.Model.AdminProcedures.RetourneListeToutProfilUtilisateur(); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("PROFIL"); return(Galatee.Tools.Utility.GetEntityListFromQuery <CsProfil>(dt)); } catch (Exception ex) { throw ex; } }
//public static CsProduitFacture RetourneUnProduit(int idProd) //{ // CsProduitFacture produit=from prod in RetourneTousProduit() // where prod.pk // return //} #region ADO .Net from Entity : Stephen 26-01-2019 public List <CsCentre> GetCentre() { try { //DataTable dt = Galatee.Entity.Model.CommonProcedures.RetourneTousCentres(); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("CENTRE"); List <CsCentre> c = Entities.GetEntityListFromQuery <CsCentre>(dt).ToList(); return(c); } catch (Exception ex) { throw ex; } }
public List <CsSite> GetAllSite() { //cmd.CommandText = "spx_AdmRoles_GetAllBranche"; try { //DataTable dt = Galatee.Entity.Model.CommonProcedures.RetourneTousSites(); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("SITE"); return(Entities.GetEntityListFromQuery <CsSite>(dt)); } catch (Exception ex) { throw ex; } }
public List <CsProgramMenu> RetourneAllModuleProgram() { try { //DataTable dt = Galatee.Entity.Model.AdminProcedures.RetourneListeToutModuleEtSousMenu(); DB_ParametresGeneraux db = new DB_ParametresGeneraux(); List <CsProgramMenu> _LstProgramMenu = new List <CsProgramMenu>(); _LstProgramMenu = db.RetourneListeAllModulesetSousmenus(); return(_LstProgramMenu); } catch (Exception ex) { throw ex; } }
public List <CsCtax> GetAll() { try { //return Entities.GetEntityListFromQuery<CsCtax>(ParamProcedure.PARAM_CTAX_RETOURNE()); DB_ParametresGeneraux db = new DB_ParametresGeneraux(); List <CsCtax> _LstItem = new List <CsCtax>(); _LstItem = db.RetourneCTax(); return(_LstItem); } catch (Exception ex) { throw ex; } }
public List <CsStrategieSecurite> GetAll() { try { //SqlCommand cmd = new SqlCommand("spx_AdmStrategieSecurite_GetAll", cn); //DataTable dt = Galatee.Entity.Model.AdminProcedures.RetourneListeToutStrategieSecurite(); //return Galatee.Tools.Utility.GetEntityFromQuery<CsStrategieSecurite>(dt).ToList(); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("ADMSTRATEGIESECURITE"); return(Entities.GetEntityListFromQuery <CsStrategieSecurite>(dt)); } catch (Exception ex) { throw ex; } }
public List <CsReglageCompteur> SelectAllReglageCompteur() { try { /*Stephen 13-02-2019*/ //return Entities.GetEntityListFromQuery<CsReglageCompteur>(ParamProcedure.PARAM_REGLAGECOMPTEUR_RETOURNE()); DB_ParametresGeneraux db = new DB_ParametresGeneraux(); List <CsReglageCompteur> _LstItem = new List <CsReglageCompteur>(); _LstItem = db.RetourneReglageCompteur(); return(_LstItem); } catch (Exception ex) { throw ex; } }
public List <CsCalibreCompteur> SelectAllCalibreCompteur() { try { //return Entities.GetEntityListFromQuery<CsCalibreCompteur>(ParamProcedure.PARAM_CALIBRECOMPTEUR_RETOURNE()); //DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("CALIBRECOMPTEUR"); //return Entities.GetEntityListFromQuery<CsCalibreCompteur>(dt); DB_ParametresGeneraux db = new DB_ParametresGeneraux(); List <CsCalibreCompteur> _LstItem = new List <CsCalibreCompteur>(); _LstItem = db.RetourneCalibreCompteur(); return(_LstItem); } catch (Exception ex) { throw ex; } }
/*Stephen : 13-02-2019*/ public static List <CsMaterielDemande> GetAll() { try { //return Entities.GetEntityListFromQuery<CsMaterielDemande>(ParamProcedure.PARAM_MATERIEL_RETOURNE ()); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("MATERIELDEVIS"); List <CsMaterielDemande> _listItem = Entities.GetEntityListFromQuery <CsMaterielDemande>(dt); foreach (CsMaterielDemande item in _listItem) { item.COUTUNITAIRE = item.COUTUNITAIRE_FOURNITURE + item.COUTUNITAIRE_POSE; } return(_listItem); } catch (Exception ex) { throw ex; } }
public static List <ObjELEMENTDEVIS> GetAllMaterielOnFourniture() { try { //return Entities.GetEntityListFromQuery<ObjELEMENTDEVIS>(ParamProcedure.PARAM_MATERIEL_RETOURNE()); DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("MATERIELDEVIS"); List <ObjELEMENTDEVIS> _listItem = Entities.GetEntityListFromQuery <ObjELEMENTDEVIS>(dt); foreach (ObjELEMENTDEVIS item in _listItem) { item.COUTUNITAIRE = (decimal)item.COUTUNITAIRE_FOURNITURE + (decimal)item.COUTUNITAIRE_POSE; item.FK_IDMATERIELDEVIS = item.PK_ID; } return(_listItem); } catch (Exception ex) { throw ex; } }
public List <CsVariableDeTarification> LoadAllVariableTarif() { try { //return TarificationProcedure.LoadAllVariableTarif(); //DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("VARIABLETARIF"); //return Galatee.Tools.Utility.GetEntityListFromQuery<CsVariableDeTarification>(dt); DB_ParametresGeneraux db = new DB_ParametresGeneraux(); List <CsVariableDeTarification> _LstItem = new List <CsVariableDeTarification>(); _LstItem = db.LoadAllVariableTarif(); foreach (CsVariableDeTarification i in _LstItem) { i.REDEVANCE_RECHERCHE = "CODE REDEVENCE(" + i.CODEREDEVENCE + ")-CODE RECHERCHE(" + i.CODERECHERCHE; } return(_LstItem); } catch (Exception ex) { throw ex; } }
public List <CsRechercheTarif> RetourneAllRechercheTarif() { List <CsRechercheTarif> ListeRedevance = new List <CsRechercheTarif>(); try { DataTable dt = DB_ParametresGeneraux.SelectAllDonneReference("RECHERCHETARIF"); List <CsRechercheTarif> lstTarif = Galatee.Tools.Utility.GetEntityListFromQuery <CsRechercheTarif>(dt); DataTable dts = DB_ParametresGeneraux.SelectAllDonneReference("CTARCOMP"); List <CsCtarcomp> lstCtarcompt = Galatee.Tools.Utility.GetEntityListFromQuery <CsCtarcomp>(dts); foreach (CsRechercheTarif item in lstTarif) { item.CTARCOMP = lstCtarcompt.Where(t => t.FK_IDRECHERCHETARIF == item.PK_ID).ToList(); } return(lstTarif); } catch (Exception ex) { } return(ListeRedevance); }