Ejemplo n.º 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 { }
 }
Ejemplo n.º 2
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;
            }
        }