Beispiel #1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (!GlobalFunctions.checkRights("tsmPurchaseOrder", "Update"))
                {
                    return;
                }

                foreach (DataRow _drStatus in loPurchaseOrder.getPurchaseOrderStatus(dgvList.CurrentRow.Cells[0].Value.ToString()).Rows)
                {
                    if (_drStatus["Final"].ToString() == "Y")
                    {
                        MessageBoxUI _mbStatus = new MessageBoxUI("You cannot update a FINALIZED Purchase Order!", GlobalVariables.Icons.Warning, GlobalVariables.Buttons.OK);
                        _mbStatus.ShowDialog();
                        return;
                    }
                }
                if (dgvList.Rows.Count > 0)
                {
                    PurchaseOrderDetailUI loPurchaseOrderDetail = new PurchaseOrderDetailUI(dgvList.CurrentRow.Cells[0].Value.ToString());
                    loPurchaseOrderDetail.ParentList = this;
                    loPurchaseOrderDetail.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "btnUpdate_Click");
                em.ShowDialog();
                return;
            }
        }
Beispiel #2
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     try
     {
         if (!GlobalFunctions.checkRights("tsmPurchaseOrder", "Create"))
         {
             return;
         }
         PurchaseOrderDetailUI loPurchaseOrderDetail = new PurchaseOrderDetailUI();
         loPurchaseOrderDetail.ParentList = this;
         loPurchaseOrderDetail.ShowDialog();
     }
     catch (Exception ex)
     {
         ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "btnCreate_Click");
         em.ShowDialog();
         return;
     }
 }