private void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (!GlobalFunctions.checkRights("tsmStockAdjustment", "Update"))
                {
                    return;
                }

                foreach (DataRow _drStatus in loInventory.getInventoryStatus(dgvList.CurrentRow.Cells[0].Value.ToString()).Rows)
                {
                    if (_drStatus[0].ToString() == "Y")
                    {
                        MessageBoxUI _mbStatus = new MessageBoxUI("You cannot update a FINALIZED Stock Inventory!", GlobalVariables.Icons.Warning, GlobalVariables.Buttons.OK);
                        _mbStatus.ShowDialog();
                        return;
                    }
                }
                if (dgvList.Rows.Count > 0)
                {
                    StockAdjustmentDetailUI loStockAdjustmentDetail = new StockAdjustmentDetailUI(dgvList.CurrentRow.Cells[0].Value.ToString());
                    loStockAdjustmentDetail.ParentList = this;
                    loStockAdjustmentDetail.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "btnUpdate_Click");
                em.ShowDialog();
                return;
            }
        }
Esempio n. 2
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            if (!GlobalFunctions.checkRights("tsmStockAdjustment", "Create"))
            {
                return;
            }
            StockAdjustmentDetailUI loStockAdjustmentDetailUI = new StockAdjustmentDetailUI();

            loStockAdjustmentDetailUI.ParentList = this;
            loStockAdjustmentDetailUI.ShowDialog();
        }
 private void btnCreate_Click(object sender, EventArgs e)
 {
     try
     {
         if (!GlobalFunctions.checkRights("tsmStockAdjustment", "Create"))
         {
             return;
         }
         StockAdjustmentDetailUI loStockAdjustmentDetail = new StockAdjustmentDetailUI();
         loStockAdjustmentDetail.ParentList = this;
         loStockAdjustmentDetail.ShowDialog();
     }
     catch (Exception ex)
     {
         ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "btnCreate_Click");
         em.ShowDialog();
         return;
     }
 }
Esempio n. 4
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (!GlobalFunctions.checkRights("tsmStockAdjustment", "Update"))
            {
                return;
            }
            foreach (DataRow _dr in loInventoryHeader.getAllData("", dgvList.CurrentRow.Cells[0].Value.ToString(), "", "Stock Adjustment").Rows)
            {
                if (_dr["Final"].ToString() == "Y")
                {
                    MessageBoxUI mb = new MessageBoxUI("Stock Adjustment is already FINALIZED!", GlobalVariables.Icons.Information, GlobalVariables.Buttons.OK);
                    mb.ShowDialog();
                    return;
                }
            }

            StockAdjustmentDetailUI loStockAdjustmentDetail = new StockAdjustmentDetailUI(dgvList.CurrentRow.Cells[0].Value.ToString());

            loStockAdjustmentDetail.ParentList = this;
            loStockAdjustmentDetail.ShowDialog();
        }