public void UpdateCustomPriceColumn(int customPriceColumnId, string customPriceColumnName, string customPriceColumnDescription, int entityId, IndustryTypes industryTypeId, EntityTypes entityTypeId, CustomPriceColumnTypes customPriceColumnTypeId, string systemUserName, string actorName) { using (IDbConnection conn = Connection) { var query = @"UPDATE [TSO].[dbo].[CustomPriceColumn] SET [EntityID] = @entityId ,[EntityTypeID] = @entityTypeId ,[CustomPriceColumnTypeID] = @customPriceColumnTypeId ,[IndustryTypeID] = @industryTypeId ,[CustomPriceColumnName] = @customPriceColumnName ,[CustomPriceColumnDescription] = @customPriceColumnDescription ,[LastUpdatedDateTime] = getdate() WHERE [CustomPriceColumnID] = @customPriceColumnId"; conn.Execute(query, new { customPriceColumnId, entityId, entityTypeId, customPriceColumnTypeId, industryTypeId, customPriceColumnName, customPriceColumnDescription, actorName, systemUserName }); } }
public int CreateCustomPriceColumn(string customPriceColumnName, string customPriceColumnDescription, int entityId, int createdByUserId, string countryCode, IndustryTypes industryTypeId, EntityTypes entityTypeId, CustomPriceColumnTypes customPriceColumnTypeId, string systemUserName, string actorName) { using (IDbConnection conn = Connection) { var query = @"INSERT INTO [TSO].[dbo].[CustomPriceColumn] ([EntityID] ,[EntityTypeID] ,[CustomPriceColumnTypeID] ,[CreatedByUserID] ,[IndustryTypeID] ,[CountryCode] ,[CustomPriceColumnName] ,[CustomPriceColumnDescription] ,[CreatedDateTime] ,[LastUpdatedDateTime] ,[ActorName] ,[SystemUserName]) VALUES (@entityId ,@entityTypeId ,@customPriceColumnTypeId ,@createdByUserId ,@industryTypeId ,@countryCode ,@customPriceColumnName ,@customPriceColumnDescription ,getdate() ,getdate() ,@actorName ,@systemUserName); SELECT CAST(SCOPE_IDENTITY() as int)"; return(conn.ExecuteScalar <int>(query, new { entityId, entityTypeId, customPriceColumnTypeId, createdByUserId, industryTypeId, countryCode, customPriceColumnName, customPriceColumnDescription, actorName, systemUserName })); } }