Пример #1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (txt_name.Text.Trim() != "" && cbx_owner.SelectedItem != null && txt_phone.Text.Trim() != "" && dp_date.SelectedDate != null && txt_number.Text.Trim() != "")
         {
             if (howform)
             {
                 WorkSQL.sql_p = "select add_company('" + txt_name.Text.Trim() + "','"
                                 + cbx_owner.SelectedItem + "','" + txt_phone.Text.Trim() + "','"
                                 + ((DateTime)dp_date.SelectedDate).ToString("dd-MM-yyyy") + "','"
                                 + txt_number.Text.Trim() + "');";
                 WorkSQL.ExecuteSQL();
             }
             else
             {
                 WorkSQL.sql_p = "select update_company('" + WorkSQL.drv_p.Row.ItemArray[0] + "','" + txt_name.Text.Trim() + "','"
                                 + cbx_owner.SelectedItem + "','" + txt_phone.Text.Trim() + "','"
                                 + ((DateTime)dp_date.SelectedDate).ToString("dd-MM-yyyy") + "','"
                                 + txt_number.Text.Trim() + "');";
                 WorkSQL.ExecuteSQL();
             }
             this.Close();
         }
         else
         {
             MessageBox.Show("Заполните все поля!");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (cbx_employee.SelectedItem != null && cbx_department.SelectedItem != null)
         {
             if (howform)
             {
                 WorkSQL.sql_p = "select add_cross('" + cbx_department.SelectedItem + "','"
                                 + cbx_employee.SelectedItem + "');";
                 WorkSQL.ExecuteSQL();
             }
             else
             {
                 WorkSQL.sql_p = "select update_cross('" + WorkSQL.drv_p.Row.ItemArray[0] + "','" + cbx_department.SelectedItem + "','"
                                 + cbx_employee.SelectedItem + "');";
                 WorkSQL.ExecuteSQL();
             }
             this.Close();
         }
         else
         {
             MessageBox.Show("Заполните все поля!");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #3
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (cbx_login.SelectedItem != null)
     {
         WorkSQL.sql_p = "select drop_user('" + cbx_login.SelectedItem + "')";
         WorkSQL.ExecuteSQL();
         this.Close();
     }
     else
     {
         MessageBox.Show("Заполните все поля!");
     }
 }
Пример #4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (txt_login.Text.Trim() != "" && txt_password.Text.Trim() != "")
                {
                    if (temp)
                    {
                        if (who)
                        {
                            WorkSQL.sql_p = "select create_user('" + txt_login.Text.Trim().ToLower() +
                                            "','" + txt_password.Text.Trim() + "','Tax_Employee');";
                            WorkSQL.ExecuteSQL();

                            WorkSQL.sql_p = "select add_users_employee('" + txt_login.Text.Trim().ToLower() + "');";
                            WorkSQL.ExecuteSQL();
                        }
                        else
                        {
                            WorkSQL.sql_p = "select create_user('" + txt_login.Text.Trim().ToLower() +
                                            "','" + txt_password.Text.Trim() + "','Tax_SuperVisor');";
                            WorkSQL.ExecuteSQL();
                        }
                    }
                    else
                    {
                    }
                    temp = false;
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Заполните все поля!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #5
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (txt_first.Text.Trim() != "" && txt_second.Text.Trim() != "" && txt_middle.Text.Trim() != "" && dp_date.SelectedDate != null && txt_position.Text.Trim() != "" && txt_salary.Text.Trim() != "" && cbx_education.SelectedItem != null)
                {
                    if (howform)
                    {
                        WorkSQL.sql_p = "select add_employee('" + txt_first.Text.Trim() + "','"
                                        + txt_second.Text.Trim() + "','" + txt_middle.Text.Trim() + "','"
                                        + ((DateTime)dp_date.SelectedDate).ToString("dd-MM-yyyy") + "','"
                                        + txt_position.Text.Trim() + "','" + txt_salary.Text.Trim() + "','"
                                        + cbx_education.SelectedItem + "');";
                        WorkSQL.ExecuteSQL();

                        AddUsers au = new AddUsers(true, true);
                        au.ShowDialog();
                    }
                    else
                    {
                        WorkSQL.sql_p = "select update_employee('" + WorkSQL.drv_p.Row.ItemArray[0] + "','" + txt_first.Text.Trim() + "','"
                                        + txt_second.Text.Trim() + "','" + txt_middle.Text.Trim() + "','"
                                        + ((DateTime)dp_date.SelectedDate).ToString("dd-MM-yyyy") + "','"
                                        + txt_position.Text.Trim() + "','" + txt_salary.Text.Trim() + "','"
                                        + cbx_education.SelectedItem + "');";
                        WorkSQL.ExecuteSQL();
                    }
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Заполните все поля!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #6
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (txt_name.Text.Trim() != "")
                {
                    if (howform)
                    {
                        switch (howhelper)
                        {
                        case 1:
                            WorkSQL.sql_p = "select add_education('" + txt_name.Text.Trim() + "');";
                            break;

                        case 2:
                            WorkSQL.sql_p = "select add_type('" + txt_name.Text.Trim() + "');";
                            break;

                        case 3:
                            WorkSQL.sql_p = "select add_title('" + txt_name.Text.Trim() + "');";
                            break;

                        case 4:
                            WorkSQL.sql_p = "select add_kind('" + txt_name.Text.Trim() + "');";
                            break;

                        case 5:
                            WorkSQL.sql_p = "select add_owner_ship('" + txt_name.Text.Trim() + "');";
                            break;
                        }
                        WorkSQL.ExecuteSQL();
                    }
                    else
                    {
                        switch (howhelper)
                        {
                        case 1:
                            WorkSQL.sql_p = "select update_education('" + WorkSQL.drv_p.Row.ItemArray[0] + "','" + txt_name.Text.Trim() + "');";
                            break;

                        case 2:
                            WorkSQL.sql_p = "select update_type('" + WorkSQL.drv_p.Row.ItemArray[0] + "','" + txt_name.Text.Trim() + "');";
                            break;

                        case 3:
                            WorkSQL.sql_p = "select update_title('" + WorkSQL.drv_p.Row.ItemArray[0] + "','" + txt_name.Text.Trim() + "');";
                            break;

                        case 4:
                            WorkSQL.sql_p = "select update_kind('" + WorkSQL.drv_p.Row.ItemArray[0] + "','" + txt_name.Text.Trim() + "');";
                            break;

                        case 5:
                            WorkSQL.sql_p = "select update_owner_ship('" + WorkSQL.drv_p.Row.ItemArray[0] + "','" + txt_name.Text.Trim() + "');";
                            break;
                        }
                        WorkSQL.ExecuteSQL();
                    }
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Заполните все поля!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }