示例#1
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            INVTakingInventoryLineWrapper _TakingInventoryWrapper = new INVTakingInventoryLineWrapper();
            int takingType = 0;

            if (ridb_Product.Checked)
            {
                takingType = 1;
            }
            else if (ridb_ProductGroup.Checked)
            {
                takingType = 2;
            }

            int?_productID      = (cmb_Product.SelectedValue != null)? cmb_Product.SelectedValue as int? : null;
            int?_productGroupID = (cmb_productGroup.SelectedValue != null)?cmb_productGroup.SelectedValue as int? : null;

            bool result = _TakingInventoryWrapper.OpenTakingInventory(tbx_takingName.Text, dtp_takingDate.Value, (int)cmb_inventory.SelectedValue,
                                                                      takingType, _productID, _productGroupID, tbx_notes.Text);

            if (result == false)
            {
                MessageBox.Show("حدث خطأ يرجي المحاوله مره اخري");
            }
        }
示例#2
0
 public void btn_Save_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < dgv_Lines.Rows.Count; i++)
     {
         int     lineID    = Convert.ToInt32(dgv_Lines.Rows[i].Cells["Col_TakingInventoryLineID"].Value);
         int     batchID   = Convert.ToInt32(dgv_Lines.Rows[i].Cells["Col_TakingLineBatchID"].Value);
         decimal actualQty = Convert.ToDecimal(dgv_Lines.Rows[i].Cells["Col_ActualQty"].Value);
         INVTakingInventoryLineWrapper.saveLines(lineID, batchID, actualQty);
     }
     MessageBox.Show("تم الحفظ بنجاح");
 }
示例#3
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            if (Validate())
            {
                INVTakingInventoryLineWrapper _TakingInventoryWrapper = new INVTakingInventoryLineWrapper();
                int takingType = 0;
                if (ridb_Product.Checked)
                {
                    takingType = 1;
                }
                else if (ridb_ProductGroup.Checked)
                {
                    takingType = 2;
                }

                int?_productID      = (cmb_Product.SelectedValue != null) ? cmb_Product.SelectedValue as int? : null;
                int?_productGroupID = (cmb_productGroup.SelectedValue != null) ? cmb_productGroup.SelectedValue as int? : null;

                try
                {
                    bool result = _TakingInventoryWrapper.OpenTakingInventory(tbx_takingName.Text, dtp_takingDate.Value, (int)cmb_inventory.SelectedValue,
                                                                              takingType, _productID, _productGroupID, tbx_notes.Text);

                    if (result == false)
                    {
                        MessageBox.Show("حدث خطأ يرجي المحاوله مره اخري");
                    }
                    else
                    {
                        MessageBox.Show("تم فتح الجرد بنجاح");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("حدث خطأ برجاء تكرار العمليه مره اخرى واذا تكرر الخطا برجاءالاتصال بالشخص المصمم للبرنامج وارسال رسالة الخطا التى ستظهر بعد قليل له");
                    MessageBox.Show(ex.Message);
                }
            }
        }