Exemple #1
0
        public PogruzkaTovara()
        {
            Table_Class Nomera = new Table_Class($"SELECT dbo.NomeraDogovorov({Program.intID}, 0 )");

            Zapros = Nomera.table.Rows[0][0].ToString();
            InitializeComponent();
            dgPriemka.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
        }
Exemple #2
0
        private void PogruzkaTovaraFill(string query)
        {
            Action action = () =>
            {
                Table_Class tableClass = new Table_Class(query);
                tableClass.Dependency.OnChange += Dependency_OnChange;;
                dgPriemka.DataSource            = tableClass.table.DefaultView;
            };

            Invoke(action);
        }
        private void dgObrabotkaZakazFill()
        {
            Action action = () =>
            {
                Table_Class tableClass = new Table_Class("  select [Nomer_of_Dogovor] as \"Номер договора\",[Raschetniy_Schet] as \"Расчетный счет\",[Data_Peredachi] as \"Дата передачи договора\", [Name_of_Usluga] as \"Название услуги\", [Name_Pokupatelya] as \"Имя покупателя\" " +
                                                         "from [INGPROMTORG].[dbo].[Dogovora] inner join [INGPROMTORG].[dbo].[Usluga] on [INGPROMTORG].[dbo].[Dogovora].[Usluga_ID] = " +
                                                         "[INGPROMTORG].[dbo].[Usluga].[ID_Usluga] inner join [INGPROMTORG].[dbo].[Pokupatel] on [INGPROMTORG].[dbo].[Dogovora].[Pokupatel_ID] = [INGPROMTORG].[dbo].[Pokupatel].[ID_Pokupatel] " +
                                                         "INNER JOIN [dbo].[Tovarnaya_Nakladnaya] on [INGPROMTORG].[dbo].[Dogovora].[ID_Dogovor] = [INGPROMTORG].[dbo].[Tovarnaya_Nakladnaya].[Dogovor_ID] " +
                                                         $"WHERE [dbo].[Tovarnaya_Nakladnaya].[Sotrudnika_ID] = '{Program.intID}'");
                tableClass.Dependency.OnChange += Dependency_OnChange;
                dgObrabotkaZakaz.DataSource     = tableClass.table.DefaultView;
            };

            Invoke(action);
        }
Exemple #4
0
        private void dgSchetOtZavodaFill()
        {
            Action action = () =>
            {
                Table_Class tableClass = new Table_Class($"SELECT [Name_Tovara] as \"Название товара\", [Nomer_Tovara] as \"Номер товара\", " +
                                                         $"[Price_Tovara] as \"Цена товара\", [Kolichestvo_Tovara] as \"Кол-во товара\", " +
                                                         $"[Nazv_Tovarnoy_Nakladnoy] as \"Название товарной накладной\" FROM dbo.Tovar " +
                                                         $"inner join [dbo].[Tovarnaya_Nakladnaya] on dbo.Tovar.Tovarnoy_Nakladnoy_ID = [dbo].[Tovarnaya_Nakladnaya].[ID_Tovarnoy_Nakladnoy]" +
                                                         $"where [dbo].[Tovarnaya_Nakladnaya].[Sotrudnika_ID] = '{Program.intID}'");
                tableClass.Dependency.OnChange += Dependency_OnChange;
                dgTovar.DataSource              = tableClass.table.DefaultView;
            };

            Invoke(action);
        }
Exemple #5
0
 private void nudNomerDog_ValueChanged(object sender, EventArgs e)
 {
     if (nudNomerDog.Text != null && nudNomerDog.Value != 0)
     {
         Table_Class Nomera = new Table_Class($"SELECT dbo.NomeraDogovorov ({Program.intID},{nudNomerDog.Value})");
         Zapros = Nomera.table.Rows[0][0].ToString();
         PogruzkaTovaraFill(Zapros);
     }
     else
     {
         Table_Class Nomera = new Table_Class($"SELECT dbo.NomeraDogovorov({Program.intID}, 0 )");
         Zapros = Nomera.table.Rows[0][0].ToString();
         PogruzkaTovaraFill(Zapros);
     }
 }
Exemple #6
0
        private void dgTovarnNaklFill()
        {
            Action action = () =>
            {
                Table_Class tableClass = new Table_Class($"SELECT Tovarnaya_Nakladnaya.Nazv_Tovarnoy_Nakladnoy as \"Название товарной накладной\" " +
                                                         $",Tovarnaya_Nakladnaya.Nomer_Tovarnoy_Nakladnoy as \"Номер товарной накладной\"\r\n ,Sotrudniki.Name_Sotrudnika as \"Фамилия\"\r\n " +
                                                         $",Sotrudniki.Midlle_Name_Sotrudnika as \"Имя\"\r\n ,Sotrudniki.Last_Name_Sotrudnika as \"Отчество\"\r\n " +
                                                         $",Pokupatel.Name_Pokupatelya as \"Имя покупателя\"\r\n ,Pokupatel.Midlle_Name_Pokupatelya as \"Фамилия покупателя\"\r\n " +
                                                         $",Pokupatel.Last_Name_Pokupatelya as \"Отчество покупателя\" FROM dbo.Tovarnaya_Nakladnaya " +
                                                         $"INNER JOIN dbo.Sotrudniki\r\n  ON Tovarnaya_Nakladnaya.Sotrudnika_ID = Sotrudniki.ID_Sotrudnika" +
                                                         $" INNER JOIN dbo.Dogovora\r\n  ON Tovarnaya_Nakladnaya.Dogovor_ID = Dogovora.ID_Dogovor " +
                                                         $"INNER JOIN dbo.Pokupatel\r\n  ON Dogovora.Pokupatel_ID = Pokupatel.ID_Pokupatel " +
                                                         $"WHERE Sotrudnika_ID = {Program.intID}");
                tableClass.Dependency.OnChange += Dependency_OnChange;
                dgTovNakl.DataSource            = tableClass.table.DefaultView;
            };

            Invoke(action);
        }
        private void btEnter_Click(object sender, EventArgs e)
        {
            string      login      = tbLogin.Text.ToString();
            string      password   = tbPassword.Text.ToString();
            Table_Class tableClass = new Table_Class($"SELECT dbo.Auth ('{login}','{password}')");

            if (tableClass.table.Rows[0][0] != DBNull.Value)
            {
                Table_Class isSotrClass = new Table_Class($"SELECT ID_Sotrudnika, Name_Sotrudnika, Midlle_Name_Sotrudnika, Last_Name_Sotrudnika FROM [dbo].[Sotrudniki] WHERE [Sotrudnika_Login] = '{login}'");
                Program.intID = isSotrClass.table.Rows[0][0].ToString();
                FIO(isSotrClass.table.Rows[0][1].ToString(), isSotrClass.table.Rows[0][2].ToString(), isSotrClass.table.Rows[0][3].ToString());
                string Acess = tableClass.table.Rows[0][0].ToString();
                sot   = Acess[0].ToString();
                dol   = Acess[1].ToString();
                pokup = Acess[2].ToString();
                usl   = Acess[3].ToString();
                tovar = Acess[4].ToString();
                tovn  = Acess[5].ToString();
                trann = Acess[6].ToString();
                dog   = Acess[7].ToString();

                string   _pass  = "******";
                Rijndael cipher = new Rijndael();
                string   result = cipher.Encode(Acess.Trim(), _pass.Trim(), 256, true);

                RegistryKey registry = Registry.CurrentUser;
                RegistryKey key      = registry.CreateSubKey("Nevagno");
                key.SetValue("result", result);

                MainPage mainPage = new MainPage();
                mainPage.Show();
                this.Visible       = false;
                this.ShowInTaskbar = false;
            }
            else
            {
                MessageBox.Show("Не правильно введен логин или пароль!!!", "ИНЖПРОМТОРГ", MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                tbPassword.Text = "";
            }
        }