/// <summary> /// Create lead reord using given information /// </summary> /// <param name="fullName">lead name</param> /// <returns>true if succeded</returns> public static bool CreateLead(string fullName) { var db = new MQ163DataContext(); var prospects = from x in db.Prospects orderby x.Id descending select x; int newId = (prospects != null && prospects.Count() > 0)? prospects.First().Id : 0; var newLead = new Prospect{ Id = newId + 1, FullName = fullName, email = @" ", IsCustomer = false, Features = " ", Car=" " }; db.Prospects.InsertOnSubmit(newLead); db.SubmitChanges(); return true; }
/// <summary> /// Create lead reord using given information /// </summary> /// <param name="fullName">lead name</param> /// <returns>true if succeded</returns> public static bool CreateLead(string fullName) { var db = new MQ163DataContext(); var prospects = from x in db.Prospects orderby x.Id descending select x; int newId = (prospects != null && prospects.Count() > 0)? prospects.First().Id : 0; var newLead = new Prospect { Id = newId + 1, FullName = fullName, email = @" ", IsCustomer = false, Features = " ", Car = " " }; db.Prospects.InsertOnSubmit(newLead); db.SubmitChanges(); return(true); }
partial void DeleteProspect(Prospect instance);
partial void UpdateProspect(Prospect instance);
partial void InsertProspect(Prospect instance);