private void txtBarcode_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         P = ProductsBLL.CheckProductCodeExistance(txtBarcode.Text);
         if (P == null)
         {
             DialogResult Res = MessageBox.Show("This Product is not Exists, do you want to Create it? (Y/N)", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
             if (Res == DialogResult.Yes)
             {
                 frmNewProduct frm = new frmNewProduct(txtBarcode.Text);
                 frm.ShowDialog();
             }
         }
         else
         {
             lblItemName.Text      = P.PRODUCT_NAME;
             picProductImage.Image = P.PRODUCT_IMAGE;
             picProductImage.AdjustPictureBox();
             lblExpiryDate.Text = ProductExpiryDatesBLL.GetNearestProductExpiryDate(P.PRODUCT_ID).ToString();
         }
     }
 }
Exemplo n.º 2
0
        private void btnNewProduct_Click(object sender, EventArgs e)
        {
            frmNewProduct frm = new frmNewProduct();

            frm.ShowDialog();
        }