public long Add(ClientEditData client, long userId, long transitId) { return(_executor.Query <long>("[dbo].[Client_Add]", new { client.BIC, client.Bank, client.Contacts, client.Emails, client.INN, client.KPP, client.KS, client.LegalAddress, client.LegalEntity, client.MailingAddress, client.Nic, client.OGRN, client.Phone, client.RS, UserId = userId, TransitId = transitId, client.ContractDate, client.ContractNumber, client.DefaultSenderId, client.FactureCost, client.FactureCostEx, client.TransitCost, client.PickupCost, client.InsuranceRate, client.TariffPerKg, client.ScotchCostEdited, client.Comments })); }
public long Add(string name, string login, string password, string email, string language) { var salt = _converter.GenerateSalt(); var passwordHash = _converter.GetPasswordHash(password, salt); return(_executor.Query <long>("[dbo].[Forwarder_Add]", new { login, PasswordHash = passwordHash, PasswordSalt = salt, language, name, email })); }
public long Add(StateEditData data) { using (var scope = new TransactionScope()) { var id = _executor.Query <long>("[dbo].[State_Add]", new { data.Name, data.Position, IsSystem = false, }); _executor.Execute("[dbo].[StateLocalization_Merge]", new { Name = data.LocalizedName, TwoLetterISOLanguageName = data.Language, StateId = id }); scope.Complete(); return(id); } }
public Setting AddOrReplace(Setting setting) { try { var rowVersion = _executor.Query <byte[]>("[dbo].[Setting_Merge]", setting); return(new Setting { Data = setting.Data, RowVersion = rowVersion, Type = setting.Type }); } catch (DublicateException e) { throw new UpdateConflictException("Failed to merge setting " + setting.Type, e); } }
public EventData GetNext(EventType type, int partitionId) { return(_executor.Query <EventData>( "[dbo].[Event_GetNext]", new { EventTypeId = type, partitionId })); }
public long Add(TransitData transit) { if (transit.Id > 0) { throw new InvalidDataException("Id should be undefined"); } return(_executor.Query <long>("[dbo].[Transit_Add]", new { transit.Address, transit.Phone, transit.CarrierId, transit.CityId, transit.DeliveryType, transit.MethodOfTransit, transit.RecipientName, transit.WarehouseWorkingTime })); }
public long Add(string name, string email, string phone, string contact, string address, string login, string password, string language) { var salt = _converter.GenerateSalt(); var passwordHash = _converter.GetPasswordHash(password, salt); return(_executor.Query <long>("[dbo].[Carrier_Add]", new { login, PasswordHash = passwordHash, PasswordSalt = salt, language, name, email, phone, contact, address })); }
public long Add(ApplicationEditData application) { var entity = new DbContext.Application(); Map(application, entity); entity.StateId = _defaultStateId; entity.StateChangeTimestamp = DateTimeProvider.Now; entity.DisplayNumber = _executor.Query <int>("[dbo].[GetNextDisplayNumber]"); entity.CreationTimestamp = DateTimeProvider.Now; _context.Applications.InsertOnSubmit(entity); _context.SaveChanges(); return(entity.Id); }
public long Add(string englishName, string russianName, int position) { return(_executor.Query <long>("[dbo].[Country_Add]", new { englishName, russianName, position })); }
public long?GetByUserId(long userId) { return(_executor.Query <long?>("[dbo].[Sender_GetByUser]", new { userId })); }
public BillData Get(long applicationId) { return(_executor.Query <BillData>("[dbo].[Bill_GetByApplicationId]", new { applicationId })); }
public decimal GetBalance(long clientId) { return(_executor.Query <decimal>("[dbo].[Client_GetBalance]", new { clientId })); }
public CalculationData GetByApplication(long applicationId) { return(_executor.Query <CalculationData>("[dbo].[Calculation_GetByApplication]", new { applicationId })); }
public UserData Get(long userId) { return(_executor.Query <UserData>("[dbo].[User_Get]", new { userId })); }
public EmailMessageData GetNext(EmailMessageState state, int partitionId) { return(_executor.Query <EmailMessageData>("[dbo].[EmailMessage_GetNext]", new { state, partitionId })); }
public FileHolder GetClientContract(long clientId) { return(_executor.Query <FileHolder>("[dbo].[ClientContract_Get]", new { clientId })); }
public FileHolder Get(long id) { return(_executor.Query <FileHolder>("[dbo].[AwbFile_Get]", new { id })); }
public EventTemplateData GetByEventType(EventType eventType) { return(_executor.Query <EventTemplateData>("[dbo].[EmailTemplate_GetByEvent]", new { EventTypeId = (int)eventType })); }