public int GetClientCount(dbClient Clients) { int count = 0; Clients.Connect(); if (Clients.ConnOpen() == true) { count = Clients.SuperQuery($"SELECT `ClientID` FROM `tbClient`").Tables[0].Rows.Count; } Clients.ConnClose(); return(count); }
public List <int> GetClientByMonth(dbClient Clients) { List <int> Count = new List <int>(); Clients.Connect(); if (Clients.ConnOpen() == true) { for (int i = 1; i <= 6; i++) { int count = Clients.SuperQuery($"SELECT * FROM `tbClient` WHERE year(AddDate) = 2019 AND month(AddDate) = {i}").Tables[0].Rows.Count; Count.Add(count); } } Clients.ConnClose(); return(Count); }
public List <int> GetClientBySource(dbClient Clients) { List <int> Count = new List <int>(); List <string> Sources = new List <string> { "Call", "Email", "Referal", "Partner", "Campaign", "WebForm", "SocialMedia" }; Clients.Connect(); if (Clients.ConnOpen() == true) { foreach (var item in Sources) { Count.Add(Clients.SuperQuery($"SELECT * FROM `tbClient` WHERE `Source` = '{item}'").Tables[0].Rows.Count); } } Clients.ConnClose(); return(Count); }
public List <double> GetClientByPipeline(dbClient Clients) { List <double> Count = new List <double>(); List <string> Pipeline = new List <string> { "Awareness", "Interest", "Decision", "Action" }; Clients.Connect(); if (Clients.ConnOpen() == true) { foreach (var item in Pipeline) { Count.Add(Clients.SuperQuery($"SELECT * FROM `tbClient` WHERE `Pipeline` = '{item}'").Tables[0].Rows.Count); } } Clients.ConnClose(); return(Count); }