public int Insert(Spartane.Core.Classes.Spartan_BR_Event_Restrictions_Detail.Spartan_BR_Event_Restrictions_Detail entity) { int rta; try { var padreAction = _dataProvider.GetParameter(); padreAction.ParameterName = "Action"; padreAction.DbType = DbType.Int32; padreAction.Value = (object)entity.Action ?? DBNull.Value; var padreProcess_Event = _dataProvider.GetParameter(); padreProcess_Event.ParameterName = "Process_Event"; padreProcess_Event.DbType = DbType.Int16; padreProcess_Event.Value = (object)entity.Process_Event ?? DBNull.Value; var empEntity = _dbContext.ExecuteStoredProcedureList <Spartane.Core.Classes.StoredProcedure.sp_InsSpartan_BR_Event_Restrictions_Detail>("sp_InsSpartan_BR_Event_Restrictions_Detail", padreAction , padreProcess_Event ).FirstOrDefault(); rta = Convert.ToInt32(empEntity.RestrictionId); } catch (ExceptionBase ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex.Message, ex); } return(rta); }
public int Update(Spartane.Core.Classes.Spartan_BR_Event_Restrictions_Detail.Spartan_BR_Event_Restrictions_Detail entity) { int rta; try { var paramUpdRestrictionId = _dataProvider.GetParameter(); paramUpdRestrictionId.ParameterName = "RestrictionId"; paramUpdRestrictionId.DbType = DbType.Int32; paramUpdRestrictionId.Value = entity.RestrictionId; var paramUpdAction = _dataProvider.GetParameter(); paramUpdAction.ParameterName = "Action"; paramUpdAction.DbType = DbType.Int32; paramUpdAction.Value = entity.Action; var paramUpdProcess_Event = _dataProvider.GetParameter(); paramUpdProcess_Event.ParameterName = "Process_Event"; paramUpdProcess_Event.DbType = DbType.Int16; if (entity.Process_Event == null) { paramUpdProcess_Event.Value = DBNull.Value; } else { paramUpdProcess_Event.Value = entity.Process_Event; } var empEntity = _dbContext.ExecuteStoredProcedureList <Spartane.Core.Classes.StoredProcedure.sp_UpdSpartan_BR_Event_Restrictions_Detail>("sp_UpdSpartan_BR_Event_Restrictions_Detail", paramUpdRestrictionId, paramUpdAction, paramUpdProcess_Event).FirstOrDefault(); rta = Convert.ToInt32(empEntity.RestrictionId); } catch (ExceptionBase ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex.Message, ex); } return(rta); }