public static Client GetClientFullTextSearch(string searchText, out int clientId) { //error with non unique value in result selectClient = new SelectClient(); List <Client> result = new List <Client>(); result = selectClient.GetRowsForTable(SGetAllRowsFromSpecificTable.ClientSelectAllRowsQuery()); var client = result.Select(x => new { id = x.client_id, text = x.client_name + " " + x.client_sname + " " + x.client_phone }).Where(y => y.text.Contains(searchText)); if (client.Any() == false) { clientId = -1; return(new Client { client_id = 0, client_name = "brak", client_phone = "brak", client_sname = "brak", client_description = "brak" }); } var selectedClient = selectClient.GetRowsForTable(SGetAllRowsFromSpecificTable.ClientSelectAllRowsQuery()).Where(x => x.client_id == client.First().id).First(); clientId = client.First().id; return(selectedClient); }
public CreateViewVreservation(ISelectTableObject <Client> selectClient, ISelectTableObject <Reservation> selectReservation, ISelectTableObject <Services> selectServices, ISelectTableObject <Employee> selectEmployee) { this.selectClient = selectClient; this.selectReservation = selectReservation; this.selectServices = selectServices; this.selectEmployee = selectEmployee; }
public void Setup() { selectClient = new SelectClient(); selectServices = new SelectServices(); selectReservation = new SelectReservation(); addClient = new DBInsertClient(selectClient); addServices = new DBInsertServices(selectServices); addReservation = new DBInsertReservation(selectReservation); }
public ReservationController() { this.selectClient = new SelectClient(); this.updateClient = new UpdateClient(selectClient); this.selectServices = new SelectServices(); this.selectReservation = new SelectReservation(); this.selectEmployee = new SelectEmployee(); this.selectReservationList = new SelectReservation(); this.getVReservation = new CreateViewVreservation(selectClient, selectReservation, selectServices, selectEmployee); this.insertObjectToDB = new FasadeInsertDB(new DBInsertClient(selectClient), new DBInsertServices(selectServices), new DBInsertReservation(selectReservation), new DBInsertEmployee(selectEmployee), new SelectClient(), new SelectServices(), new SelectReservation(), new SelectEmployee()); this.updateReservation = new UpdateReservation(selectReservation); }
//---------------------------------------------- public FasadeInsertDB(IInsertToDB <Client> insertClient, IInsertToDB <Services> insertServices, IInsertToDB <Reservation> insertReservation, IInsertToDB <Employee> insertEmployee, ISelectTableObject <Client> selectClient, ISelectTableObject <Services> selectServices, ISelectTableObject <Reservation> selectReservation, ISelectTableObject <Employee> selectEmployee) { this.insertClient = insertClient; this.insertServices = insertServices; this.insertReservation = insertReservation; this.insertEmployee = insertEmployee; this.selectClient = selectClient; this.selectServices = selectServices; this.selectReservation = selectReservation; this.selectEmployee = selectEmployee; }
public MainForm() { InitializeComponent(); SqlLiteDB.SqlLiteDBCreateTableIFNotExist(); this.selectClient = new SelectClient(); this.selectServices = new SelectServices(); this.selectReservation = new SelectReservation(); this.selectEmployee = new SelectEmployee(); this.getVReservation = new CreateViewVreservation(selectClient, selectReservation, selectServices, selectEmployee); this.updateClient = new UpdateClient(selectClient); this.deleteReservation = new DeleteReservation(); this.insertObjectToDB = new FasadeInsertDB(new DBInsertClient(selectClient), new DBInsertServices(selectServices), new DBInsertReservation(selectReservation), new DBInsertEmployee(selectEmployee), new SelectClient(), new SelectServices(), new SelectReservation(), new SelectEmployee()); }
public static void SetDataToCmbEmployee(ComboBox cmbEmployee) { selectEmployee = new SelectEmployee(); List <Employee> listEmployee = new List <Employee>(); listEmployee.Add(new Employee { employee_id = 0, employee_name = "wybierz pracownika" }); foreach (var i in selectEmployee.GetRowsForTable(SGetAllRowsFromSpecificTable.EmployeeSelectAllRowsQuery())) { listEmployee.Add(i); } cmbEmployee.DataSource = listEmployee; cmbEmployee.DisplayMember = "employee_name"; cmbEmployee.ValueMember = "employee_id"; }
public static void SetDataToCmbServices(ComboBox cmbListServices) { selectServices = new SelectServices(); List <Services> listServices = new List <Services>(); listServices.Add(new Services { services_id = 0, services_name = "usługa" }); foreach (var i in selectServices.GetRowsForTable(SGetAllRowsFromSpecificTable.ServicesSelectAllRowsQuery())) { listServices.Add(i); } cmbListServices.DataSource = listServices; cmbListServices.DisplayMember = "services_name"; cmbListServices.ValueMember = "services_id"; }
public static void SetDataToCmbClient(ComboBox cmbClientList) { selectClient = new SelectClient(); List <Client> clientList = new List <Client>(); clientList.Add(new Client { client_id = 0, client_name = "klient" }); foreach (var i in selectClient.GetRowsForTable(SGetAllRowsFromSpecificTable.ClientSelectAllRowsQuery())) { clientList.Add(new Client { client_id = i.client_id, client_name = i.client_name + " " + i.client_sname }); } cmbClientList.DataSource = clientList; cmbClientList.DisplayMember = "client_name"; cmbClientList.ValueMember = "client_id"; }
public UpdateReservation(ISelectTableObject <Reservation> selectReservation) { this.selectReservation = selectReservation; }
public UpdateClient(ISelectTableObject <Client> selectClient) { this.selectClient = selectClient; }
public DBInsertEmployee(ISelectTableObject <Employee> selectEmpoloyee) { this.selectEmployee = selectEmpoloyee; }
public DBInsertReservation(ISelectTableObject <Reservation> selectReservation) { this.selectReservation = selectReservation; }
public DBInsertServices(ISelectTableObject <Services> selectServices) { this.selectServices = selectServices; }
public DBInsertClient(ISelectTableObject <Client> selectClient) { this.selectClient = selectClient; }
public void Setup() { selectClient = new SelectClient(); updateClient = new UpdateClient(selectClient); }