private void btnADD_PROD_TO_CART_Click(object sender, EventArgs e) { if ( !string.IsNullOrEmpty(textPRO_NAME.Text) && !string.IsNullOrEmpty(textITEM_PRICE.Text) && !string.IsNullOrEmpty(textITEM_COUNT.Text) ) { BL.CLS_RECEIPT_ACOUNT obj = new BL.CLS_RECEIPT_ACOUNT(); obj.الرقم = product_id; obj.الاسم = textPRO_NAME.Text; obj.السعر = Convert.ToDouble(textITEM_PRICE.Text); obj.الكميه = Convert.ToInt32(textITEM_COUNT.Text); obj.النوع = btnTypeSwitch.Text; total += obj.السعر * obj.الكميه; if (total > 0) { cLSRECEIPTACOUNTBindingSource.Add(obj); } cLSRECEIPTACOUNTBindingSource.MoveLast(); textPRO_NAME.Text = string.Empty; textITEM_PRICE.Text = string.Empty; textITEM_COUNT.Text = string.Empty; textBARCODE.Text = string.Empty; txtTOTAL.Text = string.Format("{0}ج", total); } else { MessageBox.Show("عفوا لا توجد منتجات للاضافة "); } }
private void btnDELET_PROD_CART_Click(object sender, EventArgs e) { BL.CLS_RECEIPT_ACOUNT obj = cLSRECEIPTACOUNTBindingSource.Current as BL.CLS_RECEIPT_ACOUNT; if (obj != null) { total -= obj.السعر * obj.الكميه; txtTOTAL.Text = string.Format("{0}ج", total); cLSRECEIPTACOUNTBindingSource.RemoveCurrent(); } else { MessageBox.Show("لا توجد منتجات بالفاتورة"); } }