private void populateList()
        {
            if (studentList != null && studentList.Count > 0)
            {
                listView1.SuspendLayout();
                int          count = 0;
                ListViewItem lv;
                listView1.Items.Clear();
                AutoCompleteStringCollection studentIds = new AutoCompleteStringCollection();
                foreach (Entity_Student studentObj in studentList)
                {
                    lv = new ListViewItem((++count).ToString());
                    lv.SubItems.Add(studentObj.collegeId);
                    lv.SubItems.Add(studentObj.studentName);
                    lv.SubItems.Add(studentObj.gender);
                    lv.SubItems.Add(studentObj.branch);
                    lv.SubItems.Add(studentObj.myConfigObj.currentDegree);
                    lv.SubItems.Add(studentObj.placedDetailsObj.Count.ToString());

                    lv.Tag = studentObj;

                    listView1.Items.Add(lv);
                    studentIds.Add((studentObj.collegeId));
                }
                listView1.ResumeLayout();
                updateStatus.textBox_search.AutoCompleteCustomSource = studentIds;
            }
            else
            {
                Dialog_MyMessageBox.Show(Constant.MESSAGE_NO_DATA, 1, UiColors.MESSAGE_ERROR);
            }
        }
Ejemplo n.º 2
0
        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            var notificationList = (List <Entity_Notification>)e.Result;

            if (notificationList != null)
            {
                FlowLayoutPanel flowPanel = getFlowPanel();
                panel_main.Controls.Clear();

                for (int i = 0; i < notificationList.Count; i++)
                {
                    Notification_template _template = new Notification_template(i, notificationList[i], this);
                    _template.Dock = DockStyle.Top;
                    flowPanel.Controls.Add(_template);
                }
                panel_main.Controls.Add(flowPanel);
                flowPanel.Focus();

                myProgressDialog.Dispose();
            }
            else
            {
                myProgressDialog.Dispose();
                Dialog_MyMessageBox.Show(Constant.MESSAGE_NO_DATA, 1, UiColors.MESSAGE_ERROR);
            }
            this.Opacity = 1;
        }
 private static void setNoButton(Dialog_MyMessageBox msgbox)
 {
     msgbox.but_no.Dock     = DockStyle.None;
     msgbox.but_no.Text     = "No";
     msgbox.but_no.Location = new Point(175, 78);
     msgbox.but_no.Size     = new Size(172, 44);
 }
 private void but_upload_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(filePath))
     {
         Dialog_MyMessageBox.Show(Validations.VALIDATION_NO_FILE_SELECTED, 1, UiColors.MESSAGE_ERROR);
     }
     else
     {
         if (!Utility.isNetworkAvailable())
         {
             Dialog_MyMessageBox.Show(Validations.VALIDATION_NO_NETWORK, 1, UiColors.MESSAGE_ERROR);
         }
         else
         {
             try
             {
                 DialogResult result = Dialog_UpdateStudentCompany.Show(filePath);
                 if (result == DialogResult.Yes)
                 {
                     updateStatus.placementStatusUpdated = true;
                 }
                 but_cancel.PerformClick();
             }
             catch (Exception ex)
             {
                 Utility.logFile(ex.Message, ex.InnerException, Constant.LOGTYPE_ERROR);
                 Dialog_MyMessageBox.Show(Constant.EXCEPTION, 1, UiColors.MESSAGE_ERROR);
             }
         }
     }
 }
Ejemplo n.º 5
0
        private bool isValidated()
        {
            if (string.IsNullOrWhiteSpace(textBox_companyName.Text))
            {
                Utility.showToolTip(new ToolTip(), textBox_companyName, Validations.VALIDATION_EMPTY_FIELD, Constant.TOOLTIP_TYPE_WARNING, null);
                return(false);
            }
            if (string.IsNullOrWhiteSpace(textBox_collegeName.Text))
            {
                Utility.showToolTip(new ToolTip(), textBox_collegeName, Validations.VALIDATION_EMPTY_FIELD, Constant.TOOLTIP_TYPE_WARNING, null);
                return(false);
            }

            DateTime currentDate  = DateTime.Now.Date;
            DateTime selectedDate = dateTime_dor.Value.Date;

            if (Utility.compareDates(selectedDate.Date, currentDate.Date) < 0)
            {
                Dialog_MyMessageBox.Show(Validations.VALIDATION_MIN_DATE, 1, UiColors.MESSAGE_ERROR);
                return(false);
            }

            if (!Utility.isNetworkAvailable())
            {
                Dialog_MyMessageBox.Show(Validations.VALIDATION_NO_NETWORK, 1, UiColors.MESSAGE_ERROR);
                return(false);
            }

            return(true);
        }
        private void but_next_Click(object sender, EventArgs e)
        {
            if (isFormValidated())
            {
                DialogResult result = Dialog_MyMessageBox.Show(Constant.NOTIFICATION_CONFIRM_CONTINUE_CRITERIA, 2);

                if (result == DialogResult.Yes)
                {
                    MyCriteria notifyCriteria = new MyCriteria();
                    notifyCriteria.batch            = Common.loggedUser.myConfigObj.currentBatch;
                    notifyCriteria.degree           = dropdown_degree.SelectedItem.ToString();
                    notifyCriteria.arrears          = Convert.ToInt32(numeric_arrears.Value);
                    notifyCriteria.X                = Convert.ToDouble(numeric_x.Value);
                    notifyCriteria.XII              = Convert.ToDouble(numeric_xii.Value);
                    notifyCriteria.isPlaced         = isPlaced;
                    notifyCriteria.isDiplomaAllowed = isDiplomaAllowed;
                    notifyCriteria.branch           = getSelectedBranchList();

                    if (radio_cgpa.Checked)
                    {
                        notifyCriteria.cgpa = Convert.ToDouble(numeric_cgpa.Value);
                    }
                    else
                    {
                        notifyCriteria.cgpa = Convert.ToDouble(label_equiCgpa.Text);
                    }

                    form_Notification.notification.CriteriaObj = notifyCriteria;
                    form_Notification.step++;
                    form_Notification.but_resultList.Enabled = true;
                    form_Notification.but_resultList.PerformClick();
                }
            }
        }
        private void searchDetails()
        {
            if (!Utility.isNetworkAvailable())
            {
                Dialog_MyMessageBox.Show(Validations.VALIDATION_NO_NETWORK, 1, UiColors.MESSAGE_ERROR);
            }
            else
            {
                string searchKey = textBox_search.Text.Trim();
                if (searchKey.Length > 0)
                {
                    List <StudentPlacedDto> detailList;
                    switch (tabView.SelectedIndex)
                    {
                    case 0:
                        detailList = placedDetailsManager.getPlacedStudentsBySearchKey(searchKey);
                        populateListPlaced(detailList);
                        break;

                    case 1:
                        detailList = placedDetailsManager.getNonPlacedStudentsBySearchKey(searchKey);
                        populateListNonPlaced(detailList);
                        break;
                    }
                }
            }
        }
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     if (step == 1 && keyData == (Keys.Control | Keys.E))
     {
         DialogResult result = Dialog_MyMessageBox.Show(Constant.MESSAGE_EXCEL_EXPORT, 2);
         if (result == DialogResult.Yes)
         {
             Utility.exportToExcel(control_branch.listView1, homeform);
             return(true);
         }
     }
     else if (keyData == (Keys.Control | Keys.P))
     {
         pictureBox1_Click(this.pictureBox_power, null);
     }
     else if (keyData == (Keys.Control | Keys.M))
     {
         pictureBox2_Click(this.pictureBox_minimise, null);
     }
     else if (keyData == (Keys.Control | Keys.H))
     {
         pictureBox4_Click(this.pictureBox_home, null);
     }
     else if (keyData == (Keys.Control | Keys.R))
     {
         pictureBox5_Click(this.pictureBox_refresh, null);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            this.Opacity            = 1;
            pictureBox_home.Enabled = true;
            myProgressDialog.Dispose();
            switch (step)
            {
            case 1:
                control_branch = new ListControl_ResultList
                                     (this, (IDictionary <string, IList <Entity_Student> >)e.Result);
                control_branch.Dock = DockStyle.Fill;
                panel_main.Controls.Add(control_branch);
                break;

            case 2:
                if (e.Result == null)
                {
                    Dialog_MyMessageBox.Show(Constant.NO_COMPANY_TO_NOTIFY, 1, UiColors.MESSAGE_ERROR);
                }
                else
                {
                    var control_details = new Control_Details
                                              (this, (List <Entity_CompanyDetails>)e.Result);
                    control_details.Dock = DockStyle.Fill;
                    panel_main.Controls.Add(control_details);
                } break;

            default:
                break;
            }
        }
Ejemplo n.º 10
0
 private void but_viewCompanies_Click(object sender, EventArgs e)
 {
     if (!Utility.isNetworkAvailable())
     {
         Dialog_MyMessageBox.Show(Validations.VALIDATION_NO_NETWORK, 1, UiColors.MESSAGE_ERROR);
     }
     else
     {
         homeform.Opacity = 0.9F;
         Form_ViewCompanies viewcomp = new Form_ViewCompanies(homeform);
         viewcomp.Show();
         homeform.Hide();
         homeform.Opacity = 1F;
     }
     //if (getCompanyCount() > 0)
     //{
     //    homeform.Hide();
     //    Form_ViewCompanies viewcomp = new Form_ViewCompanies(homeform);
     //    viewcomp.Show();
     //}
     //else
     //{
     //    Dialog_MyMessageBox.Show(Validations.VALIDATION_NO_COMPANY_FOUND, 1, UiColors.MESSAGE_ERROR);
     //}
 }
 public static DialogResult Show(String msg, int but_count)
 {
     msgbox = new Dialog_MyMessageBox();
     msgbox.label_mymessage.Text = msg;
     prepareButtons(but_count);
     msgbox.ShowDialog();
     return(result);
 }
Ejemplo n.º 12
0
        private void pictureBox_notifyCompany_Click(object sender, EventArgs e)
        {
            DialogResult result = Dialog_MyMessageBox.Show(Constant.NOTIFICATION_CONFIRM_CONTINUE_NOTIFY, 2);

            if (result == DialogResult.Yes)
            {
                startBackgroundThread(false, 1);
            }
        }
Ejemplo n.º 13
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            DialogResult result = Dialog_MyMessageBox.Show(Constant.MESSAGE_EXIT, 2);

            if (result == DialogResult.Yes)
            {
                Application.Exit();
            }
        }
Ejemplo n.º 14
0
 private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if ((bool)e.Result)
     {
         Dialog_MyMessageBox.Show(Constant.MAIL_SENT, 1, UiColors.MESSAGE_SUCCESS);
     }
     else
     {
         Dialog_MyMessageBox.Show(Constant.MAIL_UNSENT, 1, UiColors.MESSAGE_ERROR);
     }
 }
Ejemplo n.º 15
0
 private void but_editCompany_Click(object sender, EventArgs e)
 {
     if (label_placedStudents.Text != Constant.NOT_APPLICABLE)
     {
         Dialog_MyMessageBox.Show(Validations.VALIDATION_COMPANY_VISITED, 1, UiColors.MESSAGE_ERROR);
     }
     else
     {
         enableControls();
     }
 }
Ejemplo n.º 16
0
 private void displayResponseFromDialogResult(DialogResult result)
 {
     if (result == DialogResult.Yes)
     {
         Dialog_MyMessageBox.Show(Constant.UPDATE_SUCCESS, 1, UiColors.MESSAGE_SUCCESS);
     }
     else if (result == DialogResult.Retry)
     {
         Dialog_MyMessageBox.Show(Constant.EXCEPTION, 1, UiColors.MESSAGE_ERROR);
     }
 }
Ejemplo n.º 17
0
        private void but_logout_side_panel_Click(object sender, EventArgs e)
        {
            DialogResult result = Dialog_MyMessageBox.Show(Constant.MESSAGE_LOGOUT, 2);

            if (result == DialogResult.Yes)
            {
                this.Close();
                loggedUser = null;
                mainForm.Show();
            }
        }
        private void but_next_Click(object sender, EventArgs e)
        {
            DialogResult result = Dialog_MyMessageBox.Show(Constant.NOTIFICATION_CONFIRM_CONTINUE_LIST, 2);

            if (result == DialogResult.Yes)
            {
                form_Notification.step++;
                form_Notification.but_details.Enabled = true;
                form_Notification.but_details.PerformClick();
            }
        }
Ejemplo n.º 19
0
 private void but_registerCompany_Click(object sender, EventArgs e)
 {
     if (isValidated())
     {
         DialogResult result = Dialog_MyMessageBox.Show(Constant.CONFIRM_SAVE, 2);
         if (result == DialogResult.Yes)
         {
             startBackgoundThread();
         }
     }
 }
Ejemplo n.º 20
0
        private void but_sendEmail_Click(object sender, EventArgs e)
        {
            if (validator == 5)
            {
                if (!Utility.isValidEmail(textBox_email.Text))
                {
                    Utility.showToolTip(new ToolTip(), textBox_email, Validations.VALIDATION_INVALID_EMAIL_FORMAT,
                                        Constant.TOOLTIP_TYPE_WARNING, string.Empty);
                    textBox_email.Focus();
                }
                else
                {
                    if (Utility.isNetworkAvailable())
                    {
                        MyMail mailObj = new MyMail();
                        mailObj.name    = textBox_name.Text;
                        mailObj.phone   = textBox_number.Text;
                        mailObj.email   = textBox_email.Text;
                        mailObj.subject = textBox_subject.Text;
                        mailObj.body    = richTextBox_query.Text;

                        if (checkBox_loggerFile.Checked)
                        {
                            mailObj.addAttachment(Common.LOGGER_FILE_NAME);
                        }

                        if (attachmentFilePath != null && !attachmentFilePath.Equals(string.Empty))
                        {
                            mailObj.addAttachment(attachmentFilePath);
                        }

                        if (backgroundWorker1.IsBusy)
                        {
                            Dialog_MyMessageBox.Show(Constant.REQUEST_UNDER_PROCESS, 1, UiColors.MESSAGE_ERROR);
                        }
                        else
                        {
                            backgroundWorker1.RunWorkerAsync(mailObj);
                        }
                        resetFields();
                    }
                    else
                    {
                        Dialog_MyMessageBox.Show(Validations.VALIDATION_NO_NETWORK, 1, UiColors.MESSAGE_ERROR);
                    }
                }
            }
            else
            {
                Dialog_MyMessageBox.Show(Validations.VALIDATION_EMPTY_FIELD, 1, UiColors.MESSAGE_ERROR);
            }
        }
Ejemplo n.º 21
0
 private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     this.Opacity = 1;
     myProgressDialog.Dispose();
     if ((bool)e.Result)
     {
         loadPiechart(piechartStudentDto);
     }
     else
     {
         Dialog_MyMessageBox.Show(Constant.REQUEST_UNPROCESSED, 1, UiColors.MESSAGE_ERROR);
     }
 }
Ejemplo n.º 22
0
        private void but_next_Click(object sender, EventArgs e)
        {
            DialogResult result = Dialog_MyMessageBox.Show(Constant.NOTIFICATION_CONFIRM_CONTINUE_MESSAGE, 2);

            if (result == DialogResult.Yes)
            {
                placementInfo.message = text_msg_content.Text;
                form_Notification.notification.PlacementObj = placementInfo;
                form_Notification.step++;
                form_Notification.but_notify.Enabled = true;
                form_Notification.but_notify.PerformClick();
            }
        }
        public static DialogResult Show(String msg, int but_count, string backColor)
        {
            msgbox = new Dialog_MyMessageBox();
            Placement_Application.Components.Resolution res = new Placement_Application.Components.Resolution();
            res.ResizeForm(msgbox, Common.dialog_height, Common.dialog_width);

            msgbox.BackColor            = Utility.getColorFromHex(backColor);
            msgbox.Opacity              = Common.dialogOpacity;
            msgbox.label_mymessage.Text = msg;
            prepareButtons(but_count);
            msgbox.ShowDialog();
            return(result);
        }
Ejemplo n.º 24
0
 private void but_manageUsers_sidePanel_Click(object sender, EventArgs e)
 {
     if (!Utility.isNetworkAvailable())
     {
         Dialog_MyMessageBox.Show(Validations.VALIDATION_NO_NETWORK, 1, UiColors.MESSAGE_ERROR);
     }
     else
     {
         panel_main.Controls.Clear();
         ListControl_ViewUsers viewUsers = new ListControl_ViewUsers(this);
         viewUsers.Dock = DockStyle.Fill;
         panel_main.Controls.Add(viewUsers);
     }
 }
        private bool isFormValidated()
        {
            if (listView1.CheckedIndices.Count == 0)
            {
                Utility.showToolTip(new ToolTip(), listView1, Validations.VALIDATION_ZERO_BRANCH_SELECTED, Constant.TOOLTIP_TYPE_WARNING, null);
                return(false);
            }
            else if (!Utility.isNetworkAvailable())
            {
                Dialog_MyMessageBox.Show(Validations.VALIDATION_NO_NETWORK, 1, UiColors.MESSAGE_ERROR);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 26
0
 private void deleteCompanies()
 {
     if (compManager.deleteCompanies(listCompView.listView1))
     {
         foreach (var checkedItem in listCompView.listView1.CheckedItems)
         {
             compDetailList.Remove(((ListViewItem)checkedItem).Tag as Entity_CompanyDetails);
             listCompView.listView1.Items.Remove(checkedItem as ListViewItem);
         }
     }
     else
     {
         Dialog_MyMessageBox.Show(Constant.FAILED_DELETE_COMPANIES, 1, UiColors.MESSAGE_ERROR);
     }
 }
Ejemplo n.º 27
0
        private void startBackgoundThread()
        {
            if (!backgroundWorker1.IsBusy)
            {
                myProgressDialog = new DIalog_ProgressBar();
                mainForm.Opacity = 0.8;
                myProgressDialog.Show();

                backgroundWorker1.RunWorkerAsync();
            }
            else
            {
                Dialog_MyMessageBox.Show(Constant.REQUEST_UNDER_PROCESS, 1, UiColors.MESSAGE_ERROR);
            }
        }
Ejemplo n.º 28
0
 private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     this.Opacity = 1;
     myProgressDialog.Dispose();
     if ((bool)e.Result)
     {
         listCompView = new ListControl_CompanyView(this, compDetailList);
         panel_main.Controls.Add(listCompView);
         fistLoad = false;
     }
     else
     {
         Dialog_MyMessageBox.Show(Constant.REQUEST_UNPROCESSED, 1, UiColors.MESSAGE_ERROR);
     }
 }
Ejemplo n.º 29
0
 private void but_notify_Click(object sender, EventArgs e)
 {
     if (!Utility.isNetworkAvailable())
     {
         Dialog_MyMessageBox.Show(Validations.VALIDATION_NO_NETWORK, 1, UiColors.MESSAGE_ERROR);
     }
     else
     {
         DialogResult result = Dialog_MyMessageBox.Show(Constant.NOTIFICATION_CONFIRM_CONTINUE_NOTIFY, 2);
         if (result == DialogResult.Yes)
         {
             startBackgroundThread();
         }
     }
 }
Ejemplo n.º 30
0
        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            form_Notification.Opacity = 1;
            myProgressDialog.Dispose();
            if ((bool)e.Result)
            {
                Dialog_MyMessageBox.Show(Constant.NOTIFICATION_NOTIFY_SUCCESS, 1, UiColors.MESSAGE_SUCCESS);
            }
            else
            {
                Dialog_MyMessageBox.Show(Constant.REQUEST_UNPROCESSED, 1, UiColors.MESSAGE_ERROR);
            }

            but_notify.Enabled = false;
        }