This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Configuration; | |
using Infrastructure.Exceptions; | |
namespace Infrastructure.Services | |
{ | |
public static class Setting | |
{ | |
public static T GetValue<T>(string name) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: FizzBuzz.cs | |
namespace FizzBuzz | |
{ | |
using Domain.Validators; | |
using Infrastructure.Printing; | |
using System.Collections.Generic; | |
internal class FizzBuzz | |
{ | |
private static IList<IValidator> Validators = new List<IValidator> { new FizzBuzzValidator(), new FizzValidator(), new BuzzValidator() }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF NOT EXISTS (SELECT 1 FROM [INFORMATION_SCHEMA].[TABLE_CONSTRAINTS] WHERE [CONSTRAINT_TYPE] = 'PRIMARY KEY' AND [TABLE_NAME] = 'ShopInventoryPrice') | |
BEGIN | |
ALTER TABLE [ShopInventoryPrice] ADD CONSTRAINT [PK_ShopInventoryPrice] PRIMARY KEY CLUSTERED ([Id]) | |
END | |
GO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text.RegularExpressions; | |
namespace Validators | |
{ | |
public static class EmailValidator | |
{ | |
// http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx | |
private const string Pattern = @"^(?!\.)(""([^""\r\\]|\\[""\r\\])*""|" + @"([-a-z0-9!#$%&'*+/=?^_`{|}~]|(?<!\.)\.)*)(?<!\.)" + @"@[a-z0-9][\w\.-]*[a-z0-9]\.[a-z][a-z\.]*[a-z]$"; | |
private static readonly Regex Validator = new Regex(Pattern, RegexOptions.IgnoreCase); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override bool Equals(object @object) | |
{ | |
var loyaltyBasePrice = @object as LoyaltyBasePrice; | |
if (loyaltyBasePrice == null) | |
{ | |
return false; | |
} | |
return ShopCode.Equals(loyaltyBasePrice.ShopCode) && MATNR.Equals(loyaltyBasePrice.MATNR); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Test | |
{ | |
public static class Message | |
{ | |
public const string FizzBuzz = "FizzBuzz"; | |
public const string Fizz = "Fizz"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * INTO [LoyaltyCardCategoryCopy] FROM [LoyaltyCardCategory] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF (NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'Deliverers')) | |
BEGIN | |
CREATE TABLE [Deliverers] | |
( | |
[Id] INT IDENTITY (1, 1), | |
[FirstName] NVARCHAR (100) NOT NULL, | |
[LastName] NVARCHAR (100) NOT NULL, | |
[Phone] NVARCHAR (20) NOT NULL, | |
[Capability] DECIMAL(3,1) NOT NULL, | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF EXISTS(SELECT 1 FROM [sys].[tables] WHERE [name] = 'FavoriteProducs') | |
BEGIN | |
EXEC sp_RENAME 'FavoriteProducs' , 'FavoriteInventories' | |
END | |
GO |
NewerOlder