示例#1
0
 /// <summary>
 /// move to the nest textBlock when press enter key
 /// </summary>
 /// <param name="sender">sender of the event</param>
 /// <param name="e">e of the argument</param>
 private void CodeTBKey_Down(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         NameTB.Focus();
     }
 }
示例#2
0
        private void InsertB_Click(object sender, EventArgs e)
        {
            CategoryVO category = new CategoryVO();

            category.Name = NameTB.Text.Trim();

            if (NameTB.Text.Trim() == "")
            {
                Error("اسم التصنيف لايمكن أن يكون فارغاً");
                return;
            }
            if (!manager.IsCategoryNew(category))
            {
                Error("اسم التصنيف موجود سابقاً", "تعذر إضافة تصنيف جديد");
                return;
            }


            if (manager.Insert(category) < 0)
            {
                Error("حدث خطأ أثناء عملية إضافة التصنيف", "فشل عملية الإضافة");
            }
            else
            {
                bindingSource1.Add(category);
                CategoryDataGridView.Refresh();
                Message("تم إضافة التصنيف بنجاح", "عملية ناجحة");
                NameTB.Text = "";
                NameTB.Focus();
                Log(OperationsManager.EDIT_CATEGORIES);
            }
        }
示例#3
0
 public InputName(int Score, int Lines)
 {
     InitializeComponent();
     NameTB.Focus();
     NameTB.SelectAll();
     this.Score = Score;
     this.Lines = Lines;
 }
示例#4
0
 private void NameTB_Validating(object sender, CancelEventArgs e)
 {
     if (!Regex.Match(NameTB.Text, "^[A-Z][a-zA-Z]*$").Success)
     {
         // first name was incorrect
         MessageBox.Show("Please Enter Valid First name.  it must start with Capital Letter");
         NameTB.Focus();
         e.Cancel = true;
     }
 }
 /// <summary>
 /// window ctor
 /// </summary>
 public Register()
 {
     InitializeComponent();
     try
     {
         bl = BLFactory.GetBL();
     }
     catch (BO.MissingData ex) //creating BO failed
     {
         MessageBox.Show(ex.Message);
     }
     NameTB.Focus();
 }
示例#6
0
 public ProductDialog()
 {
     InitializeComponent();
     DataContext = newProduct;
     NameTB.Focus();
 }