public void InsertFromInfo(UnidadMedidaEntityInfo EntityInfo) { try { UnidadMedidaEntityInsert EntityInsert = new UnidadMedidaEntityInsert(); EntityInsert.LoadFromInfo(EntityInfo); this.Insert(EntityInsert); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public void Insert(UnidadMedidaEntityInsert EntityInsert) { try { if (!EntityInsert.Validate()) { throw new Exception(EntityInsert.ErroresQueInvalidanLaEntidad); } this.CreateDataAccess().Insert(EntityInsert); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public void Insert(UnidadMedidaEntityInsert EntityInsert) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("UnidadMedida_Insert"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "UDMId", DbType.AnsiString, (object)EntityInsert.UDMId); this.DataBase.AddInParameter(storedProcCommand, "Nombre", DbType.AnsiString, (object)EntityInsert.Nombre); this.DataBase.ExecuteNonQuery(storedProcCommand); } } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } }