Ejemplo n.º 1
0
 public Update_client(FormAdmin f, int client_id)
 {
     InitializeComponent();
     this.Icon         = Properties.Resources.WCL_1;
     label1.Left       = panel1.Width / 2 - label1.Width / 2;
     button2.Left      = panel1.Width / 2 - button2.Width / 2;
     button2.BackColor = Color.FromArgb(44, 183, 227);
     this.f            = f;
     this.client_id    = client_id;
     try
     {
         Connect.Open();
         MySqlCommand    cl_data = new MySqlCommand("select * from `cliente` where id=" + client_id, Connect);
         MySqlDataReader reader  = cl_data.ExecuteReader();
         while (reader.Read())
         {
             tb_fio.Text       = Crypt.Crypt.Decrypt(reader[1].ToString());
             tb_telephone.Text = Crypt.Crypt.Decrypt(reader[2].ToString());
             tb_email.Text     = Crypt.Crypt.Decrypt(reader[3].ToString());
             tb_addit.Text     = Crypt.Crypt.Decrypt(reader[4].ToString());
         }
         Connect.Close();
     }
     catch (Exception ex)
     {
         metroProgressSpinner1.Visible = true;
         MyMessageBox.Show(Owner, ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error, 150, 400);
         metroProgressSpinner1.Visible = false;
     }
 }
Ejemplo n.º 2
0
 public Update_order(FormAdmin f, int order_id)
 {
     InitializeComponent();
     this.f        = f;
     this.order_id = order_id;
     Properties.Settings.Default.FlagRole = true;
 }
Ejemplo n.º 3
0
 public Add_order(FormAdmin f)
 {
     InitializeComponent();
     this.Icon         = Properties.Resources.WCL_1;
     this.f            = f;
     label1.Left       = panel1.Width / 2 - label1.Width / 2;
     button2.Left      = panel1.Width / 2 - button2.Width / 2;
     button2.BackColor = Color.FromArgb(44, 183, 227);
 }
Ejemplo n.º 4
0
 public Add_worker(FormAdmin f)
 {
     InitializeComponent();
     this.Icon         = Properties.Resources.WCL_1;
     this.f            = f;
     label1.Left       = panel1.Width / 2 - label1.Width / 2;
     button2.Left      = panel1.Width / 2 - button2.Width / 2;
     button2.BackColor = Color.FromArgb(44, 183, 227);
     gen.position_for_cb(cb_status);
 }
Ejemplo n.º 5
0
 private void bt_login_Click_1(object sender, EventArgs e)
 {
     try
     {
         Connection = new MySqlConnection(Properties.Settings.Default.ConStr);
         Connection.Open();
         MySqlCommand selectUser = new MySqlCommand("select * from `workers` where `login`='" +
                                                    Crypt.Crypt.Encrypt(tb_login.Text) +
                                                    "' and `password`='" +
                                                    Crypt.Crypt.Encrypt(tb_pass.Text) + "'", Connection);
         MySqlDataReader reader = null;
         reader = selectUser.ExecuteReader();
         bool flag      = false;
         int  user_id   = 0;
         int  user_role = 1;
         while (reader.Read())
         {
             flag      = true;
             user_id   = Convert.ToInt32(reader[0]);
             user_role = Convert.ToInt32(reader[5]);
         }
         if (flag)
         {
             this.Hide();
             Properties.Settings.Default.StartForm = this;
             if (user_role == 1)
             {
                 FormMaster f = new FormMaster(user_id);
                 f.ShowDialog();
             }
             else
             {
                 FormAdmin f = new FormAdmin(user_id);
                 f.ShowDialog();
             }
             l_message.Text = "";
         }
         else
         {
             l_message.Text = "Неверный логин или пароль";
         }
         Connection.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         //MyMessageBox.Show(Owner, ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error, 150, 400);
     }
 }
Ejemplo n.º 6
0
 public Update_worker(FormAdmin f, int worker_id)
 {
     InitializeComponent();
     this.Icon         = Properties.Resources.WCL_1;
     this.f            = f;
     this.worker_id    = worker_id;
     label1.Left       = panel1.Width / 2 - label1.Width / 2;
     button2.Left      = panel1.Width / 2 - button2.Width / 2;
     button2.BackColor = Color.FromArgb(44, 183, 227);
     gen.position_for_cb(cb_position);
     gen.role_for_cb(cb_role);
     cb_role.SelectedIndex     = gen.role_index(worker_id);
     cb_position.SelectedIndex = gen.position_index(worker_id);
     try
     {
         Connect.Open();
         MySqlCommand    get_wrkr = new MySqlCommand("select * from `workers` where id=" + worker_id, Connect);
         MySqlDataReader reader   = get_wrkr.ExecuteReader();
         while (reader.Read())
         {
             tb_fio.Text          = Crypt.Crypt.Decrypt(reader[1].ToString());
             tb_email.Text        = Crypt.Crypt.Decrypt(reader[3].ToString());
             tb_login.Text        = Crypt.Crypt.Decrypt(reader[6].ToString());
             tb_password.Text     = Crypt.Crypt.Decrypt(reader[7].ToString());
             tb_telephone.Text    = Crypt.Crypt.Decrypt(reader[8].ToString());
             metroDateTime1.Value = Convert.ToDateTime(reader[2]);
             metroDateTime2.Value = Convert.ToDateTime(reader[4]);
         }
         Connect.Close();
     }
     catch (Exception ex)
     {
         metroProgressSpinner1.Visible = true;
         MyMessageBox.Show(Owner, ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error, 150, 400);
         metroProgressSpinner1.Visible = false;
     }
 }
Ejemplo n.º 7
0
        public Settings_report(FormAdmin f)
        {
            InitializeComponent();
            this.f = f;
            string[] arr =
            {
                "Дата начала (= От)",
                "Дата начала (От и До)",
                "Дата окончания (= От)",
                "Дата окончания (От и До)",
                "Дата начала и окончания (>=От и <=До)",
                "Дата начала и окончания (От и До)",
                "Не законченные"
            };
            foreach (string s in arr)
            {
                cb_style_date.Items.Add(s);
            }
            cb_style_date.Text = cb_style_date.Items[0].ToString();


            string[] array =
            {
                "id",
                "Сотрудник",
                "Клиент",
                "Тема",
                "Статус",
                "Стоимость",
                "html код"
            };
            foreach (string s in array)
            {
                cb_field.Items.Add(s);
            }
            cb_field.Text = cb_field.Items[0].ToString();
            string[] arr_size =
            {
                "6",
                "8",
                "10",
                "12",
                "14",
                "16",
                "18",
                "20"
            };
            cb_size_text.Items.Clear();
            foreach (string s in arr_size)
            {
                cb_size_text.Items.Add(s);
            }
            string[] array_styles =
            {
                "Calibri",
                "Times New Roman",
                "Arial",
                "Georgia",
                "Tahoma",
                "Verdana",
            };
            foreach (string s in array_styles)
            {
                cb_style_text.Items.Add(s);
            }
        }