public Question GetCategories() { PhilipsDBEntities record = new PhilipsDBEntities(); var selected = record.Questions.FirstOrDefault((e) => e.Identifier.Equals("Category")); return(selected); }
public IEnumerable <EmpTable> Get() { using (PhilipsDBEntities entities = new PhilipsDBEntities()) { return(entities.EmpTables.ToList()); } }
public IEnumerable <PatientMonitor> GetSamples() { using (PhilipsDBEntities record = new PhilipsDBEntities()) { return(record.PatientMonitors.ToList()); } }
Question IChatbot.GetInitialQuestion() { PhilipsDBEntities record = new PhilipsDBEntities(); var selected = record.Questions.FirstOrDefault((e) => e.Identifier.Equals("Initial")); return(selected); }
public EmpTable Get(char id) { using (PhilipsDBEntities entities = new PhilipsDBEntities()) { return(entities.EmpTables.FirstOrDefault(e => e.EmpID == id)); } }
Question IChatbot.GetQ4(string Q1, string Q2, string Q3) { PhilipsDBEntities record = new PhilipsDBEntities(); string choice = "Initial" + "/" + Q1 + "/" + Q2 + "/" + Q3; var select = record.Questions.FirstOrDefault((e) => e.Identifier.Equals(choice)); return(select); }
public Question GetQuestion1(string Q1) { PhilipsDBEntities record = new PhilipsDBEntities(); string choice = "Category" + "/" + Q1; var selected = record.Questions.FirstOrDefault((e) => e.Identifier.Equals(choice)); return(selected); }
[HttpPost]//Adding public bool AddNewEmployee(Employee emp) { var context = new PhilipsDBEntities(); var empTable = emp.Convert(); context.EmpTables.Add(empTable); context.SaveChanges();//Commit the transaction and save to the DB... return(true); }
bool IChatbot.DeleteMonitor(string mod) { PhilipsDBEntities record = new PhilipsDBEntities(); var selected = record.PatientMonitors.FirstOrDefault((e) => e.Model.Equals(mod)); if (selected == null) { return(false); } record.PatientMonitors.Remove(record.PatientMonitors.FirstOrDefault(e => e.Model == mod)); record.SaveChanges(); return(true); }
public bool PostNewSalesRep(ChatbotDataModelLib.Models.SalesRep data) { PhilipsDBEntities record = new PhilipsDBEntities(); var selected = record.SalesReps.FirstOrDefault((e) => e.City.Equals(data.City)); if (selected == null) { record.SalesReps.Add(data); record.SaveChanges(); return(true); } return(false); }
bool IChatbot.PostNewMonitors(PatientMonitor newmod) { PhilipsDBEntities record = new PhilipsDBEntities(); var selected = record.PatientMonitors.FirstOrDefault((e) => e.Model.Equals(newmod.Model)); if (selected == null) { record.PatientMonitors.Add(newmod); record.SaveChanges(); return(true); } return(false); }
public bool PostNewMonitor(ChatbotDataModelLib.Models.CustomerData data) { PhilipsDBEntities record = new PhilipsDBEntities(); record.CustomerDatas.Add(data); record.SaveChanges(); executiveName = CheckSales(data); PatientSale patientSale = CreatePatientRecord(data); record.PatientSales.Add(patientSale); record.SaveChanges(); return(true); }
public Employee Find(char id) { var context = new PhilipsDBEntities(); var selected = context.EmpTables.FirstOrDefault((e) => e.EmpID.Equals(id)); if (selected == null) { throw new Exception("Employee not found"); } var emp = new Employee(); emp.Convert(selected); return(emp); }
public string CheckSales(ChatbotDataModelLib.Models.CustomerData data) { PhilipsDBEntities record = new PhilipsDBEntities(); string name = "Main HQ"; var item = record.SalesReps.ToList(); for (int i = 0; i < record.SalesReps.Count(); i++) { if (item[i].City.Equals(data.CustomerAddress)) { name = item[i].ExecutiveName; } } return(name); }
public List <Employee> AllEmployees() { var context = new PhilipsDBEntities(); var records = context.EmpTables.ToList(); var employees = new List <Employee>(); foreach (var emp in records) { var temp = new Employee(); temp.Convert(emp); employees.Add(temp); } //} //var employees = context.EmpTables.ToList().Select((e) => new Employee { ID = e.EmpID, Name = e.EmpName, Address = e.EmpAddress, Salary = e.EmpSalary }).ToList(); return(employees); }
public bool UpdateEmployee(Employee emp) { if (emp == null) { throw new Exception("Emp Details are not set"); } var context = new PhilipsDBEntities(); var selected = context.EmpTables.FirstOrDefault(e => e.EmpID == emp.ID); if (selected == null) { throw new Exception("Not found to update"); } selected.EmpName = emp.Name; selected.EmpAddress = emp.Address; selected.EmpSalary = emp.Salary; context.SaveChanges(); return(true); }
List <Question> IChatbot.GetAllQuestions() { PhilipsDBEntities record = new PhilipsDBEntities(); return(record.Questions.ToList()); }
List <PatientMonitor> IChatbot.GetAvalonSolution(string Q2, string Q3) { PhilipsDBEntities record = new PhilipsDBEntities(); return(record.PatientMonitors.Where((e) => (e.Care_Stage.Equals(Q3) || e.Weight.Equals(Q3))).ToList()); }
public PhilipsDBEntities CreateEntities() { PhilipsDBEntities record = new PhilipsDBEntities(); return(record); }
List <PatientSale> IMonitorSales.GetExecutiveName(string name) { PhilipsDBEntities record = new PhilipsDBEntities(); return(record.PatientSales.Where((e) => e.ExecutiveName.Equals(name)).ToList()); }
List <PatientMonitor> IChatbot.GetICUSolution(string Q2, string Q3, string Q4) { PhilipsDBEntities record = new PhilipsDBEntities(); return(record.PatientMonitors.Where((e) => e.Location.Equals(Q2) && (e.Portability.Equals(Q4) || e.Screen_Size.Equals(Q4) || e.Touch_Screen.Equals(Q4))).ToList()); }
public List <PatientMonitor> GetSolution(string Q1, string Q2) { PhilipsDBEntities record = new PhilipsDBEntities(); return(record.PatientMonitors.Where((e) => e.Portability.Equals(Q2) || e.Screen_Size.Equals(Q2) || e.Touch_Screen.Equals(Q2)).ToList()); }
List <PatientMonitor> IChatbot.GetAllMonitors() { PhilipsDBEntities record = new PhilipsDBEntities(); return(record.PatientMonitors.ToList()); }