예제 #1
0
        public Form8()
        {
            InitializeComponent();

            logger = LogManager.GetCurrentClassLogger();
            cm     = new CurrentMethod();
        }
예제 #2
0
        public Form12()
        {
            InitializeComponent();
            logger = LogManager.GetCurrentClassLogger();
            cm     = new CurrentMethod();
            dataGridView1.BorderStyle = BorderStyle.None;
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(238, 239, 249);
            dataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical;
            dataGridView1.DefaultCellStyle.SelectionBackColor = Color.DarkTurquoise;
            dataGridView1.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            dataGridView1.BackgroundColor = Color.White;

            dataGridView1.EnableHeadersVisualStyles = false;
            dataGridView1.ColumnHeadersBorderStyle  = DataGridViewHeaderBorderStyle.None;
            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            dataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
            GetData("Select * From ViewTarif");
            dataGridView1.DataSource = bindingSource1;

            comboBox1.Size          = new Size(260, 26);
            comboBox2.Size          = new Size(121, 26);
            comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            comboBox4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            textBox1.Enabled        = false;
            textBox2.Enabled        = false;
            comboBox4.Enabled       = false;
            textBox4.Enabled        = false;
            comboBox1.Enabled       = false;
            comboBox2.Enabled       = false;
            label2.Text             = "";
            button2.Visible         = false;
            comboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
        }
예제 #3
0
        public Form14()
        {
            InitializeComponent();
            logger = LogManager.GetCurrentClassLogger();
            cm     = new CurrentMethod();
            GetData("SELECT * FROM News ORDER BY idNews DESC");
            dataGridView1.BorderStyle = BorderStyle.None;
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(238, 239, 249);
            dataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical;
            dataGridView1.DefaultCellStyle.SelectionBackColor = Color.DarkTurquoise;
            dataGridView1.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            dataGridView1.BackgroundColor = Color.White;

            dataGridView1.EnableHeadersVisualStyles = false;
            dataGridView1.ColumnHeadersBorderStyle  = DataGridViewHeaderBorderStyle.None;
            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            dataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
            dataGridView1.DataSource                = bindingSource1;
            dataGridView1.AutoSizeRowsMode          = DataGridViewAutoSizeRowsMode.AllCells;
            dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;

            textBox1.Enabled     = false;
            richTextBox1.Enabled = false;
            pictureBox1.Enabled  = false;
            label5.Visible       = false;
            button2.Visible      = true;
        }
예제 #4
0
        public Form3()
        {
            InitializeComponent();
            logger           = LogManager.GetCurrentClassLogger();
            cm               = new CurrentMethod();
            f2               = new Form2();
            textBox3.Visible = false;
            label3.Visible   = false;

            textBox2.UseSystemPasswordChar = true;
            label5.Visible = false;
        }
예제 #5
0
        public Form15()
        {
            InitializeComponent();
            dateNow = dateTimePicker1.Value;
            dateTimePicker1.Enabled = false;
            textBox1.Enabled        = false;
            textBox2.ReadOnly       = true;
            comboBox2.Enabled       = false;
            comboBox3.Enabled       = false;
            comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            comboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;

            logger = LogManager.GetCurrentClassLogger();
            cm     = new CurrentMethod();
            con    = new SqlConnection(connectionString);
            con.Open();
            string query;

            query = ("SELECT DISTINCT  Klass FROM KlassAvto ");
            SqlCommand     cmd1 = new SqlCommand(query, con);
            DataTable      tbl1 = new DataTable();
            SqlDataAdapter da   = new SqlDataAdapter(cmd1);

            da.Fill(tbl1);
            this.comboBox1.DataSource    = tbl1;
            this.comboBox1.DisplayMember = "Klass";// столбец для отображения
            //this.comboBox2.ValueMember = "idKlassa";//столбец с id
            this.comboBox1.SelectedIndex = -1;
            comboBox1.Text = "";
            con.Close();
            dataGridView1.BorderStyle = BorderStyle.None;
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(238, 239, 249);
            dataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical;
            dataGridView1.DefaultCellStyle.SelectionBackColor = Color.DarkTurquoise;
            dataGridView1.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            dataGridView1.BackgroundColor = Color.White;

            dataGridView1.EnableHeadersVisualStyles = false;
            dataGridView1.ColumnHeadersBorderStyle  = DataGridViewHeaderBorderStyle.None;
            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            dataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
            dataGridView1.DataSource                = bindingSource1;
            dataGridView1.AutoSizeRowsMode          = DataGridViewAutoSizeRowsMode.AllCells;
            dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
            label12.Visible = false;
            button1.Enabled = false;

            dateTimePicker1.Format       = DateTimePickerFormat.Custom;
            dateTimePicker1.CustomFormat = "dd.MM.yyyy HH:mm:ss";
            dateTimePicker1.MinDate      = DateTime.Now;
        }
예제 #6
0
        public Form2()
        {
            InitializeComponent();
            logger = LogManager.GetCurrentClassLogger();
            cm     = new CurrentMethod();

            if (Program.connectionError == true)
            {
                label4.Location = new Point(180, 356);
                label4.Visible  = true;
                label4.Text     = "Ошибка в файлах подключения, пожалуйста введите новые данные";
            }
        }
예제 #7
0
 public Form16()
 {
     InitializeComponent();
     logger = LogManager.GetCurrentClassLogger();
     cm     = new CurrentMethod();
     richTextBox1.Enabled = false;
     button1.Enabled      = false;
     richTextBox3.Enabled = false;
     textBox2.Enabled     = false;
     checkBox3.Enabled    = false;
     textBox3.Enabled     = false;
     richTextBox5.Enabled = false;
     button4.Enabled      = false;
     button3.Enabled      = false;
 }
예제 #8
0
        public Form10()
        {
            InitializeComponent();
            logger = LogManager.GetCurrentClassLogger();
            cm     = new CurrentMethod();
            dataGridView1.BorderStyle = BorderStyle.None;
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(238, 239, 249);
            dataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical;
            dataGridView1.DefaultCellStyle.SelectionBackColor = Color.DarkTurquoise;
            dataGridView1.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            dataGridView1.BackgroundColor = Color.White;

            dataGridView1.EnableHeadersVisualStyles = false;
            dataGridView1.ColumnHeadersBorderStyle  = DataGridViewHeaderBorderStyle.None;
            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            dataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
            GetData("select * from ViewAvto");
            dataGridView1.DataSource = bindingSource1;


            textBox1.Enabled  = false;
            textBox2.Enabled  = false;
            textBox3.Enabled  = false;
            textBox4.Enabled  = false;
            textBox5.Enabled  = false;
            textBox6.Enabled  = false;
            comboBox1.Enabled = false;
            comboBox2.Enabled = false;
            comboBox3.Enabled = false;
            comboBox4.Enabled = false;

            comboBox1.DropDownStyle          = System.Windows.Forms.ComboBoxStyle.DropDownList;
            comboBox2.DropDownStyle          = System.Windows.Forms.ComboBoxStyle.DropDownList;
            comboBox3.DropDownStyle          = System.Windows.Forms.ComboBoxStyle.DropDownList;
            comboBox4.DropDownStyle          = System.Windows.Forms.ComboBoxStyle.DropDownList;
            comboBox5.DropDownStyle          = System.Windows.Forms.ComboBoxStyle.DropDownList;
            toolStripComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;

            button2.Text      = "Подробная информация";
            button2.Size      = new Size(200, 29);
            button2.Location  = new Point(1150, 799);
            checkBox1.Enabled = false;


            checkAvto = true;
        }
예제 #9
0
 public Form4()
 {
     InitializeComponent();
     logger           = LogManager.GetCurrentClassLogger();
     cm               = new CurrentMethod();
     textBox9.Enabled = false;
     textBox8.Enabled = false;
     button4.Enabled  = false;
     button5.Enabled  = false;
     button6.Enabled  = false;
     textBox5.Enabled = false;
     textBox2.Select();
     button3.Enabled = false;
     textBox5.UseSystemPasswordChar = true;
     textBox8.UseSystemPasswordChar = true;
     checkBox1.Enabled       = false;
     checkBox2.Enabled       = false;
     dateTimePicker1.MinDate = DateTime.Now.AddYears(-18);
 }
예제 #10
0
        public Form7()
        {
            InitializeComponent();
            logger = LogManager.GetCurrentClassLogger();
            cm     = new CurrentMethod();
            // LoadData();

            dataGridView1.BorderStyle = BorderStyle.None;
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(238, 239, 249);
            dataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical;
            dataGridView1.DefaultCellStyle.SelectionBackColor = Color.DarkTurquoise;
            dataGridView1.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            dataGridView1.BackgroundColor = Color.White;

            dataGridView1.EnableHeadersVisualStyles = false;
            dataGridView1.ColumnHeadersBorderStyle  = DataGridViewHeaderBorderStyle.None;
            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            dataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
            GetData("select * from Polzovatel");
            dataGridView1.DataSource = bindingSource1;
            comboBox1.DropDownStyle  = System.Windows.Forms.ComboBoxStyle.DropDownList;

            textBox1.AutoSize = false;
            textBox1.Height   = 27;

            ////for (int i = 0; i < dataGridView1.RowCount; i++)
            ////{
            ////    for (int j = 0; j < dataGridView1.ColumnCount; j++)
            ////    {
            ////        if (Convert.ToString(dataGridView1.Rows[i].Cells[6].Value) == "False")
            ////        {

            ////            dataGridView1.Rows[i].Cells[6].Value = "Не подтвержден";
            ////        }
            ////        if (Convert.ToString(dataGridView1.Rows[i].Cells[6].Value) == "True")
            ////        {
            ////            dataGridView1.Rows[i].Cells[6].Value = "Подтвержден";
            ////        }
            ////    }
            ////}
        }
예제 #11
0
        public Form13()
        {
            InitializeComponent();
            logger = LogManager.GetCurrentClassLogger();
            cm     = new CurrentMethod();
            dataGridView1.BorderStyle = BorderStyle.None;
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(238, 239, 249);
            dataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical;
            dataGridView1.DefaultCellStyle.SelectionBackColor = Color.DarkTurquoise;
            dataGridView1.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            dataGridView1.BackgroundColor = Color.White;

            dataGridView1.EnableHeadersVisualStyles = false;
            dataGridView1.ColumnHeadersBorderStyle  = DataGridViewHeaderBorderStyle.None;
            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            dataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
            GetData("Select * From KlassAvto");
            dataGridView1.DataSource = bindingSource1;

            textBox1.Enabled = false;
            textBox2.Enabled = false;
            button2.Visible  = false;
        }
예제 #12
0
        public Form1()
        {
            InitializeComponent();
            StreamReader streamReader1;

            logger    = LogManager.GetCurrentClassLogger();
            cm        = new CurrentMethod();
            this.Text = "Главное меню";

            if (System.IO.File.Exists("ServerName.txt") && System.IO.File.Exists("DataBaseName.txt"))
            {
                string path  = "ServerName.txt";
                string path1 = "DataBaseName.txt";
                using (StreamReader sr = new StreamReader(path, System.Text.Encoding.Default))
                {
                    string line;
                    while ((line = sr.ReadLine()) != null)
                    {
                        Program.serverName = line;
                    }
                }
                using (StreamReader sr = new StreamReader(path1, System.Text.Encoding.Default))
                {
                    string line1;
                    while ((line1 = sr.ReadLine()) != null)
                    {
                        Program.bdName = line1;
                    }
                }
                try
                {
                    String connectionString = @"Data Source=" + Program.serverName + "Initial Catalog=" + Program.bdName + ";" +
                                              "Integrated Security=True";

                    con = new SqlConnection(connectionString);
                    con.Open();
                    SqlDataAdapter sda = new SqlDataAdapter("Select * From Admins", con);
                    DataTable      dt  = new DataTable();
                    sda.Fill(dt);
                    con.Close();
                }

                catch (Exception)
                {
                    f2 = new Form2();
                    /*settingsForm.*/
                    f2.ShowDialog();
                    Program.connectionError = true;
                }
            }
            else
            {
                f2 = new Form2();
                /*settingsForm.*/
                f2.ShowDialog();
            }

            f3 = new Form3();
            /*settingsForm.*/
            f3.ShowDialog();


            if (Program.adminOrUser == false)
            {
                button3.Visible = false;
                button6.Enabled = false;
            }
            if (Program.adminOrUser == true)
            {
                button3.Visible = true;
                button6.Visible = true;
                button1.Enabled = false;
                button2.Enabled = false;
            }

            if (Program.confirmUserOrNo == true)
            {
                button3.Visible = false;
                button6.Enabled = false;
                button1.Enabled = false;
            }
        }