public int Update(Spartane.Core.Classes.Spartan_BR_Action_Configuration_Detail.Spartan_BR_Action_Configuration_Detail entity) { int rta; try { var paramUpdActionConfigurationId = _dataProvider.GetParameter(); paramUpdActionConfigurationId.ParameterName = "ActionConfigurationId"; paramUpdActionConfigurationId.DbType = DbType.Int32; paramUpdActionConfigurationId.Value = entity.ActionConfigurationId; var paramUpdAction = _dataProvider.GetParameter(); paramUpdAction.ParameterName = "Action"; paramUpdAction.DbType = DbType.Int32; paramUpdAction.Value = entity.Action; var paramUpdParameter_Name = _dataProvider.GetParameter(); paramUpdParameter_Name.ParameterName = "Parameter_Name"; paramUpdParameter_Name.DbType = DbType.String; paramUpdParameter_Name.Value = entity.Parameter_Name; var paramUpdParameter_Type = _dataProvider.GetParameter(); paramUpdParameter_Type.ParameterName = "Parameter_Type"; paramUpdParameter_Type.DbType = DbType.Int32; if (entity.Parameter_Type == null) { paramUpdParameter_Type.Value = DBNull.Value; } else { paramUpdParameter_Type.Value = entity.Parameter_Type; } var empEntity = _dbContext.ExecuteStoredProcedureList <Spartane.Core.Classes.StoredProcedure.sp_UpdSpartan_BR_Action_Configuration_Detail>("sp_UpdSpartan_BR_Action_Configuration_Detail", paramUpdActionConfigurationId, paramUpdParameter_Name, paramUpdParameter_Type).FirstOrDefault(); rta = Convert.ToInt32(empEntity.ActionConfigurationId); } catch (ExceptionBase ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex.Message, ex); } return(rta); }
public int Insert(Spartane.Core.Classes.Spartan_BR_Action_Configuration_Detail.Spartan_BR_Action_Configuration_Detail entity) { int rta; try { var padreAction = _dataProvider.GetParameter(); padreAction.ParameterName = "Action"; padreAction.DbType = DbType.Int32; padreAction.Value = (object)entity.Action ?? DBNull.Value; var padreParameter_Name = _dataProvider.GetParameter(); padreParameter_Name.ParameterName = "Parameter_Name"; padreParameter_Name.DbType = DbType.String; padreParameter_Name.Value = (object)entity.Parameter_Name ?? DBNull.Value; var padreParameter_Type = _dataProvider.GetParameter(); padreParameter_Type.ParameterName = "Parameter_Type"; padreParameter_Type.DbType = DbType.Int32; padreParameter_Type.Value = (object)entity.Parameter_Type ?? DBNull.Value; var empEntity = _dbContext.ExecuteStoredProcedureList <Spartane.Core.Classes.StoredProcedure.sp_InsSpartan_BR_Action_Configuration_Detail>("sp_InsSpartan_BR_Action_Configuration_Detail", padreAction , padreParameter_Name , padreParameter_Type ).FirstOrDefault(); rta = Convert.ToInt32(empEntity.ActionConfigurationId); } catch (ExceptionBase ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex.Message, ex); } return(rta); }