Example #1
0
 public void Update(long clientId, ClientEditData client)
 {
     _executor.Query <long>("[dbo].[Client_Update]",
                            new
     {
         clientId,
         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,
         client.ContractDate,
         client.ContractNumber,
         client.DefaultSenderId,
         client.FactureCost,
         client.FactureCostEx,
         client.TransitCost,
         client.PickupCost,
         client.InsuranceRate,
         client.TariffPerKg,
         client.ScotchCostEdited,
         client.Comments
     });
 }
Example #2
0
 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
     }));
 }
Example #3
0
        private void Update(
            long clientId, ClientEditData clientEditData,
            long transitId, TransitEditModel transit,
            long userId, AuthenticationModel authentication)
        {
            using (var ts = new TransactionScope())
            {
                _transits.Update(transitId, transit, null, null);

                _clients.Update(clientId, clientEditData);

                _users.SetLogin(userId, authentication.Login);

                if (!string.IsNullOrWhiteSpace(authentication.NewPassword))
                {
                    _users.SetPassword(userId, authentication.NewPassword);
                }

                ts.Complete();
            }
        }
Example #4
0
 private string GetSenderName(ClientEditData client)
 {
     return(client.DefaultSenderId.HasValue
                         ? _senders.Get(client.DefaultSenderId.Value).Name
                         : null);
 }
Example #5
0
 private void BindBagWithClient(ClientEditData client)
 {
     ViewBag.Nic = client.Nic;
     BindCountries();
 }