Example #1
0
 private Documents GetSapDocument(ICompany company, Type docType = null)
 {
     docType = docType != null ? docType : _curDocType;
     if (docType == _quotationType)
     {
         return((Documents)company.GetBusinessObject(BoObjectTypes.oQuotations));
     }
     if (docType == _orderType)
     {
         return((Documents)company.GetBusinessObject(BoObjectTypes.oOrders));
     }
     if (docType == _invoiceType)
     {
         return((Documents)company.GetBusinessObject(BoObjectTypes.oInvoices));
     }
     if (docType == _deliveryNoteType)
     {
         return((Documents)company.GetBusinessObject(BoObjectTypes.oDeliveryNotes));
     }
     if (docType == _creditNoteType)
     {
         return((Documents)company.GetBusinessObject(BoObjectTypes.oCreditNotes));
     }
     return(null);
 }
Example #2
0
        public static void GetProduct(string ItemCode)
        {
            var product = (SAPbobsCOM.Items)oCompany.GetBusinessObject(BoObjectTypes.oItems);

            product.GetByKey(ItemCode);

            product.ItemName = "Apple";

            int lRetCode = product.Update();

            // si errCode es diferente de 0 pudo haber algĂșn error
            if (lRetCode != 0)
            {
                var a = Program.GetLastError("Company: " + oCompany.Server + ", DB: " + oCompany.CompanyDB);
            }
        }