Esempio n. 1
0
        public void sql_build_input(string sql, string [] query_input_name, string[] text_Box_input)
        {
            Query_input Query = new Query_input();

            for (int i = 0; i < query_input_name.Length; i++)
            {
                sql += query_input_name[i] + ",";
            }
            if (sql.EndsWith(","))
            {
                sql = sql.Remove(sql.Length - 1);
            }
            sql += ") values (";
            for (int i = 0; i < text_Box_input.Length; i++)
            {
                if (text_Box_input[i].Trim() == string.Empty)
                {
                }
                else
                {
                    sql += string.Format("\'{0}\'", text_Box_input[i]) + ",";
                }
            }
            if (sql.EndsWith(","))
            {
                sql = sql.Remove(sql.Length - 1);
            }
            sql += ")";
            Query.input(sql);
        }
Esempio n. 2
0
        private void Button_Click_8(object sender, RoutedEventArgs e)
        {
            string      sql   = "DELETE dbo." + db + " WHERE ID_Numbers =" + Delet.Text;
            Query_input Query = new Query_input();

            Query.delete(sql, Delet, db);
        }
Esempio n. 3
0
        private void button_Click_5(object sender, RoutedEventArgs e)
        {
            string[] Field_name = new string[] { "Код сотрудника", "Фамилия", "Имя", "Отчество", "Возраст", "Пол", "Адрес по прописке",
                                                 "Адрес фактического проживание", "Серия", "Номер паспорта", "Подразделение", "Дата выдачи", "Кто выдал", "Телефон", "Код номера", "Наименование", "Вместимость", "Описание", "Стоимость" };
            string[] query_input_name = new string[] { "Staff.ID_Employee", "Staff.Surname", "Staff.Name", "Staff.Patronymic", "Staff.Age", "Staff.Gender", "Staff.Registered_address", "Staff.Address_of_actual_residence", "Staff.Series", "Staff.ID_Passport", "Staff.Subdivision", "CAST(Staff.Date_of_issue AS varchar)",
                                                       "Staff.Issued_by", "Staff.Phone", "Rooms.ID_Numbers", "Rooms.Name", "Rooms.Capacity", "Rooms.Description", "Rooms.The_cost" };
            string[] query_output_name = new string[] { "ID_Employee", "Surname", "Name", "Patronymic", "Age", "Gender", "Registered_address", "Address_of_actual_residence", "Series", "ID_Passport", "Subdivision", "Date_of_issue",
                                                        "Issued_by", "Phone", "ID_Numbers", "Name", "Capacity", "Description", "The_cost" };

            string[] array       = new string[] { };
            string[] line        = new string[] { };
            string   sql_fil_end = " FROM Staff INNER JOIN Rooms ON Staff.ID_Employee = Rooms.ID_Employee";
            string   full_sql    = "SELECT Staff.ID_Employee, Staff.ID_Position, Staff.Surname, Staff.Name, Staff.Patronymic, Staff.Age, Staff.Gender, Staff.Registered_address, Staff.Address_of_actual_residence, Staff.Series, Staff.ID_Passport, Staff.Subdivision, " +
                                   "Staff.Date_of_issue, Staff.Issued_by, Staff.Phone, Rooms.ID_Numbers, Rooms.Name, Rooms.Capacity, Rooms.Description, Rooms.The_cost" +
                                   " FROM Staff INNER JOIN Rooms ON Staff.ID_Employee = Rooms.ID_Employee";

            string[] explore = new string[] { "Код сотрудника", "Фамилия", "Имя", "Отчество", "Возраст", "Пол", "Адрес по прописке",
                                              "Адрес фактического проживание", "Серия", "Номер паспорта", "Подразделение", "Дата выдачи", "Кто выдал", "Телефон", "Код номера", "Наименование", "Вместимость", "Описание", "Стоимость" };
            CheckBox[] array_check = new CheckBox[] { Check_ID_Emp, Check_Sur, Check_Names, Check_Patr, Check_Year, Check_Gendr, Check_Registered, Check_actual, Check_Series, Check_ID_Pass, Check_Subdivision, Check_Date, Check_Issued, Check_Phones,
                                                      Check_ID_Num, Check_Name, Check_Capa, Check_Descr, Check_Cos };

            Query_input Query = new Query_input();

            Query.report_query(Field_name, query_output_name, query_input_name, array, line, explore, array_check, explorer_box, explorer_textBox, sql_fil_end, full_sql);
        }
Esempio n. 4
0
        public void sql_build_Change(string sql, TextBox ID, string text_ID, CheckBox [] array_check, string[] t_box_name, string[] query_input_name, Grid Grid_Change)
        {
            for (int i = 0; i < array_check.Length; i++)
            {
                if (array_check[i].IsChecked == true)
                {
                    TextBox text_Box = (TextBox)Grid_Change.FindName(t_box_name[i]);
                    if (text_Box == null)
                    {
                        MessageBox.Show("Поле не были созданы и не были заполнены", "Уведомление");
                        break;
                    }
                    if (text_Box.Text.Trim() == string.Empty)
                    {
                        MessageBox.Show("Поле было пустое", "Уведомление");
                    }
                    else
                    {
                        sql += query_input_name[i] + "=" + string.Format("\'{0}\'", text_Box.Text) + ",";
                    }
                }
            }
            if (sql.EndsWith(","))
            {
                sql = sql.Remove(sql.Length - 1);
            }
            sql += text_ID + ID.Text + ";";
            Query_input Query = new Query_input();

            Query.input(sql);
        }
Esempio n. 5
0
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            string sql     = "UPDATE dbo.[Services provided to the client] SET ";
            string text_ID = " WHERE ID_Client = ";

            CheckBox[] array_check = new CheckBox[] { Check_ID_Cliet, Check_ID_Serv, Check_Costs };
            for (int i = 0; i < array_check.Length; i++)
            {
                if (array_check[i].IsChecked == true)
                {
                    TextBox text_Box = (TextBox)Grid_Change.FindName(t_box_name[i]);
                    if (text_Box == null)
                    {
                        MessageBox.Show("Поле не были созданы и не были заполнены", "Уведомление");
                        break;
                    }
                    if (text_Box.Text.Trim() == string.Empty)
                    {
                    }
                    else
                    {
                        sql += query_input_name[i] + "=" + string.Format("\'{0}\'", text_Box.Text) + ",";
                    }
                }
            }
            if (sql.EndsWith(","))
            {
                sql = sql.Remove(sql.Length - 1);
            }
            sql += text_ID + Services_ID.Text + " and ";
            sql += "ID_Services = " + Client_ID.Text + ";";
            Query_input Query = new Query_input();

            Query.input(sql);
        }
Esempio n. 6
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            string[]    text_Box_input = new string[] { Job.Text, Dut.Text, Requie.Text, Salary.Text };
            string      sql            = "INSERT INTO dbo.Positionen (";
            Query_input Query          = new Query_input();

            Query.sql_build_input(sql, query_input_name, text_Box_input);
        }
Esempio n. 7
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            string[]    text_Box_input = new string[] { ID_Cli.Text.Split()[0], ID_Ser.Text.Split()[0], Cos.Text };
            string      sql            = "INSERT INTO dbo.[Services provided to the client] (";
            Query_input Query          = new Query_input();

            Query.sql_build_input(sql, query_input_name, text_Box_input);
        }
Esempio n. 8
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            string[]    text_Box_input = new string[] { ID_EMP.Text.Split()[0], Nam.Text, Capac.Text, Descr.Text, Cost.Text };
            string      sql            = "INSERT INTO dbo.Rooms (";
            Query_input Query          = new Query_input();

            Query.sql_build_input(sql, query_input_name, text_Box_input);
        }
Esempio n. 9
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            string[]    text_Box_input = new string[] { Nam.Text, Desc.Text, Cos.Text };
            string      sql            = "INSERT INTO dbo.Services (";
            Query_input Query          = new Query_input();

            Query.sql_build_input(sql, query_input_name, text_Box_input);
        }
Esempio n. 10
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            string[] text_Box_input = new string[] { help.Text.Split()[0], ID_NUM.Text.Split()[0], Family.Text, Imia.Text, Othestvo.Text, Registered.Text, Ceria.Text, ID_P.Text,
                     Podrazdelenia.Text, Date.Text, Is_Date.Text, Date_Vi.Text, Data_Za.Text };
            string      sql   = "INSERT INTO dbo.Clients (";
            Query_input Query = new Query_input();

            Query.sql_build_input(sql, query_input_name, text_Box_input);
        }
Esempio n. 11
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            string[] text_Box_input = new string[] { help.Text.Split()[0], Familya.Text, Imia.Text, Otchestvo.Text, Let.Text, Pol.Text, Registered.Text,
                     Actual.Text, Ceria.Text, ID.Text, Podrazdelenia.Text, Date.Text, Vidol.Text, Telephone.Text };
            string      sql   = "INSERT INTO dbo.Staff (";
            Query_input Query = new Query_input();

            Query.sql_build_input(sql, query_input_name, text_Box_input);
        }
Esempio n. 12
0
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            string sql     = "UPDATE dbo.Rooms SET ";
            string text_ID = " WHERE ID_Numbers = ";

            CheckBox[]  array_check = new CheckBox[] { Check_ID_Emplo, Check_Name, Check_Capaci, Check_Descript, Check_Costs };
            Query_input Query       = new Query_input();

            Query.sql_build_Change(sql, Staff_ID, text_ID, array_check, t_box_name, query_input_name, Grid_Change);
        }
Esempio n. 13
0
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            string sql     = "UPDATE dbo.Positionen SET ";
            string text_ID = " WHERE ID_Position = ";

            CheckBox[]  array_check = new CheckBox[] { Check_JOBS, Check_Duts, Check_Reque, Check_Sali };
            Query_input Query       = new Query_input();

            Query.sql_build_Change(sql, Positionen_ID, text_ID, array_check, t_box_name, query_input_name, Grid_Change);
        }
Esempio n. 14
0
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            string sql     = "UPDATE dbo.Staff SET ";
            string text_ID = " WHERE ID_Employee = ";

            CheckBox[] array_check = new CheckBox[] { Check_ID_JOB, Check_Family, Check_Name, Check_Otchestvo, Check_Age, Check_SEX, Check_Adress, Check_Adress_Act, Check_Seria,
                                                      Check_ID_PASS, Check_Pod, Check_Date_of_issue, Check_Issued_by, Check_Phone };
            Query_input Query = new Query_input();

            Query.sql_build_Change(sql, Staff_ID, text_ID, array_check, t_box_name, query_input_name, Grid_Change);
        }
Esempio n. 15
0
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            string sql     = "UPDATE dbo.Clients SET ";
            string text_ID = " WHERE ID_Client = ";

            CheckBox[] array_check = new CheckBox[] { Check_ID_Sotr, Check_Numb, Check_Part, Check_Name, Check_Otchestvo, Check_Adress, Check_Ceri, Check_ID_PASS,
                                                      Check_Pod, Check_Date_of_issue, Check_Date_of_issue, Check_Date_vie, Check_Date_zas };
            Query_input Query = new Query_input();

            Query.sql_build_Change(sql, Client_ID, text_ID, array_check, t_box_name, query_input_name, Grid_Change);
        }
Esempio n. 16
0
 public void delete(string sql, TextBox Delet, string db)
 {
     if (Delet.Text.Trim() == string.Empty)
     {
         MessageBox.Show("Поле удаление пустое", "Уведомление");
     }
     else
     {
         Query_input Query = new Query_input();
         Query.input(sql);
     }
 }
Esempio n. 17
0
        private void button_Click_11(object sender, RoutedEventArgs e)
        {
            string[] Field_name        = new string[] { "Код услуги", "Наименование", "Описание", "Стоимость" };
            string[] explore           = new string[] { "Код услуги", "Наименование", "Описание", "Стоимость" };
            string[] query_output_name = new string[] { "ID_Services", "Name", "Description", "The_cost" };
            string[] array             = new string[] { };
            string[] line        = new string[] { };
            string   sql_fil_end = " from dbo.Services";
            string   full_sql    = "Select ID_Services, Name, Description, The_cost from dbo.Services";

            CheckBox[] array_check = new CheckBox[] { Check_ID_Ser, Check_Nam, Check_Desc, Check_Cost };

            Query_input Query = new Query_input();

            Query.report(Field_name, query_output_name, array, line, explore, array_check, explorer_box, explorer_textBox, sql_fil_end, full_sql);
        }
Esempio n. 18
0
        private void button_Click_11(object sender, RoutedEventArgs e)
        {
            string[] Field_name        = new string[] { "Код номера", "Код сотрудника", "Наименование", "Вместимость", "Описание", "Стоимость" };
            string[] explore           = new string[] { "Код номера", "Код сотрудника", "Наименование", "Вместимость", "Описание", "Стоимость" };
            string[] query_output_name = new string[] { "ID_Numbers", "ID_Employee", "Name", "Capacity", "Description", "The_cost" };
            string[] array             = new string[] { };
            string[] line        = new string[] { };
            string   sql_fil_end = " from dbo.Rooms";
            string   full_sql    = "select ID_Numbers,ID_Employee,Name,Capacity,Description,The_cost from dbo.Rooms";

            CheckBox[] array_check = new CheckBox[] { Check_ID_Num, Check_ID_Emp, Check_Names, Check_Capa, Check_Descr, Check_Cos };

            Query_input Query = new Query_input();

            Query.report(Field_name, query_output_name, array, line, explore, array_check, explorer_box, explorer_textBox, sql_fil_end, full_sql);
        }
Esempio n. 19
0
        private void button_Click_10(object sender, RoutedEventArgs e)
        {
            string[] Field_name        = new string[] { "Код клиента", "Код услуги", "Стоимость" };
            string[] explore           = new string[] { "Код клиента", "Код услуги", "Стоимость" };
            string[] query_output_name = new string[] { "ID_Client", "ID_Services", "The_cost" };
            string[] array             = new string[] { };
            string[] line        = new string[] { };
            string   sql_fil_end = " from dbo.[Services provided to the client]";
            string   full_sql    = "select ID_Client, ID_Services, The_cost from dbo.[Services provided to the client]";

            CheckBox[] array_check = new CheckBox[] { Check_Cli, Check_ID_Ser, Check_Cost };

            Query_input Query = new Query_input();

            Query.report(Field_name, query_output_name, array, line, explore, array_check, explorer_box, explorer_textBox, sql_fil_end, full_sql);
        }
Esempio n. 20
0
        private void button_Click_11(object sender, RoutedEventArgs e)
        {
            string[] Field_name        = new string[] { "Код должности", "Наименование должности", "Обязанности", "Требование", "Оклад" };
            string[] query_output_name = new string[] { "ID_Position", "Job_title", "Duties", "Requirements", "Salary" };

            string[] array       = new string[] { };
            string[] line        = new string[] { };
            string[] explore     = new string[] { "Код должности", "Наименование должности", "Обязанности", "Требование", "Оклад" };
            string   sql_fil_end = " from dbo.Positionen";
            string   full_sql    = "select ID_Position, Job_title, Duties, Requirements, Salary from dbo.Positionen";

            CheckBox[] array_check = new CheckBox[] { Check_ID, Check_Job, Check_Dut, Check_Requ, Check_Sal };

            Query_input Query = new Query_input();

            Query.report(Field_name, query_output_name, array, line, explore, array_check, explorer_box, explorer_textBox, sql_fil_end, full_sql);
        }
Esempio n. 21
0
        private void button_Click_11(object sender, RoutedEventArgs e)
        {
            string[] Field_name = new string[] { "Код сотрудника", "Код должности", "Фамилия", "Имя", "Отчество", "Возраст", "Пол", "Адрес по прописке",
                                                 "Адрес фактического проживание", "Серия", "Номер паспорта", "Подразделение", "Дата выдачи", "Кто выдал", "Телефон" };
            string[] query_output_name = new string[] { "ID_Employee", "ID_Position", "Surname", "Name", "Patronymic", "Age", "Gender", "Registered_address", "Address_of_actual_residence", "Series", "ID_Passport", "Subdivision", "Date_of_issue",
                                                        "Issued_by", "Phone" };

            string[] array   = new string[] { };
            string[] line    = new string[] { };
            string[] explore = new string[] { "Код сотрудника", "Код должности", "Фамилия", "Имя", "Отчество", "Возраст", "Пол", "Адрес по прописке",
                                              "Адрес фактического проживание", "Серия", "Номер паспорта", "Подразделение", "Дата выдачи", "Кто выдал", "Телефон" };
            string sql_fil_end = " from dbo.Staff";
            string full_sql    = "select ID_Employee,ID_Position,Surname,Name,Patronymic,Age,Gender,Registered_address,Address_of_actual_residence,Series,ID_Passport,Subdivision,Date_of_issue,Issued_by,Phone from dbo.Staff";

            CheckBox[] array_check = new CheckBox[] { Check_ID_Emp, Check_ID_Post, Check_Sur, Check_Names, Check_Patr, Check_Year, Check_Gendr, Check_Registered, Check_actual, Check_Series, Check_ID_Pass, Check_Subdivision, Check_Date, Check_Issued, Check_Phones };

            Query_input Query = new Query_input();

            Query.report(Field_name, query_output_name, array, line, explore, array_check, explorer_box, explorer_textBox, sql_fil_end, full_sql);
        }
Esempio n. 22
0
        private void button_Click_11(object sender, RoutedEventArgs e)
        {
            string[] Field_name = new string[] { "Код клиента", "Код сотрудника", "Код номера", "Фамилия", "Имя", "Отчество", "Адрес по прописке", "Серия",
                                                 "Номер паспорта", "Подразделение", "Дата выдачи", "Кто выдал", "Дата выезда", "Дата заселения" };
            string[] query_output_name = new string[] { "ID_Client", "ID_Employee", "ID_Numbers", "Surname", "Name", "Patronymic", "Registered_address", "Series", "ID_Passport", "Subdivision", "Date_of_issue", "Issued_by", "Check_in_date", "Date_of_departure" };

            string[] array       = new string[] { };
            string[] line        = new string[] { };
            string   sql_fil_end = " from dbo.Clients";
            string   full_sql    = "select ID_Client,ID_Employee,ID_Numbers,Surname,Name,Patronymic,Registered_address,Series,ID_Passport,Subdivision,Date_of_issue,Issued_by,Check_in_date,Date_of_departure from dbo.Clients";

            string[] explore = new string[] { "Код клиента", "Код сотрудника", "Код номера", "Фамилия", "Имя", "Отчество", "Адрес по прописке", "Серия",
                                              "Номер паспорта", "Подразделение", "Дата выдачи", "Кто выдал", "Дата выезда", "Дата заселения" };
            CheckBox[] array_check = new CheckBox[] { Check_ID_Cli, Check_ID_EMP, Check_ID_NUM, Check_Familys, Check_Names, Check_Patr, Check_Register, Check_Ceria,
                                                      Check_ID_P, Check_Podrazdelenia, Check_Dates, Check_Is_Date, Check_Date_Vi, Check_Data_Za };

            Query_input Query = new Query_input();

            Query.report(Field_name, query_output_name, array, line, explore, array_check, explorer_box, explorer_textBox, sql_fil_end, full_sql);
        }
        private void button_Click_9(object sender, RoutedEventArgs e)
        {
            string[] Field_name = new string[] { "Код сотрудника", "Код должности", "Фамилия сотрудника", "Имя сотрудника", "Отчество сотрудника", "Возраст сотрудника", "Пол сотрудника", "Адрес по прописке сотрудника", "Адрес фактического проживание сотрудника", "Серия паспорта сотрудника", "Номер паспорта сотрудника", "Код подразделение сотрудника", "Дата выдачи паспорта сотруднику", "Кто выдал паспорт сотруднику", "Телефон сотрудника",
                                                 "Код клиента", "Фамилия клиента", "Имя клиента", "Отчество клиента", "Адрес по прописке клиента", "Серия паспорта клиента", "Номер паспорта клиента", "Код подразделение клиента", "Дата выдачи паспорта клиента", "Кто выдал паспорт клиенту", "Дата выезда клиента", "Дата заселения клиента",
                                                 "Код услуги", "Наименование услуги", "Описание услуги", "Стоимость услуги", "Наименование номера", "Вместимость номера", "Описание номера", "Стоимость номера" };
            string[] query_input_name = new string[] { "Staff.ID_Employee", "Staff.ID_Position", "Staff.Surname", "Staff.Name", "Staff.Patronymic", "Staff.Age", "Staff.Gender", "Staff.Registered_address", "Staff.Address_of_actual_residence",
                                                       "Staff.Series", "Staff.ID_Passport", "Staff.Subdivision", "Staff.Date_of_issue", "Staff.Issued_by", "Staff.Phone", "Clients.ID_Client", "Clients.Surname", "Clients.Name", "Clients.Patronymic", "Clients.Registered_address",
                                                       "Clients.Series", "Clients.ID_Passport", "Clients.Subdivision", "Clients.Date_of_issue", "Clients.Issued_by", "Clients.Check_in_date", "Clients.Date_of_departure", "Services.ID_Services", "Services.Name", "Services.Description", "Services.The_cost", "Rooms.Name", "Rooms.Capacity", "Rooms.Description", "Rooms.The_cost" };
            string[] query_output_name = new string[] { "ID_Employee", "ID_Position", "Surname", "Name", "Patronymic", "Age", "Gender", "Registered_address", "Address_of_actual_residence",
                                                        "Series", "ID_Passport", "Subdivision", "Date_of_issue", "Issued_by", "Phone", "ID_Client", "Surname", "Name", "Patronymic", "Registered_address",
                                                        "Series", "ID_Passport", "Subdivision", "Date_of_issue", "Issued_by", "Check_in_date", "Date_of_departure", "ID_Services", "Name", "Description", "The_cost", "Name", "Capacity", "Description", "The_cost" };

            string[] array       = new string[] { };
            string[] line        = new string[] { };
            string   sql_fil_end = " FROM Clients INNER JOIN " +
                                   "Rooms ON Clients.ID_Numbers = Rooms.ID_Numbers INNER JOIN " +
                                   "[Services provided to the client] ON Clients.ID_Client = [Services provided to the client].ID_Client INNER JOIN " +
                                   "Services ON [Services provided to the client].ID_Services = Services.ID_Services INNER JOIN " +
                                   "Staff ON Clients.ID_Employee = Staff.ID_Employee";
            string full_sql = "SELECT Staff.ID_Employee,Staff.ID_Position,Staff.Surname,Staff.Name,Staff.Patronymic,Staff.Age,Staff.Gender,Staff.Registered_address,Staff.Address_of_actual_residence, Staff.Series,Staff.ID_Passport, Staff.Subdivision,Staff.Date_of_issue," +
                              "Staff.Issued_by, Staff.Phone,Clients.ID_Client,Clients.Surname,Clients.Name,Clients.Patronymic,Clients.Registered_address,Clients.Series," +
                              "Clients.ID_Passport,Clients.Subdivision,Clients.Date_of_issue,Clients.Issued_by,Clients.Check_in_date,Clients.Date_of_departure,Services.ID_Services, Services.Name," +
                              "Services.Description,Services.The_cost,Rooms.Name,Rooms.Capacity,Rooms.Description,Rooms.The_cost" +
                              " FROM Clients INNER JOIN " +
                              "Rooms ON Clients.ID_Numbers = Rooms.ID_Numbers INNER JOIN " +
                              "[Services provided to the client] ON Clients.ID_Client = [Services provided to the client].ID_Client INNER JOIN " +
                              "Services ON [Services provided to the client].ID_Services = Services.ID_Services INNER JOIN " +
                              "Staff ON Clients.ID_Employee = Staff.ID_Employee";

            string[] explore = new string[] { "Код сотрудника", "Код должности", "Фамилия сотрудника", "Имя сотрудника", "Отчество сотрудника", "Возраст сотрудника", "Пол сотрудника", "Адрес по прописке сотрудника", "Адрес фактического проживание сотрудника", "Серия паспорта сотрудника", "Номер паспорта сотрудника", "Код подразделение сотрудника", "Дата выдачи паспорта сотруднику", "Кто выдал паспорт сотруднику", "Телефон сотрудника",
                                              "Код клиента", "Фамилия клиента", "Имя клиента", "Отчество клиента", "Адрес по прописке клиента", "Серия паспорта клиента", "Номер паспорта клиента", "Код подразделение клиента", "Дата выдачи паспорта клиента", "Кто выдал паспорт клиенту", "Дата выезда клиента", "Дата заселения клиента",
                                              "Код услуги", "Наименование услуги", "Описание услуги", "Стоимость услуги", "Наименование номера", "Вместимость номера", "Описание номера", "Стоимость номера" };
            CheckBox[] array_check = new CheckBox[] { Check_ID_Emp, Check_ID_Post, Check_Sur, Check_Names, Check_Patr, Check_Year, Check_Gendr, Check_Registered, Check_actual, Check_Series, Check_ID_Pass, Check_Subdivision, Check_Date, Check_Issued, Check_Phones,
                                                      Check_ID_Cli, Check_Familys, Check_Name, Check_Patrе, Check_Register, Check_Ceria, Check_ID_P, Check_Podrazdelenia, Check_Dates, Check_Is_Date, Check_Date_Vi, Check_Data_Za, Check_ID_Ser, Check_Nam, Check_Desc, Check_Cost,
                                                      Check_Nameq, Check_Capa, Check_Descr, Check_Cos };

            Query_input Query = new Query_input();

            Query.report_query(Field_name, query_output_name, query_input_name, array, line, explore, array_check, explorer_box, explorer_textBox, sql_fil_end, full_sql);
        }
        private void button_Click_6(object sender, RoutedEventArgs e)
        {
            string[] Field_name = new string[] { "Код сотрудника", "Фамилия", "Имя", "Отчество", "Возраст", "Пол", "Адрес по прописке",
                                                 "Адрес фактического проживание", "Серия", "Номер паспорта", "Подразделение", "Дата выдачи", "Кто выдал", "Телефон", "Код должности", "Наименование должности", "Обязанности", "Требование", "Оклад" };
            string[] query_input_name = new string[] { "Staff.ID_Employee", "Staff.Surname", "Staff.Name", "Staff.Patronymic", "Staff.Age", "Staff.Gender", "Staff.Registered_address", "Staff.Address_of_actual_residence", "Staff.Series", "Staff.ID_Passport", "Staff.Subdivision", "CAST(Staff.Date_of_issue AS varchar)",
                                                       "Staff.Issued_by", "Staff.Phone", "Positionen.ID_Position", "Positionen.Job_title", "Positionen.Duties", "Positionen.Requirements", "Positionen.Salary" };
            string[] query_output_name = new string[] { "ID_Employee", "Surname", "Name", "Patronymic", "Age", "Gender", "Registered_address", "Address_of_actual_residence", "Series", "ID_Passport", "Subdivision", "Date_of_issue",
                                                        "Issued_by", "Phone", "ID_Position", "Job_title", "Duties", "Requirements", "Salary" };

            string[] array       = new string[] { };
            string[] line        = new string[] { };
            string   sql_fil_end = " FROM Staff INNER JOIN Positionen ON Staff.ID_Position = Positionen.ID_Position";
            string   full_sql    = "SELECT Staff.ID_Employee, Staff.Surname, Staff.Name, Staff.Patronymic, Staff.Age, Staff.Gender, Staff.Registered_address, Staff.Address_of_actual_residence, Staff.Series, Staff.ID_Passport, Staff.Subdivision, " +
                                   " Staff.Date_of_issue, Staff.Issued_by, Staff.Phone, Positionen.ID_Position, Positionen.Job_title, Positionen.Duties, Positionen.Requirements, Positionen.Salary" +
                                   " FROM Staff INNER JOIN Positionen ON Staff.ID_Position = Positionen.ID_Position";

            string[] explore = new string[] { "Код сотрудника", "Фамилия", "Имя", "Отчество", "Возраст", "Пол", "Адрес по прописке",
                                              "Адрес фактического проживание", "Серия", "Номер паспорта", "Подразделение", "Дата выдачи", "Кто выдал", "Телефон", "Код должности", "Наименование должности", "Обязанности", "Требование", "Оклад" };
            CheckBox[] array_check = new CheckBox[] { Check_ID_Emp, Check_Sur, Check_Names, Check_Patr, Check_Year, Check_Gendr, Check_Registered, Check_actual, Check_Series, Check_ID_Pass, Check_Subdivision, Check_Date, Check_Issued, Check_Phones, Check_ID, Check_Job, Check_Dut, Check_Requ, Check_Sal };

            Query_input Query = new Query_input();

            Query.report_query(Field_name, query_output_name, query_input_name, array, line, explore, array_check, explorer_box, explorer_textBox, sql_fil_end, full_sql);
        }
Esempio n. 25
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string sql_query = SQL.Text;
            string db        = "";
            string dbo       = "";

            string[] exp      = sql_query.ToLower().Split(' ');
            string[] array_db = new string[] { "Staff", "Positionen", "Client", "Rooms", "Services", "Services provided to the client",
                                               "staff", "positionen", "client", "rooms", "services", "services provided to the client" };
            string[] array_dbo = new string[] { "dbo.[Staff]", "dbo.[Positionen]", "dbo.[Client]", "dbo.[Rooms]", "dbo.[Services]", "dbo.[Services provided to the client]",
                                                "dbo.[staff]", "dbo.[positionen]", "dbo.[client]", "dbo.[rooms]", "dbo.[services]", "dbo.[services provided to the client]" };
            for (int i = 0; i < array_db.Length; i++)
            {
                if (sql_query.Contains(array_db[i]))
                {
                    db += array_db[i];
                }
                if (sql_query.Contains(array_dbo[i]))
                {
                    dbo += array_db[i];
                }
            }
            foreach (string i in exp)
            {
                if (i == "GRANT SELECT")
                {
                    sql_query = SQL.Text;
                    Query_input Query = new Query_input();
                    Query.input(sql_query);
                    break;
                }
                if (i == "select")
                {
                    sql_query = SQL.Text;
                    Query_output Query = new Query_output();
                    Query.Output(sql_query, db, table);
                    break;
                }
                if (i == "select*from")
                {
                    sql_query = SQL.Text;
                    Query_output Query = new Query_output();
                    Query.Output(sql_query, db, table);
                    break;
                }
                if (i == "alter")
                {
                    sql_query = SQL.Text;
                    Query_input Query = new Query_input();
                    Query.input(sql_query);
                    break;
                }
                if (i == "insert")
                {
                    sql_query = SQL.Text;
                    Query_input Query = new Query_input();
                    Query.input(sql_query);
                    break;
                }
                if (i == "drop")
                {
                    sql_query = SQL.Text;
                    Query_input Query = new Query_input();
                    Query.input(sql_query);
                    break;
                }
                if (i == "update")
                {
                    sql_query = SQL.Text;
                    Query_input Query = new Query_input();
                    Query.input(sql_query);
                    break;
                }
                if (i == "delete")
                {
                    sql_query = SQL.Text;
                    Query_input Query = new Query_input();
                    Query.input(sql_query);
                    break;
                }
                if (i == "exec")
                {
                    sql_query = SQL.Text;
                    Query_output Query = new Query_output();
                    Query.Output(sql_query, db, table);
                    break;
                }
                if (i == "create")
                {
                    sql_query = SQL.Text;
                    Query_input Query = new Query_input();
                    Query.input(sql_query);
                    break;
                }
                if (i == "execute")
                {
                    sql_query = SQL.Text;
                    Query_input Query = new Query_input();
                    Query.input(sql_query);
                    break;
                }
                else
                {
                    MessageBox.Show("Запрос задан не верно или данная команда не используется в интерфейсе", "Уведомление");
                    break;
                }
            }
        }