Beispiel #1
0
 public Lead(DTO_Lead lead)
 {
     this._leadID            = lead.LeadID;
     this._leadTypeID        = lead.LeadTypeID;
     this._knockerResponseID = lead.KnockerResponseID;
     this._salespersonID     = lead.SalesPersonID;
     this._customerID        = lead.CustomerID;
     this._addressID         = lead.AddressID;
     this._leadDate          = lead.LeadDate;
     this._status            = lead.Status;
     this._creditToID        = lead.CreditToID;
     this._temperature       = lead.Temperature;
 }
        public async Task GetLeadByLeadID(DTO_Lead token)
        {
            try
            {
                var response = await client.PostAsJsonAsync(string.Format(@"{0}{1}", URL, "GetLeadByLeadID"),
                                                            token);

                response.EnsureSuccessStatusCode();
                Lead = await response.Content.ReadAsAsync <DTO_Lead>();
            }
            catch (Exception ex)
            {
            }
        }
        public async Task DoMoreWork(int leadIDSelection)
        {
            DTO_Lead token = new DTO_Lead
            {
                LeadID = leadIDSelection,
            };

            var response = await client.PostAsJsonAsync(string.Format(@"{0}{1}", URL, "GetLeadByLeadID"),
                                                        token);

            response.EnsureSuccessStatusCode();
            Lead = await response.Content.ReadAsAsync <DTO_Lead>();

            response = await client.PostAsJsonAsync(string.Format(@"{0}{1}", URL, "GetCustomerByID"),
                                                    new DTO_Customer { CustomerID = Lead.CustomerID });

            response.EnsureSuccessStatusCode();
            Cust = await response.Content.ReadAsAsync <DTO_Customer>();
        }
Beispiel #4
0
 async public Task <string> UpdateLead(DTO_Lead token)
 {
     Lead = JsonConvert.DeserializeObject <DTO_Lead>(await MakeRequest(token, "UpdateLead"));
     return(Lead.Message);
 }
Beispiel #5
0
 async public Task <string> GetLeadByLeadID(DTO_Lead token)
 {
     Lead = JsonConvert.DeserializeObject <DTO_Lead>(await MakeRequest(token, "GetLeadByLeadID"));
     return(Lead.Message);
 }
        async private void GetCustomerDetailsByLeadID(int leadID)
        {
            DTO_Lead     ld = new DTO_Lead();
            DTO_Customer cu = new DTO_Customer();
            DTO_Address  ad = new DTO_Address();

            ld.LeadID = leadID;
            await s1.GetLeadByLeadID(ld);

            ld            = s1.Lead;
            ad.AddressID  = ld.AddressID;
            cu.CustomerID = ld.CustomerID;
            await s1.GetCustomerByID(cu);

            await s1.GetAddressByID(ad);

            cu           = s1.Cust;
            ad           = s1.Address1;
            FinishedName = "";
            if (cu.FirstName != string.Empty)
            {
                FinishedName += cu.FirstName + " ";
            }

            if (cu.MiddleName != string.Empty)
            {
                FinishedName += cu.MiddleName + " ";
            }

            if (cu.LastName != string.Empty)
            {
                FinishedName += cu.LastName + " ";
            }

            if (cu.Suffix != string.Empty)
            {
                FinishedName += cu.Suffix;
            }

            if (cu.PrimaryNumber != string.Empty)
            {
                leadPriPhoneText.Text = cu.PrimaryNumber;
            }

            if (cu.SecondaryNumber != string.Empty)
            {
                leadSecPhoneText.Text = cu.SecondaryNumber;
            }

            if (cu.Email != string.Empty)
            {
                leadEmailAddressText.Text = cu.Email;
            }

            //MessageBox.Show(FinishedName);
            leadNameText.Text = FinishedName;

            AddressZipcodeValidation citystatefromzip = new AddressZipcodeValidation();
            string citystate = citystatefromzip.CityStateLookupRequest(ad.Zip);

            string city = citystate.Substring(citystate.IndexOf("<City>") + 6, citystate.IndexOf("</City>") - citystate.IndexOf("<City>") - 6);

            string state = AddressZipcodeValidation.ConvertStateToAbbreviation(citystate.Substring(citystate.IndexOf("<State>") + 7, citystate.IndexOf("</State>") - citystate.IndexOf("<State>") - 7));

            leadAddressText.Text = ad.Address.ToString();
            string[] w = city.Split(' ');
            city = "";
            int i = 0;

            foreach (string t in w)
            {
                city += t.Substring(0, 1).ToUpper();
                city += t.Substring(1, t.Length - 1).ToLower();
                if (i > 0)
                {
                    city += " ";
                }
            }



            //	city.ToLower();
            //	TextInfo textinfo = new CultureInfo("en-US", false).TextInfo;
            //	textinfo.ToTitleCase(city);
            //city = Regex.Replace(city, @"(^\w)|(\s\w)", m => m.Value.ToUpper());
            leadCitySTZipText.Text = city + ", " + state + "  " + ad.Zip.ToString();


            ShowOnMap(null, MakeAddress(ad.Address.ToString(), city, state, ad.Zip.ToString()));


            //	this.dTO_LeadDataGrid.ItemsSource = s1.LeadList;
        }