예제 #1
0
        private void btnInsertRequest_Click(object sender, EventArgs e)
        {
            BLExternals bl = new BLExternals();

            if (comboBoxStudents.SelectedItem != null && !String.IsNullOrWhiteSpace(richTxtReason.Text) &&
                richTxtReason.Text != "Va rugam completati un motiv plauzibil (ex. parinte, angajator, pentru practica).\nAdministratorul va aproba sau nu cererea dumneavoastra in functie de acesta.")
            {
                bl.InsertRequests(idUser, Convert.ToInt32(comboBoxStudents.SelectedValue), richTxtReason.Text);
                comboBoxStudents.SelectedItem = null;
                richTxtReason.Text            = "";
                MessageBox.Show("Cererea a fost inregistrata cu succes!", "Succes", MessageBoxButtons.OK, MessageBoxIcon.Information);

                gridAwaitingRequests.DataSource = bl.GetRequests(idUser);
                gridAwaitingRequests.Columns["StudentName"].HeaderText = "Nume";
                gridAwaitingRequests.Columns["StudyGroup"].HeaderText  = "Grupa";
                gridAwaitingRequests.Columns["Reason"].HeaderText      = "Motiv";
                gridAwaitingRequests.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

                DataTable dataTable = bl.GetStudents("", "", idUser);
                comboBoxStudents.ValueMember   = "StudentId";
                comboBoxStudents.DisplayMember = "StudentInfo";
                comboBoxStudents.DataSource    = dataTable;

                clearFilter();
            }
            else
            {
                MessageBox.Show("Va rugam alegeti un student si completati motivul pentru care doriti sa ii vizualizati situatia scolara.", "Atentie", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
예제 #2
0
        private void ExternalRequestsForm_Load(object sender, EventArgs e)
        {
            gridAwaitingRequests.BorderStyle = BorderStyle.None;
            gridAwaitingRequests.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(168, 218, 220);
            gridAwaitingRequests.CellBorderStyle = DataGridViewCellBorderStyle.SingleHorizontal;
            gridAwaitingRequests.DefaultCellStyle.SelectionBackColor = Color.FromArgb(29, 53, 87);
            gridAwaitingRequests.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            gridAwaitingRequests.BackgroundColor                         = Color.FromArgb(3, 56, 125);
            gridAwaitingRequests.DefaultCellStyle.BackColor              = Color.FromArgb(241, 250, 238);
            gridAwaitingRequests.DefaultCellStyle.Font                   = new Font("Microsoft Tai Le", 10);
            gridAwaitingRequests.AlternatingRowsDefaultCellStyle.Font    = new Font("Microsoft Tai Le", 10);
            gridAwaitingRequests.ColumnHeadersDefaultCellStyle.Font      = new Font("Microsoft Tai Le", 11);
            gridAwaitingRequests.EnableHeadersVisualStyles               = false;
            gridAwaitingRequests.ColumnHeadersBorderStyle                = DataGridViewHeaderBorderStyle.None;
            gridAwaitingRequests.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            gridAwaitingRequests.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;

            gridAcceptedRequests.BorderStyle = BorderStyle.None;
            gridAcceptedRequests.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(168, 218, 220);
            gridAcceptedRequests.CellBorderStyle = DataGridViewCellBorderStyle.SingleHorizontal;
            gridAcceptedRequests.DefaultCellStyle.SelectionBackColor = Color.FromArgb(29, 53, 87);
            gridAcceptedRequests.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            gridAcceptedRequests.BackgroundColor                         = Color.FromArgb(3, 56, 125);
            gridAcceptedRequests.DefaultCellStyle.BackColor              = Color.FromArgb(241, 250, 238);
            gridAcceptedRequests.DefaultCellStyle.Font                   = new Font("Microsoft Tai Le", 10);
            gridAcceptedRequests.AlternatingRowsDefaultCellStyle.Font    = new Font("Microsoft Tai Le", 10);
            gridAcceptedRequests.ColumnHeadersDefaultCellStyle.Font      = new Font("Microsoft Tai Le", 11);
            gridAcceptedRequests.EnableHeadersVisualStyles               = false;
            gridAcceptedRequests.ColumnHeadersBorderStyle                = DataGridViewHeaderBorderStyle.None;
            gridAcceptedRequests.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            gridAcceptedRequests.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;

            BLExternals bl        = new BLExternals();
            DataTable   dataTable = bl.GetStudents("", "", idUser);

            comboBoxStudents.ValueMember   = "StudentId";
            comboBoxStudents.DisplayMember = "StudentInfo";
            comboBoxStudents.DataSource    = dataTable;
            comboBoxStudents.SelectedItem  = null;

            gridAwaitingRequests.DataSource = bl.GetRequests(idUser);
            gridAwaitingRequests.Columns["StudentName"].HeaderText = "Nume";
            gridAwaitingRequests.Columns["StudyGroup"].HeaderText  = "Grupa";
            gridAwaitingRequests.Columns["Reason"].HeaderText      = "Motiv";
            gridAwaitingRequests.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            gridAwaitingRequests.Columns[2].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
            gridAwaitingRequests.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;

            gridAcceptedRequests.DataSource = bl.GetAcceptedRequests(idUser);
            gridAcceptedRequests.Columns["StudentName"].HeaderText = "Nume";
            gridAcceptedRequests.Columns["StudyGroup"].HeaderText  = "Grupa";
            gridAcceptedRequests.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

            richTxtReason.Text      = "Va rugam completati un motiv plauzibil (ex. parinte, angajator, pentru practica).\nAdministratorul va aproba sau nu cererea dumneavoastra in functie de acesta.";
            richTxtReason.Font      = new Font(richTxtReason.Font, FontStyle.Italic);
            richTxtReason.ForeColor = Color.FromArgb(165, 165, 165);
            richTxtReason.MaxLength = 500;
        }
예제 #3
0
        private void txtGroupFilter_TextChanged(object sender, EventArgs e)
        {
            String      name      = txtNameFilter.Text;
            String      group     = txtGroupFilter.Text;
            BLExternals bl        = new BLExternals();
            DataTable   dataTable = bl.GetStudents(name, group, idUser);

            comboBoxStudents.ValueMember   = "StudentId";
            comboBoxStudents.DisplayMember = "StudentInfo";
            comboBoxStudents.DataSource    = dataTable;
        }
예제 #4
0
        private void ExternalsCatalogForm_Load(object sender, EventArgs e)
        {
            gridCatalogY1.BorderStyle = BorderStyle.None;
            gridCatalogY1.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(168, 218, 220);
            gridCatalogY1.CellBorderStyle = DataGridViewCellBorderStyle.SingleHorizontal;
            gridCatalogY1.DefaultCellStyle.SelectionBackColor = Color.FromArgb(29, 53, 87);
            gridCatalogY1.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            gridCatalogY1.BackgroundColor                         = Color.FromArgb(3, 56, 125);
            gridCatalogY1.DefaultCellStyle.BackColor              = Color.FromArgb(241, 250, 238);
            gridCatalogY1.DefaultCellStyle.Font                   = new Font("Microsoft Tai Le", 10);
            gridCatalogY1.AlternatingRowsDefaultCellStyle.Font    = new Font("Microsoft Tai Le", 10);
            gridCatalogY1.ColumnHeadersDefaultCellStyle.Font      = new Font("Microsoft Tai Le", 11);
            gridCatalogY1.EnableHeadersVisualStyles               = false;
            gridCatalogY1.ColumnHeadersBorderStyle                = DataGridViewHeaderBorderStyle.None;
            gridCatalogY1.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            gridCatalogY1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;

            gridCatalogY2.BorderStyle = BorderStyle.None;
            gridCatalogY2.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(168, 218, 220);
            gridCatalogY2.CellBorderStyle = DataGridViewCellBorderStyle.SingleHorizontal;
            gridCatalogY2.DefaultCellStyle.SelectionBackColor = Color.FromArgb(29, 53, 87);
            gridCatalogY2.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            gridCatalogY2.BackgroundColor                         = Color.FromArgb(3, 56, 125);
            gridCatalogY2.DefaultCellStyle.BackColor              = Color.FromArgb(241, 250, 238);
            gridCatalogY2.DefaultCellStyle.Font                   = new Font("Microsoft Tai Le", 10);
            gridCatalogY2.AlternatingRowsDefaultCellStyle.Font    = new Font("Microsoft Tai Le", 10);
            gridCatalogY2.ColumnHeadersDefaultCellStyle.Font      = new Font("Microsoft Tai Le", 11);
            gridCatalogY2.EnableHeadersVisualStyles               = false;
            gridCatalogY2.ColumnHeadersBorderStyle                = DataGridViewHeaderBorderStyle.None;
            gridCatalogY2.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            gridCatalogY2.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;

            gridCatalogY3.BorderStyle = BorderStyle.None;
            gridCatalogY3.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(168, 218, 220);
            gridCatalogY3.CellBorderStyle = DataGridViewCellBorderStyle.SingleHorizontal;
            gridCatalogY3.DefaultCellStyle.SelectionBackColor = Color.FromArgb(29, 53, 87);
            gridCatalogY3.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            gridCatalogY3.BackgroundColor                         = Color.FromArgb(3, 56, 125);
            gridCatalogY3.DefaultCellStyle.BackColor              = Color.FromArgb(241, 250, 238);
            gridCatalogY3.DefaultCellStyle.Font                   = new Font("Microsoft Tai Le", 10);
            gridCatalogY3.AlternatingRowsDefaultCellStyle.Font    = new Font("Microsoft Tai Le", 10);
            gridCatalogY3.ColumnHeadersDefaultCellStyle.Font      = new Font("Microsoft Tai Le", 11);
            gridCatalogY3.EnableHeadersVisualStyles               = false;
            gridCatalogY3.ColumnHeadersBorderStyle                = DataGridViewHeaderBorderStyle.None;
            gridCatalogY3.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            gridCatalogY3.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;

            gridCatalogY4.BorderStyle = BorderStyle.None;
            gridCatalogY4.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(168, 218, 220);
            gridCatalogY4.CellBorderStyle = DataGridViewCellBorderStyle.SingleHorizontal;
            gridCatalogY4.DefaultCellStyle.SelectionBackColor = Color.FromArgb(29, 53, 87);
            gridCatalogY4.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            gridCatalogY4.BackgroundColor                         = Color.FromArgb(3, 56, 125);
            gridCatalogY4.DefaultCellStyle.BackColor              = Color.FromArgb(241, 250, 238);
            gridCatalogY4.DefaultCellStyle.Font                   = new Font("Microsoft Tai Le", 10);
            gridCatalogY4.AlternatingRowsDefaultCellStyle.Font    = new Font("Microsoft Tai Le", 10);
            gridCatalogY4.ColumnHeadersDefaultCellStyle.Font      = new Font("Microsoft Tai Le", 11);
            gridCatalogY4.EnableHeadersVisualStyles               = false;
            gridCatalogY4.ColumnHeadersBorderStyle                = DataGridViewHeaderBorderStyle.None;
            gridCatalogY4.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(20, 25, 72);
            gridCatalogY4.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;

            BLExternals bl        = new BLExternals();
            DataTable   dataTable = bl.GetStudents(idUser);

            comboBoxStudents.ValueMember   = "StudentId";
            comboBoxStudents.DisplayMember = "StudentInfo";
            comboBoxStudents.DataSource    = dataTable;
            comboBoxStudents.SelectedItem  = null;
            gridCatalogY1.Visible          = false;
            gridCatalogY2.Visible          = false;
            gridCatalogY3.Visible          = false;
            gridCatalogY4.Visible          = false;
            lblY1.Visible          = false;
            lblY2.Visible          = false;
            lblY3.Visible          = false;
            lblY4.Visible          = false;
            btnExportExcel.Visible = false;
        }