Ejemplo n.º 1
0
        private void button_LogIn_Click(object sender, EventArgs e)
        {
            Credentials cred = FormToCredentials();

            InterviewerArr interviewerArr = new InterviewerArr();

            interviewerArr.Fill();

            if (interviewerArr.Filter("", "", "", Credentials.Empty, true).Count == 0 && cred == Credentials.Empty)
            {
                Interviewer             = new Interviewer();
                Interviewer.FirstName   = "Admin";
                Interviewer.LastName    = "Admin";
                Interviewer.Admin       = true;
                Interviewer.DBId        = -1;
                Interviewer.Credentials = Credentials.Empty;
            }
            else if (cred.Id != 0)
            {
                Interviewer = interviewerArr.GetInterviewerByCredentials(cred);
                if (Interviewer == Interviewer.Empty)
                {
                    return;
                }
            }
            else
            {
                return;
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        private void InterviewerArrToForm()
        {
            InterviewerArr interviewerArr = new InterviewerArr();

            interviewerArr.Fill();
            interviewerArr.Insert(0, Interviewer.Empty);

            comboBox_Interviewer.SelectedValueChanged -= comboBox_Interviewer_SelectedValueChanged;
            comboBox_Interviewer.DataSource            = interviewerArr;
            comboBox_Interviewer.ValueMember           = "DBId";
            comboBox_Interviewer.DisplayMember         = "Fullname";
            comboBox_Interviewer.AutoCompleteMode      = AutoCompleteMode.SuggestAppend;
            comboBox_Interviewer.AutoCompleteSource    = AutoCompleteSource.ListItems;

            comboBox_Interviewer.SelectedIndex = 0;

            comboBox_Interviewer.SelectedValueChanged += comboBox_Interviewer_SelectedValueChanged;
        }
Ejemplo n.º 3
0
        private void FilterArrsToForm()
        {
            PositionArr positionArr = new PositionArr();

            positionArr.Fill();
            positionArr.Insert(0, Position.Empty);

            comboBox_PositionFilter.DataSource         = positionArr;
            comboBox_PositionFilter.ValueMember        = "Id";
            comboBox_PositionFilter.DisplayMember      = "Name";
            comboBox_PositionFilter.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            comboBox_PositionFilter.AutoCompleteSource = AutoCompleteSource.ListItems;



            InterviewerArr interviewerArr = new InterviewerArr();

            interviewerArr.Fill();

            comboBox_InterviewerFilter.DataSource         = interviewerArr;
            comboBox_InterviewerFilter.ValueMember        = "Id";
            comboBox_InterviewerFilter.DisplayMember      = "FullName";
            comboBox_InterviewerFilter.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            comboBox_InterviewerFilter.AutoCompleteSource = AutoCompleteSource.ListItems;



            NomineeArr nomineeArr = new NomineeArr();

            nomineeArr.Fill();
            nomineeArr.Insert(0, Nominee.Empty);

            comboBox_NomineeFilter.DataSource         = nomineeArr;
            comboBox_NomineeFilter.ValueMember        = "Id";
            comboBox_NomineeFilter.DisplayMember      = "FullName";
            comboBox_NomineeFilter.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            comboBox_NomineeFilter.AutoCompleteSource = AutoCompleteSource.ListItems;
        }