Ejemplo n.º 1
0
 public void Save(object sender, EventArgs e)
 {
     try
     {
         if (Valid())
         {
             this.Cursor = Cursors.WaitCursor;
             UpdateEntity();
             if (m_po.ID == 0)
             {
                 r_grn.Save(m_po);
             }
             else
             {
                 r_grn.Update(m_po);
             }
             KryptonMessageBox.Show("Transaction '" + m_po.CODE + "' Record has been saved", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
             textBoxCode.Text = m_po.CODE;
             setEnableForm(false);
             setEditMode(EditMode.View);
             textBoxCode.Focus();
             this.Cursor = Cursors.Default;
         }
     }
     catch (Exception x)
     {
         KryptonMessageBox.Show(x.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Ejemplo n.º 2
0
        private void TestCreate()
        {
            PurchaseOrder   po  = (PurchaseOrder)m_poRep.Get(5);
            GoodReceiveNote grn = new GoodReceiveNote();

            grn.CODE                  = "GRN001";
            grn.EMPLOYEE              = new Employee(1);
            grn.EVENT_STATUS          = EventStatus.Entry;
            grn.NOTES                 = "TEST IN GRN";
            grn.NOTICE_DATE           = DateTime.Today;
            grn.STOCK_CARD_ENTRY_TYPE = StockCardEntryType.GoodReceiveNote;
            grn.TRANSACTION_DATE      = DateTime.Today;

            GoodReceiveNoteItem grni1 = new GoodReceiveNoteItem();

            grni1.EVENT                 = grn;
            grni1.NOTES                 = "TEST GRN ITEM 1";
            grni1.PART                  = new Part(9070);
            grni1.PO_ITEM               = (PurchaseOrderItem)po.EVENT_ITEMS[0];
            grni1.QYTAMOUNT             = 13000;
            grni1.RETURNED_AMOUNT       = 0;
            grni1.STOCK_CARD_ENTRY_TYPE = StockCardEntryType.GoodReceiveNote;
            grni1.UNIT                  = new Unit(1);
            grni1.WAREHOUSE             = new Warehouse(1);

            GoodReceiveNoteItem grni2 = new GoodReceiveNoteItem();

            grni2.EVENT                 = grn;
            grni2.NOTES                 = "TEST GRN ITEM 1";
            grni2.PART                  = new Part(9071);
            grni2.PO_ITEM               = (PurchaseOrderItem)po.EVENT_ITEMS[1];
            grni2.QYTAMOUNT             = 1254;
            grni2.RETURNED_AMOUNT       = 0;
            grni2.STOCK_CARD_ENTRY_TYPE = StockCardEntryType.GoodReceiveNote;
            grni2.UNIT                  = new Unit(1);
            grni2.WAREHOUSE             = new Warehouse(1);

            grn.EVENT_ITEMS.Add(grni1);
            grn.EVENT_ITEMS.Add(grni2);

            m_grnRep.Save(grn);
        }