Ejemplo n.º 1
0
        public bool Update(NutrienteEntityKey EntityKey, NutrienteEntityUpdate EntityUpdate)
        {
            DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("Nutriente_UpdateOptionalFields");

            try
            {
                using (storedProcCommand)
                {
                    this.DataBase.AddInParameter(storedProcCommand, "NutrienteId", DbType.Int32, (object)EntityKey.NutrienteId);
                    this.DataBase.AddInParameter(storedProcCommand, "Nombre", DbType.AnsiString, (object)EntityUpdate.Nombre);
                    this.DataBase.AddInParameter(storedProcCommand, "UDMId", DbType.AnsiString, (object)EntityUpdate.UDMId);
                    this.DataBase.AddInParameter(storedProcCommand, "PerteneceA", DbType.Int32, (object)EntityUpdate.PerteneceA);
                    this.DataBase.AddInParameter(storedProcCommand, "Estado", DbType.AnsiString, (object)EntityUpdate.Estado);
                    return(Convert.ToBoolean(this.DataBase.ExecuteNonQuery(storedProcCommand)));
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
 public bool UpdateFromInfo(NutrienteEntityKey EntityKey, NutrienteEntityInfo EntityInfo)
 {
     try
     {
         NutrienteEntityUpdate EntityUpdate = new NutrienteEntityUpdate();
         EntityUpdate.LoadFromInfo(EntityInfo);
         return(this.Update(EntityKey, EntityUpdate));
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
 }
Ejemplo n.º 3
0
 public NutrienteEntityInfo SearchOne(NutrienteEntityKey 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;
     }
 }
Ejemplo n.º 4
0
 public DataTable SearchOne(NutrienteEntityKey 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;
     }
 }
Ejemplo n.º 5
0
 public bool UpdateNull(NutrienteEntityKey EntityKey, NutrienteEntityUpdateNullFields EntityUpdateNullFields)
 {
     try
     {
         if (!EntityKey.Validate())
         {
             return(false);
         }
         return(this.CreateDataAccess().UpdateNull(EntityKey, EntityUpdateNullFields));
     }
     catch (Exception ex)
     {
         Helpers.Logger.Logger.LogExceptionStatic(ex);
         throw ex;
     }
 }
Ejemplo n.º 6
0
        public bool Delete(NutrienteEntityKey EntityKey)
        {
            DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("Nutriente_Delete");

            try
            {
                using (storedProcCommand)
                {
                    this.DataBase.AddInParameter(storedProcCommand, "NutrienteId", DbType.Int32, (object)EntityKey.NutrienteId);
                    return(Convert.ToBoolean(this.DataBase.ExecuteNonQuery(storedProcCommand)));
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 7
0
        public DataTable SearchOne(NutrienteEntityKey EntityKey)
        {
            DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("Nutriente_Search");

            try
            {
                using (storedProcCommand)
                {
                    this.DataBase.AddInParameter(storedProcCommand, "OpeNutrienteId", DbType.String, (object)"=");
                    this.DataBase.AddInParameter(storedProcCommand, "NutrienteId", DbType.Int32, (object)EntityKey.NutrienteId);
                    return(this.DataBase.ExecuteDataSet(storedProcCommand).Tables[0]);
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 8
0
        public bool UpdateNull(NutrienteEntityKey EntityKey, NutrienteEntityUpdateNullFields EntityUpdateNullFields)
        {
            DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("Nutriente_UpdateNulls");

            try
            {
                using (storedProcCommand)
                {
                    this.DataBase.AddInParameter(storedProcCommand, "NutrienteId", DbType.Int32, (object)EntityKey.NutrienteId);
                    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;
            }
        }