Exemplo n.º 1
0
        /// <summary>
        /// Add new title
        /// </summary>
        /// <param name="sender">The dialog</param>
        /// <param name="e"></param>
        private void NewJobTitleDialog_AddingNewTitle(object sender, EventArgs e)
        {
            try
            {
                AskForText newJobTitleDialog = (AskForText)sender;
                string     newTitle          = newJobTitleDialog.Value;
                this.CloseDialog();

                if (this.JobTitleDataSet != null)
                {
                    JobTitles newJobtitle = new JobTitles()
                    {
                        Key   = Encryption.GetUniqueKey(16),
                        Title = newTitle
                    };

                    this.JobTitleDataSet.Add(newJobtitle);
                    if (JobTitleCombobox.Items.Count > 0)
                    {
                        this.JobTitleCombobox.SelectedIndex = JobTitleCombobox.Items.Count - 1;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("NewJobTitleDialog_AddingNewTitle: {0}", ex.Message);
            }
        }
Exemplo n.º 2
0
        private void newDepartmentDialog_AddingNewTitle(object sender, EventArgs e)
        {
            try
            {
                AskForText newDepartmentDialog = (AskForText)sender;
                string     newTitle            = newDepartmentDialog.Value;
                this.CloseDialog();

                if (this.DepartmentDataSet != null)
                {
                    Department newDepartment = new Department()
                    {
                        Key            = Encryption.GetUniqueKey(16),
                        DepartmentName = newTitle
                    };

                    this.DepartmentDataSet.Add(newDepartment);
                    if (this.DepartmentCombobox.Items.Count > 0)
                    {
                        this.DepartmentCombobox.SelectedIndex = this.DepartmentCombobox.Items.Count - 1;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("newDepartmentDialog_AddingNewTitle: {0}", ex.Message);
            }
        }
Exemplo n.º 3
0
        private void newAreaDialog_Confirmed(object sender, EventArgs e)
        {
            try
            {
                AskForText newAreaDialog = (AskForText)sender;
                string     newTitle      = newAreaDialog.Value;
                this.CloseDialog();

                if (this.ProfessionalDbset != null)
                {
                    ProfesstionalArea newPa = new ProfesstionalArea()
                    {
                        Key  = Encryption.GetUniqueKey(16),
                        Name = newTitle
                    };

                    this.ProfessionalDbset.Add(newPa);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("newAreaDialog_Confirmed: {0}", ex.Message);
            }
        }