private void txt_TB_Phone_TextChanged(object sender, EventArgs e)
 {
     if ((txt_TB_Phone.TextLength == 4 || txt_TB_Phone.TextLength == 8) && txt_TB_Phone.Text[txt_TB_Phone.TextLength - 1] != '-')
     {
         txt_TB_Phone.Text = txt_TB_Phone.Text.ToString().Substring(0, txt_TB_Phone.TextLength - 1) + "-";
     }
     else
     {
         char[] allow = { '-' };
         GeneralFuntion.textBox_numeric(txt_TB_Phone, allow);
     }
     updateButtons();
     txt_TB_Phone.SelectionStart = txt_TB_Phone.TextLength;
 }
Example #2
0
        private void txt_TB_CourseID_TextChanged(object sender, EventArgs e)
        {
            GeneralFuntion.textBox_numeric(txt_TB_CourseID, null);

            // search course by id - from database
            if (txt_TB_CourseID.TextLength > 0)
            {
                int id = System.Convert.ToInt32(txt_TB_CourseID.Text.ToString());
                courses = dal.courses.Where(x => x.ID == id).ToList <Course>();
            }
            UpdateCoursesInComboBox(courses);
            if (CourseSelected == null && txt_TB_CourseID.TextLength > 0)
            {
                txt_TB_CourseName.Text = "";
            }
        }
        private void txt_TB_idOfStaffMember_TextChanged(object sender, EventArgs e)
        {
            GeneralFuntion.textBox_numeric(txt_TB_idOfStaffMember, null);
            int id = -1;

            try
            {
                id = System.Convert.ToInt32(txt_TB_idOfStaffMember.Text.ToString());
            }
            catch (Exception) { }

            staffMember = null;
            if (id > 0)
            {
                staffMember = getStaffMemberFromID(id);
            }

            if (staffMember != null)
            {
                lbl_permission_change.Text = staffMember.Type;
                btn_add_toStaffmember.Text = "Add to - " + staffMember.Name + " ( " + staffMember.ID + " )";
                UpdateButtons();
            }
            else
            {
                Student std = dal.students.Find(id);

                if (std != null)
                {
                    lbl_permission_change.Text = "Student";
                    btn_add_toStaffmember.Text = "Add to - " + std.Name + " ( " + std.ID + " )";
                    UpdateButtons();
                }
                else
                {
                    lbl_permission_change.Text = "Premission";
                    btn_add_toStaffmember.Text = "Add";
                    UpdateButtons();
                }
            }
        }
 private void txt_TB_Date_TextChanged(object sender, EventArgs e)
 {
     char[] allow = { '.', '-', '/' };
     GeneralFuntion.textBox_numeric(txt_TB_Date, allow);
     updateButtons();
 }
 private void txt_TB_ID_TextChanged(object sender, EventArgs e)
 {
     GeneralFuntion.textBox_numeric(txt_TB_ID, null);
     updateButtons();
 }
 private void txt_TB_YSemester_TextChanged(object sender, EventArgs e)
 {
     char[] allowed = { 'A', 'B', 'C' };
     GeneralFuntion.textBox_numeric(txt_TB_YSemester, allowed);
     updateButtons();
 }
 private void txt_TB_Points_TextChanged(object sender, EventArgs e)
 {
     char[] allowed = { '.' };
     GeneralFuntion.textBox_numeric(txt_TB_Points, allowed);
     updateButtons();
 }
 private void txt_TB_start_TextChanged(object sender, EventArgs e)
 {
     char[] allowed = { ':' };
     GeneralFuntion.textBox_numeric(txt_TB_start, allowed);
     updateButtonsAndTextBoxes();
 }
 private void txt_TB_IDc_TextChanged(object sender, EventArgs e)
 {
     GeneralFuntion.textBox_numeric(txt_TB_IDc, null);
     UpdateButtons();
     resertDetailCourse();
 }