public void Insert(aspnet_RolesEntityInsert EntityInsert) { DbCommand storedProcCommand = this.DataBase.GetStoredProcCommand("aspnet_Roles_Insert"); try { using (storedProcCommand) { this.DataBase.AddInParameter(storedProcCommand, "ApplicationId", DbType.Guid, (object)EntityInsert.ApplicationId); this.DataBase.AddInParameter(storedProcCommand, "RoleId", DbType.Guid, (object)EntityInsert.RoleId); this.DataBase.AddInParameter(storedProcCommand, "RoleName", DbType.String, (object)EntityInsert.RoleName); this.DataBase.AddInParameter(storedProcCommand, "LoweredRoleName", DbType.String, (object)EntityInsert.LoweredRoleName); this.DataBase.AddInParameter(storedProcCommand, "Description", DbType.String, (object)EntityInsert.Description); this.DataBase.AddInParameter(storedProcCommand, "LongDescription", DbType.AnsiString, (object)EntityInsert.LongDescription); this.DataBase.ExecuteNonQuery(storedProcCommand); } } catch (SqlException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public void InsertFromInfo(aspnet_RolesEntityInfo EntityInfo) { try { aspnet_RolesEntityInsert EntityInsert = new aspnet_RolesEntityInsert(); EntityInsert.LoadFromInfo(EntityInfo); this.Insert(EntityInsert); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }
public void Insert(aspnet_RolesEntityInsert EntityInsert) { try { if (!EntityInsert.Validate()) { throw new Exception(EntityInsert.ErroresQueInvalidanLaEntidad); } this.CreateDataAccess().Insert(EntityInsert); } catch (Exception ex) { Helpers.Logger.Logger.LogExceptionStatic(ex); throw ex; } }