예제 #1
0
        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);
        }
예제 #2
0
 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;
 }
예제 #3
0
 public void Setup()
 {
     selectClient      = new SelectClient();
     selectServices    = new SelectServices();
     selectReservation = new SelectReservation();
     addClient         = new DBInsertClient(selectClient);
     addServices       = new DBInsertServices(selectServices);
     addReservation    = new DBInsertReservation(selectReservation);
 }
예제 #4
0
 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);
 }
예제 #5
0
 //----------------------------------------------
 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;
 }
예제 #6
0
 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());
 }
예제 #7
0
        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";
        }
예제 #8
0
        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";
        }
예제 #9
0
        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";
        }
예제 #10
0
 public UpdateReservation(ISelectTableObject <Reservation> selectReservation)
 {
     this.selectReservation = selectReservation;
 }
예제 #11
0
 public UpdateClient(ISelectTableObject <Client> selectClient)
 {
     this.selectClient = selectClient;
 }
예제 #12
0
 public DBInsertEmployee(ISelectTableObject <Employee> selectEmpoloyee)
 {
     this.selectEmployee = selectEmpoloyee;
 }
예제 #13
0
 public DBInsertReservation(ISelectTableObject <Reservation> selectReservation)
 {
     this.selectReservation = selectReservation;
 }
예제 #14
0
 public DBInsertServices(ISelectTableObject <Services> selectServices)
 {
     this.selectServices = selectServices;
 }
예제 #15
0
 public DBInsertClient(ISelectTableObject <Client> selectClient)
 {
     this.selectClient = selectClient;
 }
 public void Setup()
 {
     selectClient = new SelectClient();
     updateClient = new UpdateClient(selectClient);
 }