示例#1
0
 private void addtype_Click(object sender, EventArgs e)
 {
     if (combotypes.SelectedIndex != -1 || combocompany.SelectedIndex != -1)
     {
         int       typeid = 0, manid = 0;
         double    price = 0; int amnt = 1;
         BLL.Types tppp = null;
         try
         {
             try { amnt = int.Parse(numbertextbox1.Text); }
             catch { amnt = 1; }
             tppp = (BLL.Types)combotypes.SelectedItem;
             if (!BLL.SalePoint.ISinStore(tppp.ID, amnt))
             {
                 DefaultState(true); return;
             }
             typeid = int.Parse(combotypes.SelectedValue.ToString());
             manid  = int.Parse(combocompany.SelectedValue.ToString());
             price  = ((SaledProcrdere == "M") ? tppp.ClientPrice : tppp.BusinessClientPrice);
             tppp   = (BLL.Types)combotypes.SelectedItem;
             TheUnito TheUnito = TheUnito.Kilo;
             TheUnito = (TheUnito)Enum.Parse(typeof(TheUnito), Globals.Globals.gram.ToString());
             BLL.ClientDeal cl = new WeightsOrganizer.BLL.ClientDeal(0, typeid, manid, amnt, price, price, "", new  MyDateTime(dateTimePicker1.Value), TheUnito, tppp.BusinessPrice, combocompany.Text, combotypes.Text);
             dataGridView1.DataSource = new object();
             dataGridView1.DataSource = BLL.SalePoint.Add(cl);
             DefaultState(true);
             BLL.SalePoint.WriteSerolizeMe();
         }
         catch { }
     }
     else
     {
         MessageBox.Show("معلومات مطلوبة", "الحساب و المادة", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        private void btnaction_Click(object sender, EventArgs e)
        {
            if (combotypes.SelectedIndex == -1 || combocompany.SelectedIndex == -1)
            {
                MessageBox.Show("الرجاء تحديد التاجر و الصنف", "خطأ ادخال بيانات", MessageBoxButtons.OK); return;
            }
            if (txtamount.Text == "0" || (string.IsNullOrEmpty(txtamount.Text)))
            {
                MessageBox.Show("الرجاء تحديد الكمية ", "خطأ ادخال بيانات", MessageBoxButtons.OK); return;
            }
            BLL.Types tp = BLL.Types.GetTypeByID((int)combotypes.SelectedValue);
            if (BLL.Store.GetStoreByTypeID(tp.ID).Amount < double.Parse(txtamount.Text))
            {
                MessageBox.Show("لا تستطيع ارجاع كمية ليست متوفرة في المخزن"); return;
            }
            BLL.BusinesReturns cl = new WeightsOrganizer.BLL.BusinesReturns(0, (int)combotypes.SelectedValue, (int)combocompany.SelectedValue,
                                                                            double.Parse(txtamount.Text), tp.BusinessPrice, tp.ClientPrice, 0, "مجموعة", MyDateTime.Now, combocompany.Text, combotypes.Text);

            List <BLL.BusinesReturns> allz = new List <WeightsOrganizer.BLL.BusinesReturns>();

            allz = alloo;
            bool s = false;

            if (allz.Count > 0)
            {
                foreach (BLL.BusinesReturns bd in allz)
                {
                    if (bd.TypeId == cl.TypeId)
                    {
                        bd.Amount += cl.Amount; s = false;
                        break;
                    }
                    else
                    {
                        s = true;
                    }
                }
                if (s)
                {
                    alloo.Add(cl);
                }
            }
            else
            {
                alloo.Add(cl);
            }
            ALlPrice                += cl.ToTalPrice;
            numbertextbox1.Text      = ALlPrice.ToString();
            numbertextbox2.Text      = ALlPrice.ToString();
            txtamount.Text           = "20";
            combotypes.SelectedIndex = -1;
            combotypes.Text          = "اختر صنف.. ";
            dataGridView1.DataSource = new object();
            dataGridView1.DataSource = alloo;
            combocompany.Enabled     = false;
        }
示例#3
0
 private void combotypes_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         BLL.Types tp = BLL.Types.GetTypeByID((int)combotypes.SelectedValue);
         label7.Text = tp.BusinessPrice.ToString();
         if (combocompany.Enabled)
         {
             combocompany.DataSource = Globals.Globals.PleseGivespecialComapny((int)combotypes.SelectedValue);
         }
     }
     catch { }
 }
示例#4
0
 private void combotypes_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         BLL.Types tp = (BLL.Types)combotypes.SelectedItem;
         label2.Text = (radioButton2.Checked ? tp.ClientPrice : tp.BusinessClientPrice).ToString();
         settingoControl1.Refresh(tp.TheUnit);
         if ((baraCode128vewier1.Text.Length > 0) && (!string.IsNullOrEmpty(baraCode128vewier1.Text) && baraCode128vewier1.Text != " "))
         {
             btnaction_Click(sender, e);
         }
     }
     catch { }
 }
示例#5
0
        private void getlbltot()
        {
            amount           = 0;
            Totalbusprice    = 0;
            Totalcliprice    = 0;
            Totalbuscliprice = 0;
            BLL.Types curtypr = null;
            foreach (BLL.Store str in allstore)
            {
                curtypr = GetTypefrmmstrname(str.TypeName);
                //MessageBox.Show(str.TypeName + " " + str.Amount.ToString());
                //MessageBox.Show(curtypr.Name + " " + curtypr.BusinessPrice.ToString() + " " + curtypr.BusinessClientPrice.ToString() + " " + curtypr.ClientPrice.ToString());

                Totalbusprice    += (str.Amount * curtypr.BusinessPrice);
                Totalbuscliprice += (str.Amount * curtypr.BusinessClientPrice);
                Totalcliprice    += (str.Amount * curtypr.ClientPrice);
            }
            lbltotbus.Text    = Totalbusprice.ToString();
            lbltotbuscli.Text = Totalbuscliprice.ToString();
            lbltotcli.Text    = Totalcliprice.ToString();
        }
示例#6
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            string x = "";

            if (Allcom.Count > 0)
            {
                foreach (BLL.Company c in Allcom)
                {
                    x += c.ID + ",";
                }
                x = x.Substring(0, x.Length - 1);
            }
            else
            {
                x = "";
            }
            BLL.Types tpp = BLL.Types.GetTypeByID(_idtype);
            tpp.AllCompanyId = x; tpp.UpdateType();
            frmRealMainForm.FrmTypso.MyRefresh();
            MessageBox.Show("تم  حفظ قائمة التجار", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#7
0
 private void combotypes_SelectedIndexChanged(object sender, EventArgs e)
 {
     BLL.Types xx = null;
     try
     {
         xx = (BLL.Types)combotypes.SelectedItem;
         if (xx != null)
         {
             addtype.Enabled = true;
         }
         else
         {
             return;
         }
         settingoControl1.Refresh(xx.TheUnit);
         if ((baraCode128vewier1.Text.Length > 0) && (!string.IsNullOrEmpty(baraCode128vewier1.Text) && baraCode128vewier1.Text != " "))
         {
             addtype_Click(sender, e);
         }
     }
     catch { }
 }
        private void vewtypes()
        {
            try
            {
                this.Text           = "معلومات صنف";
                this.label10.Text   = "معلومات صنف";
                grouptypes.Visible  = true;
                grouptypes.Location = new Point(this.Width / 4, 50);
                BLL.Types tp = BLL.Types.GetTypeByID(_idr);
                grouptypes.Controls["txtname"].Text          = tp.Name;
                grouptypes.Controls["txtBusinessPrice"].Text = tp.BusinessPrice.ToString();
                grouptypes.Controls["txtClientPrice"].Text   = tp.ClientPrice.ToString();
                grouptypes.Controls["txtprcln"].Text         = tp.BusinessClientPrice.ToString();
                grouptypes.Text         = "تاريخ الاضافة  " + tp.AddedDate.ToString();
                baraCode128vewier1.Text = tp.BaraCode;
                double amnt = 0; try { amnt = BLL.Store.GetStoreByTypeID(_idr).Amount; }
                catch { }

                grouptypes.Controls["amnto"].Text = "الكمية المتوفرة " + amnt.ToString() + (tp.ArabicUnit);
            }
            catch { }
        }
 void goo()
 {
     if (combotypes.SelectedIndex == -1 || combocompany.SelectedIndex == -1)
     {
         MessageBox.Show("الرجاء تحديد التاجر و الصنف", "خطأ ادخال بيانات", MessageBoxButtons.OK); return;
     }
     if (txtamount.Text == "0" || (string.IsNullOrEmpty(txtamount.Text)))
     {
         MessageBox.Show("الرجاء تحديد الكمية ", "خطأ ادخال بيانات", MessageBoxButtons.OK); return;
     }
     BLL.Types          tp = BLL.Types.GetTypeByID((int)combotypes.SelectedValue);
     BLL.BusinesReturns cl = new WeightsOrganizer.BLL.BusinesReturns(0, (int)combotypes.SelectedValue, (int)combocompany.SelectedValue,
                                                                     double.Parse(txtamount.Text), tp.BusinessPrice, tp.ClientPrice, 0, "", MyDateTime.Now, combocompany.Text, combotypes.Text);
     alloo.Add(cl);
     ALlPrice                += cl.ToTalPrice;
     numbertextbox1.Text      = ALlPrice.ToString();
     numbertextbox2.Text      = ALlPrice.ToString();
     txtamount.Text           = "";
     combotypes.SelectedIndex = -1;
     combotypes.Text          = "اختر صنف.. ";
     dataGridView1.DataSource = new object();
     dataGridView1.DataSource = alloo;
     combocompany.Enabled     = false;
 }
示例#10
0
        private void btnaction_Click(object sender, EventArgs e)
        {
            if (combotypes.SelectedIndex == -1 || combocompany.SelectedIndex == -1)
            {
                MessageBox.Show("الرجاء تحديد الزبون و الصنف", "خطأ ادخال بيانات", MessageBoxButtons.OK); return;
            }
            if (txtamount.Text == "0" || (string.IsNullOrEmpty(txtamount.Text)))
            {
                MessageBox.Show("الرجاء تحديد الكمية ", "خطأ ادخال بيانات", MessageBoxButtons.OK); return;
            }
            TheUnito TheUnito = TheUnito.Kilo;

            TheUnito = (TheUnito)Enum.Parse(typeof(TheUnito), Globals.Globals.gram.ToString());
            BLL.Types tp = (BLL.Types)combotypes.SelectedItem;
            //
            double stramnt = 0;

            stramnt = double.Parse(txtamount.Text);
            if (tp.TheUnit == TheUnito.Gram)
            {
                stramnt = double.Parse(txtamount.Text) / 1000;
            }
            BLL.Store teststore = BLL.Store.GetStoreByTypeID(tp.ID);
            if (teststore != null)
            {
                ///MessageBox.Show(teststore.Amount.ToString() + " " + stramnt.ToString());
                if ((teststore.Amount < stramnt))
                {
                    MessageBox.Show(" لا تتوفر هذه الكمية من الصنف  " + tp.Name, "الكميات المتوفرة-المخزن", MessageBoxButtons.OK, MessageBoxIcon.Information); return;
                }
            }
            else
            {
                MessageBox.Show(" صنف غير موجود بالمخزن" + tp.Name, "الكميات المتوفرة-المخزن", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            //

            TheUnito = (TheUnito)Enum.Parse(typeof(TheUnito), Globals.Globals.gram.ToString());
            BLL.ClientDeal cl = new WeightsOrganizer.BLL.ClientDeal(0, (int)combotypes.SelectedValue, (int)combocompany.SelectedValue,
                                                                    double.Parse(txtamount.Text), (radioButton2.Checked ? tp.ClientPrice : tp.BusinessClientPrice), 0, "مجموعة", MyDateTime.Now, TheUnito, tp.BusinessPrice, combocompany.Text, combotypes.Text);

            List <BLL.ClientDeal> allz = new List <WeightsOrganizer.BLL.ClientDeal>();

            allz = alloo;
            bool s = false;

            if (allz.Count > 0)
            {
                foreach (BLL.ClientDeal bd in allz)
                {
                    if ((bd.TypeId == cl.TypeId) && (bd.TheUnit == cl.TheUnit))
                    {
                        bd.Amount += cl.Amount; s = false;
                        break;
                    }
                    else
                    {
                        s = true;
                    }
                }
                if (s)
                {
                    alloo.Add(cl);
                }
            }
            else
            {
                alloo.Add(cl);
            }
            ALlPrice                += cl.ToTalPrice;
            numbertextbox1.Text      = ALlPrice.ToString();
            numbertextbox2.Text      = ALlPrice.ToString();
            txtamount.Text           = "";
            combotypes.SelectedIndex = -1;
            combotypes.Text          = "اختر صنف.. ";
            combotypes.SelectAll();
            txtamount.Text           = "1";
            dataGridView1.DataSource = new object();
            dataGridView1.DataSource = alloo;
            combocompany.Enabled     = false;
            checkBox1.Enabled        = false;
            groupBox3.Enabled        = false;
            label2.Text = "السعر";
        }