Ejemplo n.º 1
0
 public static int GetMADFees(int amount, out string error)
 {
     error = "";
     try
     {
         int frais = new ExWebSvc4Mad.ExWebSvcSoapClient().GetFrais(amount);
         return(frais);
     }
     catch (Exception ex)
     {
         error = ExceptionHelper.GetExceptionMessage(ex);
         return(0);
     }
 }
Ejemplo n.º 2
0
 public static string FindCustomerMad(ref KoloWin.CustomerService.Model.KoloMadCustomer madCustomer, out string error)
 {
     error = "";
     try
     {
         ExWebSvc4Mad.ExWebSvcSoapClient exWeb         = new ExWebSvc4Mad.ExWebSvcSoapClient();
         ExWebSvc4Mad.KoloMadCustomer    wsMadCustomer = exWeb.GetKoloMadCustomer(madCustomer.WsKoloMadCustomer());
         madCustomer = new KoloWin.CustomerService.Model.KoloMadCustomer(wsMadCustomer);
     }
     catch (Exception ex)
     {
         error = ExceptionHelper.GetExceptionMessage(ex);
     }
     return("");
 }
Ejemplo n.º 3
0
 public static string FindManagerCustomerByCustomerCode(string customerCode, out string error)
 {
     error = "";
     try
     {
         ExWebSvc4Mad.ExWebSvcSoapClient exWeb = new ExWebSvc4Mad.ExWebSvcSoapClient();
         string client = exWeb.GetClient(customerCode, "");
         if (client == null || client == "")
         {
             error = "Aucune Client trouvé";
             return("");
         }
         return(client);
     }
     catch (Exception ex)
     {
         error = ExceptionHelper.GetExceptionMessage(ex);
         return("");
     }
 }
Ejemplo n.º 4
0
 public static KoloWin.CustomerService.Model.KoloMadDetails DoSendMad(ref KoloWin.CustomerService.Model.KoloMadDetails koloMadDetails, out string error)
 {
     error = "";
     try
     {
         var Context = new KoloAndroidEntities();
         ExWebSvc4Mad.KoloMadDetails wsKoloMadDetails = new ExWebSvc4Mad.ExWebSvcSoapClient().SendKoloMad(koloMadDetails.WsKoloMadDetails());
         if (wsKoloMadDetails != null)
         {
             Model.KoloMadDetails.KoloMadDetailsFromWs(ref koloMadDetails, wsKoloMadDetails);
             TransferGravity transfertGravity = koloMadDetails.GenerateTransferGravity();
             Tuple <List <KoloNotification>, List <CustomerBalanceHistory> > tuple = OperationHelper.MakeOperation <TransferGravity>(transfertGravity, Context, out error);
             Context.KoloNotifications.AddRange(tuple.Item1);
             Context.CustomerBalanceHistories.AddRange(tuple.Item2);
             Context.TransferGravities.Add(transfertGravity);
             Context.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         error = ExceptionHelper.GetExceptionMessage(ex);
     }
     return(koloMadDetails);
 }
Ejemplo n.º 5
0
        public TransferGravity GenerateTransferGravity()
        {
            TransferGravity transferGravity = new TransferGravity();

            ExWebSvc4Mad.KoloMadCustomer reciever = new ExWebSvc4Mad.ExWebSvcSoapClient().GetKoloMadCustomer(new ExWebSvc4Mad.KoloMadCustomer()
            {
                IdClient = this.ReceiverId
            });

            transferGravity.Amount              = this.Amount;
            transferGravity.GravityReceiverId   = this.ReceiverId;
            transferGravity.GravityReference    = this.Reference;
            transferGravity.GravitySenderId     = this.SenderId;
            transferGravity.KoloReference       = this.Reference;
            transferGravity.KoloSenderId        = this.CustomerId;
            transferGravity.Received            = true;
            transferGravity.ReceiverFirstName   = reciever.Nom;
            transferGravity.ReceiverLastName    = reciever.Prenom;
            transferGravity.ReceiverPhoneNumber = reciever.Number;
            transferGravity.TransferMadId       = this.MadId;


            return(transferGravity);
        }