public bool UpdateFromInfo(TipoDeDietaEntityKey EntityKey, TipoDeDietaEntityInfo EntityInfo)
 {
     try
     {
         TipoDeDietaEntityUpdate EntityUpdate = new TipoDeDietaEntityUpdate();
         EntityUpdate.LoadFromInfo(EntityInfo);
         return(this.Update(EntityKey, EntityUpdate));
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
 }
 public TipoDeDietaEntityInfo SearchOne(TipoDeDietaEntityKey EntityKey, bool NoUtilizar)
 {
     try
     {
         if (!EntityKey.Validate())
         {
             throw new Exception(EntityKey.ErroresQueInvalidanLaEntidad);
         }
         return(this.DataRowToEntityInfo(this.CreateDataAccess().SearchOne(EntityKey).Rows[0]));
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
 }
 public DataTable SearchOne(TipoDeDietaEntityKey EntityKey)
 {
     try
     {
         if (!EntityKey.Validate())
         {
             throw new Exception(EntityKey.ErroresQueInvalidanLaEntidad);
         }
         return(this.CreateDataAccess().SearchOne(EntityKey));
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
 }
 public bool UpdateNull(TipoDeDietaEntityKey EntityKey, TipoDeDietaEntityUpdateNullFields EntityUpdateNullFields)
 {
     try
     {
         if (!EntityKey.Validate())
         {
             return(false);
         }
         return(this.CreateDataAccess().UpdateNull(EntityKey, EntityUpdateNullFields));
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
 }
Exemplo n.º 5
0
        public bool Delete(TipoDeDietaEntityKey EntityKey)
        {
            DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("TipoDeDieta_Delete");

            try
            {
                using (storedProcCommand)
                {
                    this.DataBase.AddInParameter(storedProcCommand, "TipoDeDietaId", DbType.Int32, (object)EntityKey.TipoDeDietaId);
                    return(Convert.ToBoolean(this.DataBase.ExecuteNonQuery(storedProcCommand)));
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 6
0
        public DataTable SearchOne(TipoDeDietaEntityKey EntityKey)
        {
            DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("TipoDeDieta_Search");

            try
            {
                using (storedProcCommand)
                {
                    this.DataBase.AddInParameter(storedProcCommand, "OpeTipoDeDietaId", DbType.String, (object)"=");
                    this.DataBase.AddInParameter(storedProcCommand, "TipoDeDietaId", DbType.Int32, (object)EntityKey.TipoDeDietaId);
                    return(this.DataBase.ExecuteDataSet(storedProcCommand).Tables[0]);
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 7
0
        public bool Update(TipoDeDietaEntityKey EntityKey, TipoDeDietaEntityUpdate EntityUpdate)
        {
            DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("TipoDeDieta_UpdateOptionalFields");

            try
            {
                using (storedProcCommand)
                {
                    this.DataBase.AddInParameter(storedProcCommand, "TipoDeDietaId", DbType.Int32, (object)EntityKey.TipoDeDietaId);
                    this.DataBase.AddInParameter(storedProcCommand, "TipoDeDieta", DbType.AnsiString, (object)EntityUpdate.TipoDeDieta);
                    return(Convert.ToBoolean(this.DataBase.ExecuteNonQuery(storedProcCommand)));
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 8
0
        public bool UpdateNull(TipoDeDietaEntityKey EntityKey, TipoDeDietaEntityUpdateNullFields EntityUpdateNullFields)
        {
            DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("TipoDeDieta_UpdateNulls");

            try
            {
                using (storedProcCommand)
                {
                    this.DataBase.AddInParameter(storedProcCommand, "TipoDeDietaId", DbType.Int32, (object)EntityKey.TipoDeDietaId);
                    this.DataBase.AddInParameter(storedProcCommand, "FieldList", DbType.String, (object)EntityUpdateNullFields.FieldList);
                    this.DataBase.AddInParameter(storedProcCommand, "WhereExtendido", DbType.String, (object)EntityUpdateNullFields.WhereExtendido);
                    return(Convert.ToBoolean(this.DataBase.ExecuteNonQuery(storedProcCommand)));
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }