Example #1
0
        public bool CreateArticle(string articleNo, string name, int priceCalcMethodsNo, int postingTemplate, int stockProfileNo)
        {
            _articleComponent.bcInitData();
            _articleComponent.bcSetInitialValues();

            _articleComponent.bcSetValueFromStr((int)Article_Properties.ART_ArticleNo, articleNo);
            _articleComponent.bcUpdateStr((int)Article_Properties.ART_Name, name);
            // Konteringsmall
            _articleComponent.bcUpdateInt((int)Article_Properties.ART_PostingTemplateNo, postingTemplate);
            // Prisprofil
            _articleComponent.bcUpdateInt((int)Article_Properties.ART_PriceCalcMethodsNo, priceCalcMethodsNo);
            // Lagerprofil
            _articleComponent.bcUpdateInt((int)Article_Properties.ART_StockProfileNo, stockProfileNo);

            var errCode = _articleComponent.bcAddNew();

            if (errCode != 0)
            {
                _articleComponent.bcCancelRecord();
                LogFileWriter.WriteLine(string.Format("Attempt to create article '{0} - {1}' failed. Code {2} - {3}", articleNo, name, errCode, _articleComponent.bcGetMessageText(errCode)));
                return(false);
            }

            return(true);
        }
Example #2
0
 public void MarkInvoiceAsTransferred(int invoiceNo)
 {
     _invoiceComp.bcSetFilterRequeryStr(string.Format("{0} = {1}", _colInvoiceNo, invoiceNo));
     _invoiceComp.bcFetchFirst(1);
     _invoiceComp.bcUpdateInt((int)CustomerOrderCopy_Properties.COP_LoanReturnNo, 1);
     _invoiceComp.bcSaveRecord();
 }