Example #1
0
 private string getClientName(ClientVendor thisClientVendor, List <Client> clientList, string clientName)
 {
     for (var i = 0; i < clientList.Count; i++)
     {
         Client thisClient = clientList[i];
         if (thisClient.Id == thisClientVendor.ClientId)
         {
             clientName = thisClient.Name;
         }
     }
     return(clientName);
 }
Example #2
0
        private List <ClientVendor> FindClientVendor(List <ClientVendor> clientVendorsRel)
        {
            using (InfrastructureEntities context = new InfrastructureEntities())
            {
                var result = context.ClientVendorRels.Select(x => x).OrderBy(x => x.SourceName).ToList();

                foreach (var obj in result)
                {
                    ClientVendor clientVendor = new ClientVendor();
                    clientVendor.Id          = obj.Id;
                    clientVendor.ClientId    = obj.ClientId;
                    clientVendor.VendorId    = obj.VendorId;
                    clientVendor.SourceName  = obj.SourceName;
                    clientVendor.Enabled     = obj.Enabled;
                    clientVendor.CreatedTime = obj.CreatedTime;
                    clientVendorsRel.Add(clientVendor);
                }
            }
            return(clientVendorsRel);
        }
Example #3
0
        private List <object> GetClientVendorRel(List <Vendor> vendorList, List <Client> clientList, List <object> clientVendorList)
        {
            string vendorName, clientName = "";
            List <ClientVendor> clientVendorsRel = new List <ClientVendor>();

            FindClientVendor(clientVendorsRel);

            for (var r = 0; clientVendorsRel.Count > r; r++)
            {
                ClientVendor thisClientVendor = clientVendorsRel[r];

                if (thisClientVendor.VendorId != 0)
                {
                    for (var v = 0; vendorList.Count > v; v++)
                    {
                        Vendor  thisVendor = vendorList[v];
                        AuthKey authKey    = new AuthKey();
                        if (thisClientVendor.VendorId == thisVendor.Id)
                        {
                            string key = authKey.GetAuthKey(thisClientVendor.Id);
                            vendorName = thisVendor.VendorName;
                            clientName = getClientName(thisClientVendor, clientList, clientName);

                            var clientVendorInfo = new
                            {
                                vendorName,
                                clientName,
                                authKey = key
                            };
                            clientVendorList.Add(clientVendorInfo);
                        }
                    }
                }
            }
            return(clientVendorList);
        }