当前位置: 首页>>代码示例>>C#>>正文


C# MasterDataBLL.GetItemCategoryById方法代码示例

本文整理汇总了C#中BusinessObjects.MasterDataBLL.GetItemCategoryById方法的典型用法代码示例。如果您正苦于以下问题:C# MasterDataBLL.GetItemCategoryById方法的具体用法?C# MasterDataBLL.GetItemCategoryById怎么用?C# MasterDataBLL.GetItemCategoryById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BusinessObjects.MasterDataBLL的用法示例。


在下文中一共展示了MasterDataBLL.GetItemCategoryById方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExportPVDataByFormID

        /// <summary>
        /// PV
        /// </summary>
        /// <param name="FormID"></param>
        /// <returns></returns>
        private bool ExportPVDataByFormID(int FormID, int logId)
        {
            ExportDataDS.ExportDataDataTable l_dtExportData = new ExportDataDS.ExportDataDataTable();
            PurchaseDS.FormPVDetailDataTable l_dtFormPVDetail = new PurchaseDS.FormPVDetailDataTable();
            PurchaseDS.FormPVRow l_drFormPV = new PurchaseDS.FormPVDataTable().NewFormPVRow();
            FormMarketingBLL formmarkbll = new FormMarketingBLL();
            FormPurchaseBLL formPurchaseBLL = new FormPurchaseBLL();
            MasterDataBLL masterdatabll = new MasterDataBLL();
            FormDS.FormDataTable l_dtform = formmarkbll.GetFormByID(FormID);
            FormDS.FormRow l_drform = l_dtform.NewFormRow();
            try {
                if (l_dtform.Rows.Count > 0) {
                    l_drform = l_dtform[0];
                    if (l_drform.IsFinanceRemarkNull()) {
                        logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:财务摘要为空,导出失败!");
                        return false;
                    }
                    l_drFormPV = formPurchaseBLL.GetFormPVByID(FormID);
                    //PurchaseDS.FormInvoiceDataTable l_dtFormInvoice = formPurchaseBLL.GetFormInvoiceByFormID(FormID);
                    ExportDataDS.ExportDataRow l_drExportData = l_dtExportData.NewExportDataRow();
                    l_drExportData.FormID = FormID;
                    l_drExportData.CompanyCode = masterdatabll.GetCompanyById(masterdatabll.GetVendorTypeById(masterdatabll.GetVendorByID(l_drFormPV.VendorID).VendorTypeID).CompanyID).CompanyCode;
                    //验证公司是否和成本中心对应的一致
                    string CCCompanyCode = masterdatabll.GetCompanyById(masterdatabll.GetCostCenterById(l_drform.CostCenterID).CompanyID).CompanyCode;
                    if (l_drExportData.CompanyCode != CCCompanyCode) {
                        logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:Company Code不一致,无法导出!");
                        return false;
                    }
                    l_drExportData.VendorCode = masterdatabll.GetVendorByID(l_drFormPV.VendorID).VendorCode;
                    if (l_drExportData.IsVendorCodeNull() || string.IsNullOrEmpty(l_drExportData.VendorCode)) {
                        logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:Vendor Code为空,无法导出!");
                        return false;
                    }
                    //发票号码改为单据编号,单据编号变为10位
                    l_drExportData.Invoice = l_drform.FormNo;
                    //l_drExportData.Invoicedate = l_drform.SubmitDate.ToString("yyyyMMdd");
                    l_drExportData.Invoicedate = getInvoiceDate(l_drform.FormID, l_drform.SubmitDate);

                    //if (l_dtFormInvoice.Rows.Count > 1)
                    //    l_drExportData.Reference = l_dtFormInvoice[1].InvoiceNo;
                    //if (l_dtFormInvoice.Rows.Count > 0) {
                    //    l_drExportData.Invoice = l_dtFormInvoice[0].InvoiceNo;
                    //    l_drExportData.Invoicedate = l_dtFormInvoice[0].InvoiceDate.ToString("yyyyMMdd");
                    //} else {
                    //    l_drExportData.Invoice = l_drform.FormNo;
                    //    l_drExportData.Invoicedate = l_drform.SubmitDate.ToString("yyyyMMdd");
                    //}
                    l_drExportData.TotalMoney = l_drFormPV.AMTBeforeTax;
                    //l_drExportData.Currency = masterdatabll.GetCurrencyByID(l_drFormPV.CurrencyID).CurrencyShortName;
                    //l_drExportData.ExchangeRate = l_drFormPV.ExchangeRate;
                    l_drExportData.ManageExpenseItem = masterdatabll.GetItemCategoryById(l_drFormPV.FinalItemCategoryID).AccountingName;
                    l_drExportData.CostCenter = masterdatabll.GetCostCenterById(l_drform.CostCenterID).CostCenterCode;
                    l_drExportData.AccountCode = masterdatabll.GetItemCategoryById(l_drFormPV.FinalItemCategoryID).AccountingCode;
                    l_drExportData.DetailMoney = l_drFormPV.AMTBeforeTax;
                    if (!l_drFormPV.IsFormPOIDNull()) {
                        PurchaseDS.FormPORow formPO = formPurchaseBLL.GetFormPOByID(l_drFormPV.FormPOID);
                        l_drExportData.PONumber = formPO.BPCSPONo;
                        PurchaseDS.FormPODetailDataTable formPODetail = formPurchaseBLL.GetPODetailByFormPOID(l_drFormPV.FormPOID);
                        l_drExportData.POLineNumber = formPODetail.Rows.Count.ToString();
                    } else {
                        l_drExportData.PONumber = 0;
                        l_drExportData.POLineNumber = "0";
                    }
                    l_drExportData.FinanceRemark = l_drform.FinanceRemark;
                    l_drExportData.FormNo = l_drform.FormNo;
                    l_drExportData.TaxAmt = l_drFormPV.AMTTax;
                    l_drExportData.TaxRateCode = masterdatabll.GetVatTypeById(l_drFormPV.VatRateID)[0].VatTypeName;
                    l_dtExportData.AddExportDataRow(l_drExportData);
                    if (l_dtExportData.Rows.Count == 0) {
                        logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:无明细数据,无法导出!");
                        return false;
                    }
                    ExportByFormView(l_dtExportData);
                }
            } catch (Exception e) {
                logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:" + e.Message);
                return false;
            }
            return true;
        }
开发者ID:hijoy,项目名称:CPL_ERS,代码行数:85,代码来源:Program.cs


注:本文中的BusinessObjects.MasterDataBLL.GetItemCategoryById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。