示例#1
0
 public void ChekLoad()
 {
     try
     {
         Action action = () =>
         {
             try
             {
                 DataBaseTables dataComb = new DataBaseTables();
                 dataComb.dtChek.Clear();
                 dataComb.dtChekFill();
                 dataComb.dependency.OnChange        += Chekonchange;
                 dataGridView1.DataSource             = dataComb.dtChek;
                 dataGridView1.Columns[0].Visible     = false;
                 dataGridView1.Columns[4].Visible     = false;
                 dataGridView1.Columns[5].Visible     = false;
                 dataGridView1.Columns[8].Visible     = false;
                 dataGridView1.Columns[9].Visible     = false;
                 dataGridView1.Columns[1].HeaderText  = "№ Чека";
                 dataGridView1.Columns[2].HeaderText  = "ИНН";
                 dataGridView1.Columns[3].HeaderText  = "Дата и время продажи";
                 dataGridView1.Columns[6].HeaderText  = "Наименование товара";
                 dataGridView1.Columns[7].HeaderText  = "Кол-во";
                 dataGridView1.Columns[10].HeaderText = "ФИО сотрудника";
             }
             catch
             {
             }
         };
         Invoke(action);
     }
     catch { }
 }
示例#2
0
 private void SotrLoad()
 {
     try
     {
         Action action = () =>
         {
             try
             {
                 DataBaseTables dataComb = new DataBaseTables();
                 dataComb.dtSotr.Clear();
                 dataComb.dtSotrFill();
                 dataComb.dependency.OnChange       += Sotronchange;
                 dataGridView1.DataSource            = dataComb.dtSotr;
                 dataGridView1.Columns[0].Visible    = false;
                 dataGridView1.Columns[1].Visible    = false;
                 dataGridView1.Columns[2].Visible    = false;
                 dataGridView1.Columns[3].Visible    = false;
                 dataGridView1.Columns[5].HeaderText = "Дата рождения";
                 dataGridView1.Columns[6].HeaderText = "Адрес проживания";
             }
             catch
             {
             }
         };
         Invoke(action);
     }
     catch { }
 }
示例#3
0
        private void RightLo()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables dataComb = new DataBaseTables();
                    dataComb.dtAccess_rights.Clear();
                    dataComb.dtAccess_rightsFill();
                    dataComb.dependency.OnChange        += Righonchange;
                    dataGridView1.DataSource             = dataComb.dtAccess_rights;
                    dataGridView1.Columns[0].Visible     = false;
                    dataGridView1.Columns[13].Visible    = false;
                    dataGridView1.Columns[1].HeaderText  = "Должность";
                    dataGridView1.Columns[2].HeaderText  = "Профили";
                    dataGridView1.Columns[3].HeaderText  = "Клиенты";
                    dataGridView1.Columns[4].HeaderText  = "Сотрудники";
                    dataGridView1.Columns[5].HeaderText  = "Виды";
                    dataGridView1.Columns[6].HeaderText  = "Фирмы";
                    dataGridView1.Columns[7].HeaderText  = "Цвета";
                    dataGridView1.Columns[8].HeaderText  = "Пол";
                    dataGridView1.Columns[9].HeaderText  = "Товары";
                    dataGridView1.Columns[10].HeaderText = "Склад";
                    dataGridView1.Columns[11].HeaderText = "Приходы";
                    dataGridView1.Columns[12].HeaderText = "Чек";
                }
                catch
                {
                }
            };

            Invoke(action);
        }
示例#4
0
        public void otZaMes()
        {
            Documentacia configurationForm = new Documentacia();

            configurationForm.Documentacia_Load(null, null);
            switch (Registry_Class.DirPath == "Empry" || Registry_Class.OrganizationName == "Empty" ||
                    Registry_Class.DocBM == 0.0 || Registry_Class.DocTM == 0.0 ||
                    Registry_Class.DocRM == 0.0 || Registry_Class.DocLM == 0.0)
            {
            case (true):
                configurationForm.ShowDialog();
                break;

            case (false):
                DataBaseTables data = new DataBaseTables();
                data.qrChek = "SELECT  dbo.Chek.INN, dbo.Sotr.Surname_Sotr + ' ' + dbo.Sotr.Name_Sotr + ' ' + dbo.Sotr.Middle_name_Sotr, 'Фирма: ' + dbo.Firma.NaimFir + ', Вид: ' + dbo.Vidi_Tov.Naim + ', Пол: ' + dbo.Pol.Pol + ', Цвет: ' + dbo.Cvet_Tov.Cvet + ', Наименование товара: ' + dbo.Tovar.Naim AS 'Наименование товара', dbo.Chek.Kol_Vo* dbo.Tovar.Cena FROM   dbo.Chek INNER JOIN dbo.Sotr ON dbo.Chek.Login_Sotr = dbo.Sotr.Login_Sotr INNER JOIN dbo.Tovar ON dbo.Chek.ID_Tovar = dbo.Tovar.ID_Tovar INNER JOIN dbo.Firma ON dbo.Tovar.Firm_ID = dbo.Firma.ID_Firm INNER JOIN dbo.Pol ON dbo.Tovar.ID_Pol = dbo.Pol.ID_Pol INNER JOIN dbo.Cvet_Tov ON dbo.Tovar.ID_Cvet = dbo.Cvet_Tov.ID_Cvet INNER JOIN dbo.Vidi_Tov ON dbo.Tovar.ID_Vid = dbo.Vidi_Tov.ID_Vid where SUBSTRING(Data_Pech,4,2) = MONTH(GETDATE())";
                data.dtChekFill();
                WordDocument document = new WordDocument();
                command.CommandText = "SELECT  Sum(dbo.Chek.Kol_Vo* dbo.Tovar.Cena) FROM   dbo.Chek INNER JOIN dbo.Sotr ON dbo.Chek.Login_Sotr = dbo.Sotr.Login_Sotr INNER JOIN dbo.Tovar ON dbo.Chek.ID_Tovar = dbo.Tovar.ID_Tovar INNER JOIN dbo.Firma ON dbo.Tovar.Firm_ID = dbo.Firma.ID_Firm INNER JOIN dbo.Pol ON dbo.Tovar.ID_Pol = dbo.Pol.ID_Pol INNER JOIN dbo.Cvet_Tov ON dbo.Tovar.ID_Cvet = dbo.Cvet_Tov.ID_Cvet INNER JOIN dbo.Vidi_Tov ON dbo.Tovar.ID_Vid = dbo.Vidi_Tov.ID_Vid where SUBSTRING(Data_Pech,4,2) = MONTH(GETDATE())";
                Registry_Class.sqlConnection.Open();
                Itog = (decimal)command.ExecuteScalar();
                Registry_Class.sqlConnection.Close();
                document.table  = data.dtChek;
                document.table2 = Itog.ToString();
                document.CheckOtch2();
                break;
            }
        }
示例#5
0
 public void SotrLoad()
 {
     try
     {
         Action action = () =>
         {
             try
             {
                 DataBaseTables dataComb = new DataBaseTables();
                 dataComb.dtSotr.Clear();
                 dataComb.dtSotrFill();
                 //Test function
                 dataComb.dependency.OnChange += Sotronchange;
                 comboBox2.DataSource          = dataComb.dtSotr;
                 comboBox2.ValueMember         = "Login_Sotr";
                 comboBox2.DisplayMember       = "ФИО";
                 imya = comboBox2.Text;
             }
             catch
             {
             }
         };
         Invoke(action);
     }
     catch { }
 }
示例#6
0
        private void textBox8_TextChanged(object sender, EventArgs e)
        {
            DataBaseTables data = new DataBaseTables();

            data.qrSklad += "and dbo.Firma.NaimFir like '%" + textBox8.Text + "%'" +
                            " or dbo.Vidi_Tov.Naim like '%" + textBox8.Text + "%' or dbo.Tovar.Naim like '%" + textBox8.Text + "%' or dbo.Pol.Pol like '%" + textBox8.Text + "%' or dbo.Cvet_Tov.Cvet like '%" + textBox8.Text + "%' or " +
                            " dbo.Sklad.Kol_vo_Tov like '%" + textBox8.Text + "%'";
            data.dtSkladFill();
            dataGridView1.DataSource            = data.dtSklad;
            dataGridView1.Columns[0].Visible    = false;
            dataGridView1.Columns[1].Visible    = false;
            dataGridView1.Columns[2].HeaderText = "Товар";
            dataGridView1.Columns[2].Width      = 300;
            dataGridView1.Columns[3].HeaderText = "Количество";
        }
示例#7
0
        private void CbPolLoad()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables tables = new DataBaseTables();
                    tables.dtPolFill();
                    tables.dependency.OnChange += CbPolonchange;
                    comboBox1.DataSource        = tables.dtPol;
                    comboBox1.ValueMember       = "ID_Pol";
                    comboBox1.DisplayMember     = "Pol";
                }
                catch
                {
                }
            };

            Invoke(action);
        }
示例#8
0
        private void CbVidiLoad()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables tables = new DataBaseTables();
                    tables.dtVidi_TovFill();
                    tables.dependency.OnChange += CbVidionchange;
                    comboBox3.DataSource        = tables.dtVidi_Tov;
                    comboBox3.ValueMember       = "ID_Vid";
                    comboBox3.DisplayMember     = "Naim";
                }
                catch
                {
                }
            };

            Invoke(action);
        }
示例#9
0
        private void CbCvetaLoad()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables tables = new DataBaseTables();
                    tables.dtCvet_TovFill();
                    tables.dependency.OnChange += CbCvetaonchange;
                    comboBox2.DataSource        = tables.dtCvet_Tov;
                    comboBox2.ValueMember       = "ID_Cvet";
                    comboBox2.DisplayMember     = "Cvet";
                }
                catch
                {
                }
            };

            Invoke(action);
        }
示例#10
0
        private void CbFirmLoad()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables tables = new DataBaseTables();
                    tables.dtFirmaFill();
                    tables.dependency.OnChange += CbFirmonchange;
                    comboBox4.DataSource        = tables.dtFirma;
                    comboBox4.ValueMember       = "ID_Firm";
                    comboBox4.DisplayMember     = "NaimFir";
                }
                catch
                {
                }
            };

            Invoke(action);
        }
示例#11
0
        private void TovarLoad()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables dataComb = new DataBaseTables();
                    dataComb.dtTovar.Clear();
                    dataComb.dtTovarFill();
                    dataComb.dependency.OnChange += Tovaronchange;
                    comboBox4.DataSource          = dataComb.dtTovar;
                    comboBox4.ValueMember         = "ID_Tovar";
                    comboBox4.DisplayMember       = "Товар";
                }
                catch
                {
                }
            };

            Invoke(action);
        }
示例#12
0
        private void AccSotrLoad()
        {
            try
            {
                Action action = () =>
                {
                    try
                    {
                        DataBaseTables dataComb = new DataBaseTables();
                        dataComb.dtProfile1.Clear();
                        dataComb.dtProfileSotrFill();
                        dataComb.dependency.OnChange += AccSotrLoadonchange;
                        dataGridView2.DataSource      = dataComb.dtProfile1;

                        Thread prov = new Thread(ProverkaS);
                        prov.Start();
                        dataGridView2.Columns[2].Visible     = false;
                        dataGridView2.Columns[4].Visible     = false;
                        dataGridView2.Columns[5].Visible     = false;
                        dataGridView2.Columns[6].Visible     = false;
                        dataGridView2.Columns[7].Visible     = false;
                        dataGridView2.Columns[8].Visible     = false;
                        dataGridView2.Columns[14].Visible    = false;
                        dataGridView2.Columns[0].HeaderText  = "Логин";
                        dataGridView2.Columns[1].HeaderText  = "Пароль";
                        dataGridView2.Columns[3].HeaderText  = "Должность";
                        dataGridView2.Columns[9].HeaderText  = "Фамилия";
                        dataGridView2.Columns[10].HeaderText = "Имя";
                        dataGridView2.Columns[11].HeaderText = "Отчество";
                        dataGridView2.Columns[12].HeaderText = "Дата рождения";
                        dataGridView2.Columns[13].HeaderText = "Адрес";
                    }
                    catch
                    {
                    }
                };
                Invoke(action);
            }
            catch { }
        }
示例#13
0
        private void CvetaLoad()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables tables = new DataBaseTables();
                    tables.dtCvet_TovFill();
                    tables.dependency.OnChange += Cvetaonchange;
                    listBox2.DataSource         = tables.dtCvet_Tov;
                    listBox2.ValueMember        = "ID_Cvet";
                    listBox2.DisplayMember      = "Cvet";
                    Thread threadCvet = new Thread(CbCvetaLoad);
                    threadCvet.Start();
                }
                catch
                {
                }
            };

            Invoke(action);
        }
示例#14
0
        private void VidiLoad()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables tables = new DataBaseTables();
                    tables.dtVidi_TovFill();
                    tables.dependency.OnChange += Vidionchange;
                    listBox3.DataSource         = tables.dtVidi_Tov;
                    listBox3.ValueMember        = "ID_Vid";
                    listBox3.DisplayMember      = "Naim";
                    Thread threadVid = new Thread(CbVidiLoad);
                    threadVid.Start();
                }
                catch
                {
                }
            };

            Invoke(action);
        }
示例#15
0
        private void FirmLoad()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables tables = new DataBaseTables();
                    tables.dtFirmaFill();
                    tables.dependency.OnChange += Firmonchange;
                    listBox1.DataSource         = tables.dtFirma;
                    listBox1.ValueMember        = "ID_Firm";
                    listBox1.DisplayMember      = "NaimFir";
                    Thread threadfirm = new Thread(CbFirmLoad);
                    threadfirm.Start();
                }
                catch
                {
                }
            };

            Invoke(action);
        }
示例#16
0
 private void TovariLoad()
 {
     try
     {
         Action action = () =>
         {
             try
             {
                 DataBaseTables dataComb = new DataBaseTables();
                 dataComb.dtTovar.Clear();
                 dataComb.dtTovarFill();
                 dataComb.dependency.OnChange        += Tovonchange;
                 dataGridView1.DataSource             = dataComb.dtTovar;
                 dataGridView1.Columns[0].Visible     = false;
                 dataGridView1.Columns[2].Visible     = false;
                 dataGridView1.Columns[3].Visible     = false;
                 dataGridView1.Columns[6].Visible     = false;
                 dataGridView1.Columns[7].Visible     = false;
                 dataGridView1.Columns[9].Visible     = false;
                 dataGridView1.Columns[10].Visible    = false;
                 dataGridView1.Columns[12].Visible    = false;
                 dataGridView1.Columns[13].Visible    = false;
                 dataGridView1.Columns[15].Visible    = false;
                 dataGridView1.Columns[1].HeaderText  = "Наименование";
                 dataGridView1.Columns[4].HeaderText  = "Фирма";
                 dataGridView1.Columns[5].HeaderText  = "Цена";
                 dataGridView1.Columns[8].HeaderText  = "Пол";
                 dataGridView1.Columns[11].HeaderText = "Цвет";
                 dataGridView1.Columns[14].HeaderText = "Вид";
             }
             catch
             {
             }
         };
         Invoke(action);
     }
     catch { }
 }
示例#17
0
        private void otch()
        {
            Documentacia configurationForm = new Documentacia();

            configurationForm.Documentacia_Load(null, null);
            switch (Registry_Class.DirPath == "Empry" || Registry_Class.OrganizationName == "Empty" ||
                    Registry_Class.DocBM == 0.0 || Registry_Class.DocTM == 0.0 ||
                    Registry_Class.DocRM == 0.0 || Registry_Class.DocLM == 0.0)
            {
            case (true):
                configurationForm.ShowDialog();
                break;

            case (false):
                DataBaseTables data = new DataBaseTables();
                data.qrSklad = "SELECT 'Фирма: ' + dbo.Firma.NaimFir + ', Вид: ' + dbo.Vidi_Tov.Naim + ', Пол: ' + dbo.Pol.Pol + ', Цвет: ' + dbo.Cvet_Tov.Cvet + ', Наимнование товара: ' + dbo.Tovar.Naim AS 'Наименование товара', dbo.Sklad.Kol_vo_Tov FROM   dbo.Cvet_Tov INNER JOIN dbo.Tovar ON dbo.Cvet_Tov.ID_Cvet = dbo.Tovar.ID_Cvet INNER JOIN dbo.Firma ON dbo.Tovar.Firm_ID = dbo.Firma.ID_Firm INNER JOIN dbo.Pol ON dbo.Tovar.ID_Pol = dbo.Pol.ID_Pol INNER JOIN dbo.Sklad ON dbo.Tovar.ID_Tovar = dbo.Sklad.ID_Tovar INNER JOIN dbo.Vidi_Tov ON dbo.Tovar.ID_Vid = dbo.Vidi_Tov.ID_Vid ";
                data.dtSkladFill();
                PDFDocument document = new PDFDocument();
                document.dtDannieSklada = data.dtSklad;
                document.Docum();
                break;
            }
        }
示例#18
0
        private void PrihLoad()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables dataComb = new DataBaseTables();
                    dataComb.dtPrihod.Clear();
                    dataComb.dtPrihodFill();
                    dataComb.dependency.OnChange       += Prihonchange;
                    dataGridView1.DataSource            = dataComb.dtPrihod;
                    dataGridView1.Columns[0].Visible    = false;
                    dataGridView1.Columns[1].Visible    = false;
                    dataGridView1.Columns[2].HeaderText = "Товар";
                    dataGridView1.Columns[2].Width      = 300;
                    dataGridView1.Columns[3].HeaderText = "Количество";
                }
                catch
                {
                }
            };

            Invoke(action);
        }
示例#19
0
        public void otch()
        {
            Documentacia configurationForm = new Documentacia();

            configurationForm.Documentacia_Load(null, null);
            switch (Registry_Class.DirPath == "Empry" || Registry_Class.OrganizationName == "Empty" ||
                    Registry_Class.DocBM == 0.0 || Registry_Class.DocTM == 0.0 ||
                    Registry_Class.DocRM == 0.0 || Registry_Class.DocLM == 0.0)
            {
            case (true):

                configurationForm.ShowDialog();
                break;

            case (false):
                DataBaseTables data = new DataBaseTables();
                data.qrSotr = "SELECT dbo.Sotr.Surname_Sotr + ' ' + dbo.Sotr.Name_Sotr + ' ' + dbo.Sotr.Middle_name_Sotr, dbo.Sotr.The_date_of_the_Rojd, dbo.Access_rights.Dolj FROM   dbo.Access_rights INNER JOIN dbo.Profile ON dbo.Access_rights.ID_Access_rights = dbo.Profile.Access_rights_ID INNER JOIN dbo.Sotr ON dbo.Profile.Login_Profile = dbo.Sotr.Login_Sotr ORDER BY dbo.Access_rights.Dolj ASC";
                data.dtSotrFill();
                ExcelDocument document = new ExcelDocument();
                document.dtDannieSklada = data.dtSotr;
                document.SpisokSotr();
                break;
            }
        }
示例#20
0
        private void AccRLoad()
        {
            Action action = () =>
            {
                try
                {
                    DataBaseTables dataComb = new DataBaseTables();
                    dataComb.dtAccess_rights.Clear();
                    dataComb.dtAccess_rightsFill();
                    dataComb.dependency.OnChange += AccRoadonchange;
                    comboBox1.DataSource          = dataComb.dtAccess_rights;
                    comboBox2.DataSource          = dataComb.dtAccess_rights;
                    comboBox1.ValueMember         = "ID_Access_rights";
                    comboBox1.DisplayMember       = "Dolj";
                    comboBox2.ValueMember         = "ID_Access_rights";
                    comboBox2.DisplayMember       = "Dolj";
                }
                catch
                {
                }
            };

            Invoke(action);
        }