public async Task <IActionResult> PutLeads(long id, Leads leads) { if (id != leads.Id) { return(BadRequest()); } _context.Entry(leads).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LeadsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Leads> > PostLeads(Leads Leads) { _context.Leads.Add(Leads); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLeads", new { id = Leads.id }, Leads)); }
private void UpdateInterface(object sender, SizeChangedEventArgs e) { drawBrush = Brushes.Green; lblLead.Foreground = drawBrush; lblLead.Content = App.Language.Dictionary [Leads.LookupString(wfStrip.Lead.Value, true)]; }
public static bool CheckForDuplicate(Leads lead) { bool isDuplicate = false; var duplicates = from x in DbContextHelper.DbContext.Leads where (x.InsuredName == lead.InsuredName.Trim()) && (x.MailingAddress == lead.MailingAddress.Trim()) && (x.MailingAddress2 == lead.MailingAddress2.Trim()) && (x.MailingState == lead.MailingState.Trim()) && // state abbrev, FL (x.MailingCity == lead.MailingCity.Trim()) && (x.MailingZip == lead.MailingZip.Trim()) group x by new { x.InsuredName, x.MailingAddress, x.MailingAddress2, x.MailingState, x.MailingCity, x.MailingZip } into g select g; isDuplicate = duplicates.Any(x => x.Count() > 1); return(isDuplicate); }
public async Task <IActionResult> Convert(int id) { // Currently there the lead is not being deleted. if (ModelState.IsValid) { Leads CurrentLead = await _db.Leads.FirstAsync(c => c.Id == id); Customers NewCust = new Customers(); NewCust.CompanyName = CurrentLead.CompanyName; NewCust.ContactName = CurrentLead.ContactName; NewCust.AddressLine = CurrentLead.AddressLine; NewCust.CityRegion = CurrentLead.CityRegion; NewCust.CustomerSince = DateTime.Now; NewCust.EmailAddress = CurrentLead.EmailAddress; NewCust.MobileNumber = CurrentLead.MobileNumber; NewCust.OfficeAddress = CurrentLead.OfficeAddress; NewCust.PostCode = CurrentLead.PostCode; NewCust.TelephoneNumber = CurrentLead.TelephoneNumber; NewCust.Website = CurrentLead.Website; NewCust.WasLead = true; NewCust.Vat = CurrentLead.Vat; _db.Customers.Add(NewCust); TempData["Message"] = CurrentLead.CompanyName + " has been converted successfully!"; _db.Leads.Remove(CurrentLead); await _db.SaveChangesAsync(); return(RedirectToAction("Index", "Customers")); } return(View()); }
public override async Task <BusinessValidationResult> ValidateAsync(Leads lead) { var isDublicate = await _leadReader.IsLeadDublicateAsync(lead); if (isDublicate) { return(ReturnValidationResult(LeadStatus.Dublicate)); } var location = await _locationReader.GetLocationByZipAsync(lead.Zip, lead.PageId); if (location == null) { return(ReturnValidationResult(LeadStatus.WrongLocation)); } if (location.Campaing.ClientType != ClientId.FMR) { return(ReturnValidationResult(LeadStatus.WrongLocation)); } return(new BusinessValidationResult { IsSuccess = true }); }
private async Task LoadProjectLeads() { if (IsBusy) { return; } IsBusy = true; try { Leads.Clear(); var projectLeads = await ApiClient.Instance.GetProjectLeads(Project.uuid); foreach (var lead in projectLeads) { Leads.Add(new ProjectLeadDto { Uuid = lead["uuid"], Ip = lead["ip"], Posted = lead["posted"], Data = lead, Display = lead.ContainsKey("Email") ? $"Email: {lead["Email"]}" : $"Uuid: {lead["uuid"]}", ProjectUuid = Project.uuid }); } } catch (Exception ex) { } finally { IsBusy = false; } }
private void UpdateInterface(object sender, SizeChangedEventArgs e) { switch (Lead.Value) { default: drawBrush = Brushes.Green; break; case Leads.Values.ABP: drawBrush = Brushes.Red; break; case Leads.Values.CVP: drawBrush = Brushes.Blue; break; case Leads.Values.PA: drawBrush = Brushes.Yellow; break; case Leads.Values.IABP: drawBrush = Brushes.SkyBlue; break; case Leads.Values.RR: drawBrush = Brushes.Salmon; break; case Leads.Values.ETCO2: drawBrush = Brushes.Aqua; break; case Leads.Values.SPO2: drawBrush = Brushes.Orange; break; } borderTracing.BorderBrush = drawBrush; lblLead.Foreground = drawBrush; lblLead.Content = App.Language.Dictionary [Leads.LookupString(Lead.Value)]; }
public async Task <IActionResult> Edit(int id, [Bind("Id,CompanyName,ContactName,EmailAddress,OfficeAddress,AddressLine,CityRegion,PostCode,TelephoneNumber,MobileNumber,WebAddress,LeadSince")] Leads leads) { if (id != leads.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _db.Update(leads); await _db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LeadsExists(leads.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(leads)); }
public void UpdateInsurerName(Leads objLeads) { Leads objLeads2 = DbContextHelper.DbContext.Leads.First(x => x.LeadId == objLeads.LeadId); objLeads2.InsuredName = objLeads.InsuredName; DbContextHelper.DbContext.SaveChanges(); }
public IActionResult Put(int id, [FromBody] Leads item) { using (var context = new CRM3Context()) { var dbcontext = new CRM3Context(); try { var lead = dbcontext.Leads.Where(l => l.LeadId == id).Single(); lead.Email = item.Email; lead.FirstName = item.FirstName; lead.LastName = item.LastName; lead.Address = item.Address; lead.Ip = item.Ip; lead.Phone = lead.Phone; lead.ZipCode = lead.ZipCode; dbcontext.Leads.Update(lead); dbcontext.SaveChanges(); return(Ok()); } catch (Exception ex) { return(BadRequest()); } } }
public async Task <IActionResult> Edit(int id, [Bind("ID,fName,lName,email,phone,owner")] Leads leads) { if (id != leads.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(leads); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LeadsExists(leads.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(leads)); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Leads = await _context.Leads .Include(l => l.BarPayKeyNavigation) .Include(l => l.BarTypeKeyNavigation) .Include(l => l.ContactKeyNavigation) .Include(l => l.EventTypeKeyNavigation) .Include(l => l.LeadStatNavigation) .Include(l => l.LinkKeyNavigation).FirstOrDefaultAsync(m => m.LeadKey == id); if (Leads == null) { return(NotFound()); } ViewData["BarPayKey"] = new SelectList(_context.BarPays, "BarPayKey", "Description"); ViewData["BarTypeKey"] = new SelectList(_context.BarTypes, "BarTypeKey", "Description"); ViewData["ContactKey"] = new SelectList(_context.Contacts, "ContactKey", "FullName"); ViewData["EventTypeKey"] = new SelectList(_context.EventTypes, "EventTypeKey", "Description"); ViewData["LeadStat"] = new SelectList(_context.LeadStatus, "LeadStat", "Description"); ViewData["LinkKey"] = new SelectList(_context.Linkbacks, "LinkKey", "Name"); return(Page()); }
async Task ExecuteLoadLeadsCommand() { if (IsBusy) { return; } IsBusy = true; try { Leads.Clear(); var leads = await DataStore.GetLeadsAsync(true); foreach (var lead in leads) { Leads.Add(new LeadDetailViewModel(nav, lead)); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
private async Task SendToClientAsync(Leads lead) { var campaign = await _campaignReader.GetCampaingByPageIdAsync(lead.PageId); switch (campaign.ClientType) { case ClientId.CHSP: { await _messagingService.PushMessageAsync(TopicNameChsp, new[] { lead }); break; } case ClientId.MS: { await _messagingService.PushMessageAsync(TopicName, new[] { lead }); break; } default: _logger.Error($"Unknown client type {campaign.ClientType}"); break; } }
public async Task <IActionResult> PutLeads(long id, Leads Leads) { if (id != Leads.id) { return(BadRequest()); } _context.Entry(Leads).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LeadsExists(id)) { return(NotFound()); } else { throw; } } var jsonPut = new JObject(); jsonPut["Update"] = "Update done to Leads id : " + id; return(Content(jsonPut.ToString(), "application/json")); }
public static void UpdateLossAmount(Leads objLeads) { Leads lead = DbContextHelper.DbContext.Leads.Where(x => x.LeadId == objLeads.LeadId).FirstOrDefault(); lead.LossOfUseAmount = objLeads.LossOfUseAmount; lead.LossOfUseReserve = objLeads.LossOfUseReserve; DbContextHelper.DbContext.SaveChanges(); }
public async Task <BusinessValidationResult> ProcessBusinessValidation(Leads lead) { var businessValidator = await _validatorSelector.GetBusinessValidator(lead.PageId); var businessValidationResult = await businessValidator.ValidateAsync(lead); return(businessValidationResult); }
public static void Detach(Leads lead) { //DbContextHelper.DbContext.Detach(lead); ObjectContext objectContext = ((IObjectContextAdapter)lead).ObjectContext; objectContext.Detach(lead); }
public async Task <bool> SaveNewLeadAsync(Leads lead) { await _intuitContext.Leads.AddAsync(lead); var result = await _intuitContext.SaveChangesAsync(); _log.Info($"new lead saved to sql with result {result}"); return(result == 1); }
public static void UpdateLastActivityDate(int leadID) { Leads lead = DbContextHelper.DbContext.Leads.Where(x => x.LeadId == leadID).FirstOrDefault(); lead.LastActivityDate = DateTime.Now; DbContextHelper.DbContext.SaveChanges(); //DbContextHelper.DbContext.ExecuteStoreCommand("UPDATE Leads SET LastActivityDate = {0} WHERE LeadId = {1}", DateTime.Now, leadID); }
public async Task <int> AddLeadAsync(Leads lead) { using (var intuitContext = GetContext()) { await intuitContext.Leads.AddAsync(lead); return(await intuitContext.SaveChangesAsync()); } }
public List <CRM.Data.Entities.BillToView> getBillToCollection(int claimID) { string claimantName = null; Claim claim = null; Carrier carrier = null; Leads lead = null; List <BillToView> billingCollection = new List <BillToView>(); BillToView billCarrier = null; BillToView billClaimantMailingAddress = null; BillToView billClaimantLossAddress = null; claim = ClaimsManager.Get(claimID); if (claim != null) { // add insurance company if (claim.LeadPolicy.Carrier != null) { carrier = claim.LeadPolicy.Carrier; billCarrier = new BillToView(); billCarrier.billTo = "Carrier"; billCarrier.billingName = carrier.CarrierName; billCarrier.mailingAddress = string.Format("{0} {1}", carrier.AddressLine1 ?? "", carrier.AddressLine2 ?? ""); billCarrier.mailingCity = carrier.CityMaster == null ? "" : carrier.CityMaster.CityName; billCarrier.mailingState = carrier.StateMaster == null ? "" : carrier.StateMaster.StateName; billCarrier.mailingZip = carrier.ZipCode; billingCollection.Add(billCarrier); } // add claimant mailing address lead = claim.LeadPolicy.Leads; claimantName = string.Format("{0} {1}", lead.ClaimantFirstName ?? "", lead.ClaimantLastName ?? ""); billClaimantMailingAddress = new BillToView(); billClaimantMailingAddress.billTo = "Policyholder - Mailing Address"; billClaimantMailingAddress.billingName = claimantName; billClaimantMailingAddress.mailingAddress = lead.MailingAddress ?? ""; billClaimantMailingAddress.mailingCity = lead.MailingCity ?? ""; billClaimantMailingAddress.mailingState = lead.MailingState ?? ""; billClaimantMailingAddress.mailingZip = lead.MailingZip ?? ""; billingCollection.Add(billClaimantMailingAddress); // add claimant loss address billClaimantLossAddress = new BillToView(); billClaimantLossAddress.billTo = "Policyholder - Loss Address"; billClaimantLossAddress.billingName = claimantName; billClaimantLossAddress.mailingAddress = string.Format("{0} {1}", lead.LossAddress ?? "", lead.LossAddress2 ?? ""); billClaimantLossAddress.mailingCity = lead.CityName ?? ""; billClaimantLossAddress.mailingState = lead.StateName ?? ""; billClaimantLossAddress.mailingZip = lead.Zip ?? ""; billingCollection.Add(billClaimantLossAddress); } return(billingCollection); }
public frmAddLeads() { InitializeComponent(); bw = new BackgroundWorker(); bw.DoWork += new DoWorkEventHandler(bw_DoWork); bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted); Leads = new Leads(); }
public static Leads GetByLeadByEmailPhoneLastName(string email, string phone, string lastName) { Leads lead = (from x in DbContextHelper.DbContext.Leads where x.EmailAddress == email && x.PhoneNumber.Replace("(", "").Replace(")", "").Replace("-", "").Replace(" ", "") == phone && x.ClaimantLastName == lastName select x).FirstOrDefault(); return(lead); }
private void btnViewData_Click(object sender, EventArgs e) { if (File.Exists(txtFilePath.Text) && !string.IsNullOrEmpty(txtFilePath.Text)) { Leads = new Leads(txtFilePath.Text, cmbRangeList.Text); dgvLeads.DataSource = Leads; } else MessageBox.Show("The file does not exist...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
public ActionResult AddLead(Leads lead) { Employees emp = Session["Login"] as Employees; Customers cust = Session["Customer"] as Customers; lead.EmployeeID = emp.EmployeeID; lead.CustomerID = cust.CustomerID; lead.Date = DateTime.Now; leadsBLL.AddLead(lead); return(RedirectToAction("Index")); }
public async Task <IActionResult> Create([Bind("ID,fName,lName,email,phone,owner")] Leads leads) { if (ModelState.IsValid) { _context.Add(leads); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(leads)); }
public static List <string> CheckTests(string way, List <string> rules) { var parsedRules = Parser.ParseInput(File.OpenRead(way)); var factorizedRules = Factorization.RemoveFactorization(parsedRules); var removedRecursionRules = LeftRecursionRemover.RemoveLeftRecursion(factorizedRules); var leads = Leads.FindLeads(removedRecursionRules).ToList(); rules.AddRange(removedRecursionRules.Rules.Select((t, i) => t + " / " + ConvertLead(leads[i]))); return(rules); }
private Task UpdateTaskStatusAsync(Leads lead) { Task newStatusTask; var leadStatusModel = new LeadStatusModel(); leadStatusModel.LeadId = lead.Id; leadStatusModel.Date = DateTime.UtcNow; leadStatusModel.Status = LeadStatus.FailedBusinessValidation; leadStatusModel.ServiceName = StaticSettings.ServiceName; newStatusTask = _messagingService.PushMessageAsync(TopicNameStatusHistory, new[] { leadStatusModel }); return(newStatusTask); }
public static List <Point> ECG_Isoelectric__Atrial_Flutter(Patient _P, Leads _L) { int Flutters = (int)Math.Ceiling(_P.HR_Seconds / 0.16f); List <Point> thisBeat = new List <Point> (); for (int i = 1; i < Flutters; i++) { thisBeat = Concatenate(thisBeat, ECG_P(_P, _L, 0.16f, .08f, 0f, Last(thisBeat))); } return(thisBeat); }
public static List <Point> ECG_Pacemaker(Patient _P, Leads _L) { List <Point> thisBeat = new List <Point> (); thisBeat = Concatenate(thisBeat, Line(.02d, 0, Last(thisBeat))); thisBeat = Concatenate(thisBeat, Line(.02d, 0.2f * baseLeadCoeff [(int)_L.Value, (int)WavePart.Q], Last(thisBeat))); thisBeat = Concatenate(thisBeat, Line(.02d, 0f * baseLeadCoeff [(int)_L.Value, (int)WavePart.Q], Last(thisBeat))); thisBeat = Concatenate(thisBeat, Line(.02d, 0, Last(thisBeat))); return(thisBeat); }