Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (combocompany.SelectedIndex == -1)
            {
                return;
            }
            bool her = false;

            Allcom2 = new List <WeightsOrganizer.BLL.Company>();
            BLL.Company cm = BLL.Company.GetCompanyByID(int.Parse(combocompany.SelectedValue.ToString()));
            if (Allcom.Count > 0)
            {
                foreach (BLL.Company c in Allcom)
                {
                    if (c.ID == cm.ID)
                    {
                    }
                    else
                    {
                        Allcom2.Add(c); her = true;
                    }
                }
            }
            else
            {
                Allcom2.Add(cm);
            }
            if (her)
            {
                Allcom2.Add(cm);
            }
            dataGridView1.DataSource = new object();
            Allcom = Allcom2;
            dataGridView1.DataSource = Allcom;
        }
        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 vewcomp()
 {
     this.Text          = "معلومات تاجر";
     this.label10.Text  = "معلومات تاجر";
     groupBox2.Visible  = true;
     groupBox2.Location = new Point(this.Width / 4, 50);
     BLL.Company tp = BLL.Company.GetCompanyByID(_idr);
     groupBox2.Controls["textBox3"].Text = tp.Name;
     groupBox2.Controls["textBox2"].Text = tp.Details.ToString();
     groupBox2.Controls["label6"].Text   = tp.AddedDate.ToString();
 }
Example #4
0
        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;
        }