Пример #1
0
 private void btnDone_Click(object sender, EventArgs e)
 {
     try
     {
         dbconnection.Open();
         double q = OfferCollect(Convert.ToInt16(txtOffersID.Text));
         double quntityRequest = Convert.ToDouble(txtOfferQuantity.Text);
         if (quntityRequest <= q)
         {
             RecordOfferQuantityInStorage(Convert.ToDouble(txtOfferQuantity.Text), Convert.ToInt16(txtOffersID.Text));
             decreaseItemsQuantityInDB(Convert.ToDouble(txtOfferQuantity.Text), Convert.ToInt16(txtOffersID.Text));
             MessageBox.Show("تم");
             // dataGridView1.Rows.Clear();
             offerStorage.DisplayOffer();
         }
         else
         {
             MessageBox.Show("الكمية المطلوبة غير متاحة");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     dbconnection.Close();
 }
Пример #2
0
        private void btnDone_Click(object sender, EventArgs e)
        {
            try
            {
                dbconnection.Open();
                RecordOfferQuantityInStorage(Convert.ToDouble(txtOfferQuantity.Text), Convert.ToInt16(txtOffersID.Text));
                increaseItemsQuantityInDB(Convert.ToDouble(txtOfferQuantity.Text), Convert.ToInt16(txtOffersID.Text));
                MessageBox.Show("تم");

                dataGridView1.Rows.Clear();
                comStore.Text              = "";
                txtStoreID.Text            = "";
                txtOfferQuantity.Text      = "";
                txtTotalQuantityOffer.Text = "";
                txtOffersID.Text           = "";
                comOffers.Text             = "";
                offerStorage.DisplayOffer();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            dbconnection.Close();
        }