예제 #1
0
 public ExigoGetCustomers()
 {
     ContactList    = new List <ExigoContact>();
     ApiContext     = ExigoApiContext.CreateWebServiceContext();
     KnownWebAlais  = new List <int>();
     LastMethodUsed = "NA";
 }
예제 #2
0
    public static void AddItemsinCategory()
    {
        List <int> lst = new List <int>();

        lst.Add(186);
        lst.Add(183);
        lst.Add(187);
        lst.Add(188);
        lst.Add(189);
        lst.Add(216);

        foreach (int i in lst)
        {
            var categoryitems = ExigoApiContext.CreateWebServiceContext().GetItems(new GetItemsRequest()
            {
                CurrencyCode = "usd", LanguageID = 0, PriceType = 2, WarehouseID = 5, WebCategoryID = i, WebID = 1
            });
            List <string> items = new List <string>();
            foreach (ItemResponse res in categoryitems.Items)
            {
                items.Add(res.ItemCode);
            }
            var resus = ExigoApiContext.CreateWebServiceContext().AddProductsToCategory(new AddProductsToCategoryRequest()
            {
                CategoryID = 220, ItemCodes = items.ToArray(), WebID = 1
            });
            var resca = ExigoApiContext.CreateWebServiceContext().AddProductsToCategory(new AddProductsToCategoryRequest()
            {
                CategoryID = 221, ItemCodes = items.ToArray(), WebID = 1
            });
        }
    }
예제 #3
0
 private void UpdateExigo(int ExigoID, Guid CrmID)
 {
     ExigoApiContext.CreateWebServiceContext().UpdateCustomer(new ExigoDesktop.Exigo.WebService.UpdateCustomerRequest()
     {
         CustomerID = ExigoID,
         Field8     = CrmID.ToString()
     });
 }
예제 #4
0
    public static void AddItemsIntoCategoryAndSetPrice()
    {
        Dictionary <int, int> dict = new Dictionary <int, int>();

        /*  dict.Add(186, 193);
        *  dict.Add(213, 214);
        *  dict.Add(187, 194);
        *  dict.Add(185, 192);
        *  dict.Add(188, 195);
        *  dict.Add(183, 190);
        *  dict.Add(184, 191);
        *  dict.Add(189, 196);
        *  //dict.Add(220, 221);
        *  //dict.Add(216, 217);*/

        dict.Add(220, 221);
        string catfaileditems = "", costfaileditem = "";

        foreach (var d in dict)
        {
            var items = ExigoApiContext.CreateWebServiceContext().GetItems(new GetItemsRequest()
            {
                CurrencyCode = "usd", LanguageID = 0, PriceType = 2, RestrictToWarehouse = true, WarehouseID = 5, WebCategoryID = d.Key, WebID = 1
            });
            List <string> itemcodes = new List <string>();

            foreach (ItemResponse r in items.Items)
            {
                itemcodes.Add(r.ItemCode);
                try
                {
                    var res1 = ExigoApiContext.CreateWebServiceContext().SetItemPrice(new SetItemPriceRequest()
                    {
                        BusinessVolume = r.BusinessVolume, CommissionableVolume = r.CommissionableVolume, CurrencyCode = "cad", ItemCode = r.ItemCode, Price = (r.Price * 1.3M), PriceType = 2, ShippingPrice = r.ShippingPrice * 1.3M, TaxablePrice = r.TaxablePrice * 1.3M
                    });
                }
                catch (Exception ex)
                {
                    costfaileditem = costfaileditem + " , " + r.ItemCode;
                }
            }

            try
            {
                // var res = ExigoApiContext.CreateWebServiceContext().AddProductsToCategory(new AddProductsToCategoryRequest() { CategoryID = d.Value, WebID = 1, ItemCodes = itemcodes.ToArray() });
            }
            catch (Exception ex)
            {
                catfaileditems = catfaileditems + " , " + d.Key;
            }
        }

        HttpContext.Current.Response.Write("Failed items in Seeting price are " + costfaileditem);
        HttpContext.Current.Response.Write("Failed Categories in Seeting Category are " + catfaileditems);
    }
예제 #5
0
 public void ExecuteUpdate()
 {
     foreach (var crmContact in CrmContactsWithFrezzorIDs)
     {
         if (WithoutGuid.Where(c => c.ExigoID == crmContact.new_FREZZORID).FirstOrDefault() != null)
         {
             var exigoContact = WithoutGuid.Where(c => c.ExigoID == crmContact.new_FREZZORID).FirstOrDefault();
             exigoContact.CrmGuid = crmContact.Id.ToString();
             var response = ExigoApiContext.CreateWebServiceContext().UpdateCustomer(new UpdateCustomerRequest()
             {
                 CustomerID = exigoContact.ExigoID,
                 Field8     = exigoContact.CrmGuid
             });
         }
     }
 }
예제 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var res = ExigoApiContext.CreateWebServiceContext().GetItems(new GetItemsRequest()
        {
            CurrencyCode = "usd", LanguageID = 0, PriceType = 2, WarehouseID = 6, WebID = 1, WebCategoryID = 362
        });
        var orderapi1 = ExigoApiContext.CreateWebServiceContext().GetOrders(new GetOrdersRequest()
        {
            OrderIDs = new int[] { 5202177, 5202178 }
        });
        List <OrderDetailRequest> detail = new List <OrderDetailRequest>();

        detail.Add(new OrderDetailRequest()
        {
            ItemCode = "1121x", Quantity = 1
        });
        var res1 = ExigoApiContext.CreateWebServiceContext().CalculateOrder(new CalculateOrderRequest()
        {
            CurrencyCode = "eur", PriceType = 8, WarehouseID = 1, ShipMethodID = 8, State = "AT", Country = "AT", Details = detail.ToArray()
        });

        //var res = client.CreateCustomerLead("dwBhAGsAYQB5AGEAfAB3AGEAawBhAHkAYQB8AHcAYQBrAGEAeQBhAA==", new WSIAPI.CreateCustomerLeadRequest{ FirstName="test", LastName="lead", Email="*****@*****.**", Company="test company", Phone="1234567890", Phone2="0987654321", Notes="test wakaya lead from replicated site", CustomerID=3 });
        // <add name="sqlreporting" connectionString="Data Source=bi.exigo.com;Initial Catalog=SouthHillReporting;Persist Security Info=True;User ID=SHD_User1;Password=V7UH6ejN;Pooling=False;Connect Timeout=500000" providerName="System.Data.SqlClient"/>

        // var res = ExigoApiContext.CreateWebServiceContext().GetCustomers(new Exigo.GetCustomersRequest() { Email  = "*****@*****.**" });
        //   var res = ExigoApiContext.CreateWebServiceContext().SetAccountDirectDeposit(new Exigo.SetAccountDirectDepositRequest() { CustomerID = 1266992, BankAccountNumber = "0987654321", BankAccountType = Exigo.BankAccountType.CheckingPersonal, BankCountry = "KR", BankName = "test bank name", NameOnAccount = "test name on account", DepositAccountType = Exigo.DepositAccountType.Checking });
        //var res = ExigoApiContext.CreateWebServiceContext().GetAccountDirectDeposit(new Exigo.GetAccountDirectDepositRequest() { CustomerID=1266992 });
        //string ivkey = "V2r@$z0(!^1ivkey", key = "18q2hth0746gw19gf4942xap028zqoin", text="test|me|5";
        //var res = Encrypt(text, key, ivkey);
        //var res1 = Decrypt(res, key, ivkey);
        // var res = ExigoApiContext.CreateWebServiceContext().GetCustomers(new Exigo.GetCustomersRequest() { CustomerID = 1 });

        //var getorders = ExigoApiContext.CreateWebServiceContext().GetOrders(new GetOrdersRequest() { OrderID = 5192480 });
        //  var res = ExigoApiContext.CreatePaymentContext().FetchCreditCardToken("4111111111111111", 9,2018);
        //  var res = ExigoApiContext.CreateWebServiceContext().GetItems(new GetItemsRequest() { ItemCodes = new string[] { "USYG239001" },WarehouseID=5,CurrencyCode="usd",PriceType=2 });
        // var res1 = ExigoApiContext.CreateWebServiceContext().GetItems(new GetItemsRequest() { WarehouseID=5, LanguageID=0, CurrencyCode="usd", PriceType=2,RestrictToWarehouse=true  , WebCategoryID=220, WebID=1  });
        //var res = ExigoApiContext.CreateWebServiceContext().SetItemImage(new SetItemImageRequest() { ItemCode = "USAN200001", SmallImageName = "https://buyygy.com/90forLifeStore/content/images/thumbs/0005036_anthology-13-x-8-cutting-mat.jpeg" });
        //   gettotalitemcount();
        //var res = ExigoApiContext.CreateWebServiceContext().GetCustomerSite(new GetCustomerSiteRequest() { CustomerID=71280});   //List<string> lst = new List<string>();
        //lst.Add("USML9021");
        //lst.Add("USML0021");
        //lst.Add("USML0022");
        //var res = ExigoApiContext.CreateWebServiceContext().GetItems(new GetItemsRequest() { LanguageID=0, CurrencyCode="usd", PriceType=2, WarehouseID=5, ItemCodes= lst.ToArray(),RestrictToWarehouse=true,ReturnLongDetail=true ,WebCategoryID=183,WebID=1 });
        //var res = ExigoApiContext.CreateWebServiceContext().ChangeOrderStatus(new ChangeOrderStatusRequest() { OrderID= 67200, OrderStatus= OrderStatusType.Printed  });
        // var res = ExigoApiContext.CreateWebServiceContext().UpdateCustomer(new UpdateCustomerRequest() { CustomerID = 71204, CustomerType = 7 });
    }
예제 #7
0
 // delegate void GetAlias(ExigoContact contact);
 private void AssignAlias(ExigoContact contact)
 {
     if (contact.CustomerType == ExigoCustomerType.Independant)
     {
         try
         {
             contact.WebAlias = ExigoApiContext.CreateWebServiceContext().GetCustomerSite(new GetCustomerSiteRequest()
             {
                 CustomerID = contact.ExigoID
             }).WebAlias;
             KnownWebAlais.Add(contact.ExigoID);
         }
         catch
         {
         }
     }
 }
예제 #8
0
        private void AssignEnrollerAlias(ExigoContact contact)
        {
            if (KnownWebAlais.Contains(contact.EnrollerID))
            {
                contact.EnrollerWebAlias = ContactList.Where(c => c.ExigoID == contact.EnrollerID).Select(c => c.WebAlias).FirstOrDefault();
            }
            else
            {
                try
                {
                    contact.EnrollerWebAlias = ExigoApiContext.CreateWebServiceContext().GetCustomerSite(new GetCustomerSiteRequest()
                    {
                        CustomerID = contact.EnrollerID
                    }).WebAlias;
                }

                catch { }
            }
        }
예제 #9
0
        private void LocateTermCrmAccount(ExigoContact eContact)
        {
            var crmAccountList = SearchForContact(eContact.GetGUID(), eContact.FirstName, eContact.LastName);

            if (crmAccountList.Count() > 0)
            {
                var crmAccount = crmAccountList.FirstOrDefault();
                if (crmAccount.Id == eContact.GetGUID() && crmAccount.FirstName == eContact.FirstName && crmAccount.LastName == eContact.LastName)
                {
                    crmContext.Update(new Contact()
                    {
                        Id         = eContact.GetGUID(),
                        New_Status = (int)eContact.Status,
                        New_Type   = (int)CrmCustomerType.Prospect
                    });
                }
            }
            ExigoApiContext.CreateWebServiceContext().UpdateCustomer(new ExigoDesktop.Exigo.WebService.UpdateCustomerRequest()
            {
                CustomerID = eContact.ExigoID,
                Field8     = string.Empty
            });
        }
예제 #10
0
    public static void ImportImages()
    {
        var ds         = new DataSet("CSV File");
        var filename   = @"c:\Customer.csv";
        var connString = string.Format(
            @"Provider=Microsoft.Jet.OleDb.4.0; Data Source={0};Extended Properties=""Text;HDR=YES;FMT=Delimited""",
            Path.GetDirectoryName(filename)
            );

        using (var conn = new OleDbConnection(connString))
        {
            conn.Open();
            var query = "SELECT * FROM [" + Path.GetFileName(filename) + "]";
            using (var adapter = new OleDbDataAdapter(query, conn))
            {
                adapter.Fill(ds);
            }
        }
        string erroritemcodes = "";

        var res = ds.Tables[0];

        foreach (DataRow dr in res.Rows)
        {
            var res1 = new UpdateCustomerResponse();
            try
            {
                res1 = ExigoApiContext.CreateWebServiceContext().UpdateCustomer(new UpdateCustomerRequest()
                {
                    CustomerID = dr["CustomerID"].ToString().ToInt(), CustomerStatus = dr["CustomerStatus"].ToString().ToInt()
                });
            }
            catch (Exception ex)
            {
            }
        }
    }