public int Insert(Spartane.Core.Classes.Spartan_BR_Scope_Detail.Spartan_BR_Scope_Detail entity) { int rta; try { var padreBusiness_Rule = _dataProvider.GetParameter(); padreBusiness_Rule.ParameterName = "Business_Rule"; padreBusiness_Rule.DbType = DbType.Int32; padreBusiness_Rule.Value = (object)entity.Business_Rule ?? DBNull.Value; var padreScope = _dataProvider.GetParameter(); padreScope.ParameterName = "Scope"; padreScope.DbType = DbType.Int16; padreScope.Value = (object)entity.Scope ?? DBNull.Value; var empEntity = _dbContext.ExecuteStoredProcedureList <Spartane.Core.Classes.StoredProcedure.sp_InsSpartan_BR_Scope_Detail>("sp_InsSpartan_BR_Scope_Detail", padreBusiness_Rule , padreScope ).FirstOrDefault(); rta = Convert.ToInt32(empEntity.ScopeDetailId); } catch (ExceptionBase ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex.Message, ex); } return(rta); }
public int Update(Spartane.Core.Classes.Spartan_BR_Scope_Detail.Spartan_BR_Scope_Detail entity) { int rta; try { var paramUpdScopeDetailId = _dataProvider.GetParameter(); paramUpdScopeDetailId.ParameterName = "ScopeDetailId"; paramUpdScopeDetailId.DbType = DbType.Int32; paramUpdScopeDetailId.Value = entity.ScopeDetailId; var paramUpdBusiness_Rule = _dataProvider.GetParameter(); paramUpdBusiness_Rule.ParameterName = "Business_Rule"; paramUpdBusiness_Rule.DbType = DbType.Int32; paramUpdBusiness_Rule.Value = entity.Business_Rule; var paramUpdScope = _dataProvider.GetParameter(); paramUpdScope.ParameterName = "Scope"; paramUpdScope.DbType = DbType.Int16; if (entity.Scope == null) { paramUpdScope.Value = DBNull.Value; } else { paramUpdScope.Value = entity.Scope; } var empEntity = _dbContext.ExecuteStoredProcedureList <Spartane.Core.Classes.StoredProcedure.sp_UpdSpartan_BR_Scope_Detail>("sp_UpdSpartan_BR_Scope_Detail", paramUpdScopeDetailId, paramUpdBusiness_Rule).FirstOrDefault(); rta = Convert.ToInt32(empEntity.ScopeDetailId); } catch (ExceptionBase ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex.Message, ex); } return(rta); }