Пример #1
0
        public override void btn_Save_Click(object sender, EventArgs e)
        {
            if (Validate())
            {
                try
                {
                    bool rtn_result = false;
                    if (_adjustStockID > 0)
                    {
                        rtn_result = _adjustStockWrapper.Update(_adjustStock);
                    }
                    else
                    {
                        rtn_result = _adjustStockWrapper.Insert(_adjustStock);
                    }

                    _adjustStockWrapper.SaveAdjustStock(_adjustStockCollection);

                    if (rtn_result)
                    {
                        _frmAdjustmentSearch.InitiateGrid();
                        MessageBox.Show("تمت العملية");
                        this.Close();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("حدث خطأ برجاء المحاولة مرة آخرى");
                }
            }
            else
            {
                MessageBox.Show("خطأ بالبيانات يرجى مراجعتها .");
            }
        }
Пример #2
0
        public override void btn_Save_Click(object sender, EventArgs e)
        {
            if (Validate())
            {
                try
                {
                    bool rtn_result = false;
                    if (_adjustStockID > 0)
                    {
                        rtn_result = _adjustStockWrapper.Update(_adjustStock);
                    }
                    else
                    {
                        rtn_result = _adjustStockWrapper.Insert(_adjustStock);
                    }

                    _adjustStockWrapper.SaveAdjustStock(_adjustStockCollection);

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