コード例 #1
0
 /// <summary>Адрес по объекту</summary>
 protected void ObjectAdres(Objecte objecte, bool full)
 {
     CP = new Control_Print();
     if (objecte.Separate)
     {
         DetailsObject details = objecte.Detail;
         if (details.MailAdres.Length > 0)
         {
             Substitute.AddExchange(StaticMark.adres_abonent, details.MailAdres.CutAdres(full), 0);
         }
         else if (details.LegalAdres.Length > 0)
         {
             Substitute.AddExchange(StaticMark.adres_abonent, details.LegalAdres.CutAdres(full), 0);
         }
         else
         {
             MessageBox.Show("Объект имеет индикатор абособленный, но адрес не задан!");
         }
     }
     else
     {
         DetailsClient Details   = objecte.Client.Detail;
         string        Storege   = string.Empty;
         bool          PostAdres = Details.AdresPostID != 0;
         if (PostAdres)
         {
             Substitute.AddExchange(StaticMark.adres_abonent, Helpers.LogicHelper.AdresLogic.FirstModel(Details.AdresPostID).Adr.CutAdres(full), 0);
         }
         else
         {
             CP.Elems.SetRowFromGrid(MyTools.GL_Auto);
             WrapPanel wp = new WrapPanel();
             wp.Orientation = Orientation.Vertical;
             if (Details.AdresLegalID > 0)
             {
                 RadioButton AdresLegal = new RadioButton();
                 AdresLegal.Content  = Helpers.LogicHelper.AdresLogic.FirstModel(Details.AdresLegalID).Adr;
                 AdresLegal.Checked += (sender, e) => { Storege = AdresLegal.Content.ToString(); };
                 wp.Children.Add(AdresLegal);
             }
             RadioButton AdresObj = new RadioButton();
             AdresObj.Content  = objecte.Adres;
             AdresObj.Checked += (sender, e) => { Storege = objecte.Adres; };
             wp.Children.Add(AdresObj);
             CP.Elems.SetFromGrid(wp);
             CP.ShowDialog();
         }
         if (!PostAdres)
         {
             Substitute.AddExchange(StaticMark.adres_abonent, Storege.CutAdres(full), 0);
         }
     }
 }
コード例 #2
0
        /// <summary>Наименование клиента</summary>
        protected void ClientName(Client client, bool TypeClient = true)
        {
            DetailsClient Details = client.Detail;
            string        Storege = TypeClient ? client.TypeClient.InCase[(int)MyTools.ECases.Dative].Default + "\n" : string.Empty;

            switch (client.TypeClient.typeClient)
            {
            case data.ETypeClient.Individual:
            case data.ETypeClient.Physical:
            {
                Storege += TypeClient ? Details.NameInDative : Details.FullName;
                break;
            }

            case data.ETypeClient.Legal:
            {
                Storege += Details.FullName;
                break;
            }
            }
            Substitute.AddExchange(StaticMark.abonent, Storege, 1);
        }
コード例 #3
0
        public async Task <IActionResult> Details(int Id)
        {
            var client = _context.Client
                         .Include(c => c.Address).
                         SingleOrDefault(c => c.Id == Id);

            if (client == null)
            {
                return(NotFound());
            }

            DetailsClient model = new DetailsClient
            {
                Id           = client.Id,
                Name         = client.Name,
                EmailAddress = client.Email,
                Address      = client.Address,
                MainContact  = client.MainContact,
                Phone        = client.Phone
            };

            return(View("ClientDetailView", model));
        }
コード例 #4
0
        public Dictionary <string, string[]> GetDetails(string address, string citystatezip)
        {
            XDocument doc       = null;
            string    link      = null;
            string    homeValue = null;

            try
            {
                doc       = GetSearchResults(address, citystatezip);
                link      = doc.Descendants("homedetails").First().Value.Substring(34);
                homeValue = doc.Descendants("zestimate").First().Descendants("amount").First().Value;
                doc       = null;
            }
            catch
            {
                if (doc.Descendants("code").Last().Value == "508")
                {
                    Logger.Enqueue(
                        new LogUpdate(
                            "Zillow",
                            EntryType.ERROR,
                            "NOT FOUND",
                            address + ", " + citystatezip
                            )
                        );
                }
                else
                {
                    throw new Exception();
                }

                return(null);
            }


            link = DetailsClient.Execute(new RestRequest(link, Method.GET)).Content;

            link = link.Substring(link.IndexOf("fios-scroll-tracker"));
            link = link.Substring(0, link.IndexOf("additional-links-left"));

            /*MatchCollection matchesTemp = Regex.Matches(
             *  link, PropertyInfoPat,
             *  RegexOptions.IgnoreCase,
             *  REGEX_TIMEOUT
             * );*/

            List <KeyValuePair <string, string> > matches = Regex.Matches(
                link, PropertyInfoPat,
                RegexOptions.None,
                REGEX_TIMEOUT
                ).Cast <Match>().Select(
                m => new KeyValuePair <string, string>(m.Groups[1].Value, m.Groups[2].Value)
                ).ToList();

            link = null;
            matches.Add(new KeyValuePair <string, string>("HomeValue", homeValue));
            homeValue = null;

            int index = matches.FindIndex(m => m.Value.Contains(':') && m.Value.Length > 35);

            if (index >= 0)
            {
                string dictionary = matches[index].Value;
                matches.RemoveAt(index);
                matches.Concat(
                    dictionary.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
                    .ToList().FindAll(f => f.Contains(':'))
                    .Select(f => f.Split(':'))
                    .Select(f => new KeyValuePair <string, string>(f[0], f[1]))
                    );
                dictionary = null;
            }

            return(matches.GroupBy(
                       m => rgxAlphaNumeric.Replace(m.Key, ""),
                       m => m.Value
                       ).ToDictionary(
                       g => g.Key,
                       g => g.OrderByDescending(v => v.Length).ToArray()
                       ));
        }