Esempio n. 1
0
        public FrmAdjustReasonAddEdit(INVAdjustStockReason reason )
        {
            InitializeComponent();
            _currentReason = reason;
            txb_AdjustStockReason.Text = reason.AdjustStockreasonName;

        }
Esempio n. 2
0
 public override void btn_Save_Click(object sender, EventArgs e)
 {
     if (txb_AdjustStockReason.Text!="")
     {
         if (_currentReason == null)
         {
             _currentReason = new INVAdjustStockReason();
             _currentReason.AdjustStockreasonName = txb_AdjustStockReason.Text;
             service.Insert(_currentReason);
         }
         else
         {
             INVAdjustStockReasonPrimaryKey pk = new INVAdjustStockReasonPrimaryKey();
             pk.AdjustStockReasonID = _currentReason.AdjustStockReasonID;
             _currentReason = service.SelectOne(pk);
             _currentReason.AdjustStockreasonName = txb_AdjustStockReason.Text;
             service.Update(_currentReason);
         }
         MessageBox.Show("تم الحفظ بنجاح");
         this.Close();
     }
 }