public AddEmployeeForm()
        {
            InitializeComponent();

            _connectEmployee = new EmployeeMySql();
            _connectPosition = new PositionMySql();

            UpdatePositionComboBox();
        }
示例#2
0
        public DirectSettingForm()
        {
            InitializeComponent();

            _connectEmployee = new EmployeeMySql();
            _connectPosition = new PositionMySql();

            UpdatePositionListBox();
            UpdateDataEmplMeth();
            ShowCategory();
        }
示例#3
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            var connect = new EmployeeMySql();

            var user = new Employee();

            _userProfileConfig.Name     = NameTextBox.Text;
            _userProfileConfig.Surname  = SurnameTextBox.Text;
            _userProfileConfig.Lastname = LastnameTextBox.Text;
            _userProfileConfig.Password = PasswordTextBox.Text;
            _userProfileConfig.Username = UsernameTextBox.Text;

            connect.UpdateEmployee(_userProfileConfig);

            MessageBox.Show("Ваши новые данные сохранены!",
                            "Изменение данных", MessageBoxButtons.OK, MessageBoxIcon.Information);

            UserProfile.EnterUserData(_userProfileConfig.Username);

            Close();
        }
示例#4
0
        private void ShowGager()
        {
            var emplMysql = new EmployeeMySql();

            var emplList = emplMysql.GetEmplBase();

            foreach (var t in emplList)
            {
                if (t.IdPosition == 3)
                {
                    var workes = new Workes()
                    {
                        Title = t.Surname + " " + t.Name, IdWorkes = t.Id
                    };


                    GagerListBox.Items.Add(workes);
                }

                GagerListBox.DisplayMember = "Title";
                GagerListBox.ValueMember   = "IdWorkes";
            }
        }
示例#5
0
        public static void EnterUserData(string userName)
        {
            var connectUserProfile = new EmployeeMySql();

            Data = connectUserProfile.GetDataProfile(userName);
        }
示例#6
0
        /// <summary>
        /// Метод добавления элементов новой таблицы замеров.
        /// </summary>
        private void AddItemsTableFroze(int height, bool addBtn, int count, int idGager)
        {
            var newDateTimePicker     = new DateTimePicker();
            var nameGagerTextBox      = new TextBox();
            var directionComboBox     = new ComboBox();
            var showGagerDataGridView = new DataGridView();
            var numberColumn          = new DataGridViewTextBoxColumn();
            var timeColumn            = new DataGridViewTextBoxColumn();
            var cityColumn            = new DataGridViewTextBoxColumn();
            var streetColumn          = new DataGridViewTextBoxColumn();
            var homeColumn            = new DataGridViewTextBoxColumn();
            var apartmentColumn       = new DataGridViewTextBoxColumn();
            var phoneColumn           = new DataGridViewTextBoxColumn();
            var commentColumn         = new DataGridViewTextBoxColumn();
            var frozeColumn           = new DataGridViewTextBoxColumn();

            newDateTimePicker.CustomFormat  = "dd/MM/yyyy";
            newDateTimePicker.Format        = System.Windows.Forms.DateTimePickerFormat.Custom;
            newDateTimePicker.Location      = new System.Drawing.Point(5, height + 4);
            newDateTimePicker.Name          = "dateTimePicker" + count.ToString();
            newDateTimePicker.Size          = new System.Drawing.Size(84, 20);
            newDateTimePicker.TabIndex      = 4;
            newDateTimePicker.ValueChanged += new System.EventHandler(this.ChangeDateTime_ValueChanged);
            _dateTimePickerList.Add(newDateTimePicker);

            var emplMysql = new EmployeeMySql();
            var empl      = emplMysql.GetEmpl(idGager);

            nameGagerTextBox.Location = new System.Drawing.Point(5, height + 35);
            nameGagerTextBox.Name     = "GagerNameTextBox" + count.ToString();
            nameGagerTextBox.Size     = new System.Drawing.Size(149, 23);
            nameGagerTextBox.TabIndex = 5;
            nameGagerTextBox.Text     = empl.Surname + " " + empl.Name;
            nameGagerTextBox.ReadOnly = true;
            _nameGagerTextBoxList.Add(nameGagerTextBox);

            directionComboBox.FormattingEnabled = true;
            directionComboBox.Location          = new System.Drawing.Point(160, height + 37);
            directionComboBox.Name     = "comboBox" + count.ToString();
            directionComboBox.Size     = new System.Drawing.Size(152, 21);
            directionComboBox.TabIndex = 6;
            directionComboBox.Text     = "Выбрать направление";
            _directionComboBoxList.Add(directionComboBox);

            showGagerDataGridView.Anchor = (AnchorStyles)((AnchorStyles.Top | AnchorStyles.Left)
                                                          | AnchorStyles.Right);
            showGagerDataGridView.AutoSizeColumnsMode         = DataGridViewAutoSizeColumnsMode.Fill;
            showGagerDataGridView.BorderStyle                 = BorderStyle.None;
            showGagerDataGridView.ColumnHeadersHeightSizeMode =
                DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            showGagerDataGridView.AllowUserToDeleteRows = false;
            showGagerDataGridView.SelectionMode         = DataGridViewSelectionMode.FullRowSelect;
            showGagerDataGridView.Columns.AddRange(new DataGridViewColumn[]
            {
                numberColumn,
                timeColumn,
                cityColumn,
                streetColumn,
                homeColumn,
                apartmentColumn,
                phoneColumn,
                commentColumn,
                frozeColumn
            });
            showGagerDataGridView.Location            = new System.Drawing.Point(5, height + 64);
            showGagerDataGridView.Name                = "dataGridView" + count.ToString();
            showGagerDataGridView.Size                = new System.Drawing.Size(MainPanel.Size.Width, 204);
            showGagerDataGridView.TabIndex            = 7;
            showGagerDataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            showGagerDataGridView.AutoSizeRowsMode    = DataGridViewAutoSizeRowsMode.AllCells;
            showGagerDataGridView.MultiSelect         = false;
            _showGagerDataGridViewList.Add(showGagerDataGridView);
            showGagerDataGridView.MouseDoubleClick += new MouseEventHandler(ShowFrozeDataGridView_MouseDoubleClick);
            showGagerDataGridView.MouseClick       += new MouseEventHandler(ShowFrozeDataGridView_MouseClick);

            UpdateDataSelectTableFroze(showGagerDataGridView, idGager, DateTime.Now);


            numberColumn.HeaderText = "№";
            numberColumn.Name       = "Column1";
            numberColumn.ReadOnly   = true;
            numberColumn.FillWeight = 30;

            timeColumn.HeaderText = "Время";
            timeColumn.Name       = "Column2";
            timeColumn.ReadOnly   = true;
            timeColumn.FillWeight = 60;

            cityColumn.HeaderText = "Город";
            cityColumn.Name       = "Column3";
            cityColumn.ReadOnly   = true;
            cityColumn.FillWeight = 80;

            streetColumn.HeaderText = "Улица";
            streetColumn.Name       = "Column4";
            streetColumn.ReadOnly   = true;

            homeColumn.HeaderText = "Дом";
            homeColumn.Name       = "Column5";
            homeColumn.ReadOnly   = true;
            homeColumn.FillWeight = 40;

            apartmentColumn.HeaderText = "Квартира";
            apartmentColumn.Name       = "Column6";
            apartmentColumn.ReadOnly   = true;
            apartmentColumn.FillWeight = 40;

            phoneColumn.HeaderText = "Телефон";
            phoneColumn.Name       = "Column7";
            phoneColumn.ReadOnly   = true;
            phoneColumn.FillWeight = 80;

            commentColumn.HeaderText = "Комментарий";
            commentColumn.Name       = "Column8";
            commentColumn.ReadOnly   = true;

            frozeColumn.HeaderText = "";
            frozeColumn.Name       = "Column8";
            frozeColumn.ReadOnly   = true;
            frozeColumn.Visible    = false;

            if (addBtn)
            {
                ShowButtonAddFroze(height + 290);
            }
        }