private void button1_Click(object sender, EventArgs e) { double paidprc = 0; try { paidprc = double.Parse(numbertextbox2.Text); } catch { } List <BLL.BusinesReturns> alcll = new List <WeightsOrganizer.BLL.BusinesReturns>(); try { alcll = (List <BLL.BusinesReturns>)dataGridView1.DataSource; } catch { } WeightsOrganizer.BLL.BusinesReturns.InsertBusinesReturns(alcll); BLL.Company clo = (BLL.Company)combocompany.SelectedItem; if (checkBox1.Checked) { clo.Balance -= double.Parse(numbertextbox1.Text); clo.UpdateCompany(); } ALlPrice = 0; alloo = new List <WeightsOrganizer.BLL.BusinesReturns>(); dataGridView1.DataSource = new object(); combocompany.Enabled = true; numbertextbox1.Text = "0"; numbertextbox2.Text = "0"; if (frmRealMainForm.FrmTypso != null) { frmRealMainForm.FrmTypso.MyRefresh(); } }
private void button1_Click(object sender, EventArgs e) { button1.Enabled = false; double paidprc = 0; try { paidprc = double.Parse(numbertextbox2.Text); } catch { } List <BLL.BusinesDeal> alcll = new List <WeightsOrganizer.BLL.BusinesDeal>(); try { alcll = (List <BLL.BusinesDeal>)dataGridView1.DataSource; } catch { } BLL.BusinesDeal.InsertGroup(alcll); BLL.Company clo = (BLL.Company)combocompany.SelectedItem; clo.Balance += double.Parse(numbertextbox1.Text) - double.Parse(numbertextbox2.Text); clo.UpdateCompany(); if (Globals.Globals.PrintWhenBuy) { try { Globals.Globals.PrintNow(dataGridView1, "السيد " + combocompany.Text, string.Format("المجموع {0} ل.س ", ALlPrice) + Environment.NewLine + " الباقي " + (ALlPrice - paidprc).ToString() + " ل.س ", true); } catch { } } ALlPrice = 0; alloo = new List <WeightsOrganizer.BLL.BusinesDeal>(); dataGridView1.DataSource = new object(); combocompany.Enabled = true; numbertextbox1.Text = "0"; numbertextbox2.Text = "0"; if (frmRealMainForm.FrmTypso != null && frmRealMainForm.FrmTypso.Name == "frmbusinesdeal") { frmRealMainForm.FrmTypso.MyRefresh(); } button1.Enabled = true; combocompany.SelectedItem = clo; }
public bool UpdateCompany() { bool x = Company.UpdateCompany(ID, Name, Details, this.Balance); return(x); }