本文整理汇总了C#中BusinessObjects.MasterDataBLL.GetVatTypeById方法的典型用法代码示例。如果您正苦于以下问题:C# MasterDataBLL.GetVatTypeById方法的具体用法?C# MasterDataBLL.GetVatTypeById怎么用?C# MasterDataBLL.GetVatTypeById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BusinessObjects.MasterDataBLL
的用法示例。
在下文中一共展示了MasterDataBLL.GetVatTypeById方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
String title = this.GetLocalResourceObject("titleLabel.Text").ToString();
this.Page.Title = title;
int VendorID = int.Parse(Request["VendorID"]);
this.ViewState["VendorID"] = VendorID;
MasterData.VendorRow vendorRow = new MasterDataBLL().GetVendorByID(VendorID);
txtVendorName.Text = vendorRow.VendorName;
txtVendorAddress.Text = vendorRow.VendorAddress;
txtCity.Text = vendorRow.City;
txtPostal.Text = vendorRow.Postal;
txtContactName.Text = vendorRow.ContactName;
MasterDataBLL masterDataBLL = new MasterDataBLL();
MasterData.VendorTypeRow VendorTypeRow = masterDataBLL.GetVendorTypeById(vendorRow.VendorTypeID);
txtVendorType.Text = VendorTypeRow.VendorTypeName;
txtCurrency.Text = masterDataBLL.GetCurrencyByID(VendorTypeRow.CurrencyID).CurrencyFullName;
txtCompany.Text = masterDataBLL.GetCompanyById(VendorTypeRow.CompanyID).CompanyName;
txtCompanyCode.Text = masterDataBLL.GetCompanyById(VendorTypeRow.CompanyID).CompanyCode;
this.txtPhoneNumber.Text = vendorRow.PhoneNumber;
this.txtOneTimeVendor.Text = vendorRow.OneTimeVendor ? "Y" : "N";
this.txtHoldVendor.Text = vendorRow.HoldVendor ? "Y" : "N";
if (!vendorRow.IsPurchaseingPostalCodeNull()) {
this.txtPurchaseingPostalCode.Text = vendorRow.PurchaseingPostalCode;
}
if (!vendorRow.IsAlphaSearchKeyNull()) {
this.txtAlphaSearchKey.Text = vendorRow.AlphaSearchKey;
}
if (!vendorRow.IsPurchasingCityNull()) {
this.txtPurchasingCity.Text = vendorRow.PurchasingCity;
}
if (!vendorRow.IsPurchasingContactNull()) {
this.txtPurchasingContact.Text = vendorRow.PurchasingContact;
}
if (!vendorRow.IsPurchasingAddressNull()) {
this.txtPurchasingAddress.Text = vendorRow.PurchasingAddress;
}
if (!vendorRow.IsPurchasePhoneNumberNull()) {
this.txtPurchasePhoneNumber.Text = vendorRow.PurchasePhoneNumber;
}
this.txtBankCode.Text = vendorRow.BankCode;
this.txtMethodPayment.Text = masterDataBLL.GetMethodPaymentById(vendorRow.MethodPaymentID)[0].MethodPaymentName;
this.txtPaymentTerm.Text = masterDataBLL.GetPaymentTermById(vendorRow.PaymentTermID)[0].PaymentTermName;
this.txtTransType.Text = masterDataBLL.GetTransTypeById(vendorRow.TransTypeID)[0].TransTypeName;
txtVATRate.Text = masterDataBLL.GetVatTypeById(vendorRow.VATTypeID)[0].VatTypeName;
txtBankName.Text = vendorRow.BankName.ToString();
if (!vendorRow.IsAccountNoNull()) {
txtAccountNo.Text = vendorRow.AccountNo;
}
if (!vendorRow.IsBankNoNull()) {
this.txtBankNo.Text = vendorRow.BankNo;
}
if (!vendorRow.IsACTypeIDNull()) {
this.txtACType.Text = masterDataBLL.GetACTypeById(vendorRow.ACTypeID)[0].ACTypeName;
}
if (!vendorRow.IsRemarkNull()) {
this.txtRemark.Text = vendorRow.Remark;
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
if (!this.IsPostBack) {
String title = this.GetLocalResourceObject("titleLabel.Text").ToString();
PageUtility.SetContentTitle(this.Page, title);
MasterDataBLL mdBLL = new MasterDataBLL();
int formID = int.Parse(Request["ObjectId"]);
this.ViewState["ObjectId"] = formID;
FormDS.FormSalePaymentRow rowFormPayment = this.FormSaleBLL.GetFormSalePaymentByID(int.Parse(this.ViewState["ObjectId"].ToString()));
FormDS.FormRow rowForm = this.FormSaleBLL.GetFormByID(formID)[0];
if (rowForm.IsProcIDNull()) {
ViewState["ProcID"] = "";
} else {
ViewState["ProcID"] = rowForm.ProcID;
}
this.FormNoCtl.Text = rowForm.FormNo;
AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
this.StuffNameCtl.Text = CommonUtility.GetStaffFullName(applicant);
this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;
if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null) {
this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
}
this.StuffNoCtl.Text = applicant.IsStuffNoNull() ? "" : applicant.StuffNo;
this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString();
this.ApplyFormNoCtl.Text = this.FormSaleBLL.GetFormByID(rowFormPayment.FormSaleApplyID)[0].FormNo;
FormDS.FormSaleApplyRow rowFormApply = this.FormSaleBLL.GetFormSaleApplyByID(rowFormPayment.FormSaleApplyID)[0];
this.PeriodCtl.Text = rowFormApply.FPeriod.ToString("yyyy-MM");
MasterData.CustomerRow customer = mdBLL.GetCustomerById(rowFormApply.CustomerID)[0];
this.CustomerNameCtl.Text = customer.CustomerName;
this.CustomerChannelCtl.Text = mdBLL.GetCustomerChannelById(customer.CustomerChannelID)[0].CustomerChannelName;
this.KATypeCtl.Text = customer.IsKaTypeNull() ? "" : customer.KaType;
this.CustomerRegionCtl.Text = mdBLL.GetCustomerRegionById(customer.CustomerRegionID).CustomerRegionName;
this.CityCtl.Text = customer.City;
this.BrandCtl.Text = mdBLL.GetBrandById(rowFormApply.BrandID)[0].BrandName;
MasterData.ExpenseSubCategoryRow rowExpenseSubCategory = mdBLL.GetExpenseSubCategoryById(rowFormApply.ExpenseSubCategoryID);
this.ExpenseCategoryCtl.Text = mdBLL.GetExpenseCategoryById(rowExpenseSubCategory.ExpenseCategoryID).ExpenseCategoryName;
this.ExpenseSubCategoryCtl.Text = rowExpenseSubCategory.ExpenseSubCategoryName;
this.CurrencyCtl.Text = mdBLL.GetCurrencyByID(rowFormApply.CurrencyID).CurrencyShortName;
this.ExchangeRateCtl.Text = rowFormApply.ExchangeRate.ToString();
this.ShopNameCtl.Text = rowFormApply.IsShopNameNull() ? "" : rowFormApply.ShopName;
this.ShopCountCtl.Text = rowFormApply.IsShopCountNull() ? "" : rowFormApply.ShopCount.ToString();
this.ProjectNameCtl.Text = rowFormApply.IsProjectNameNull() ? "" : rowFormApply.ProjectName;
this.CostCenterCtl.Text = CommonUtility.GetMAACostCenterFullName(rowForm.CostCenterID);
if (!rowFormApply.IsActivityBeginDateNull()) {
this.ActivityBeginCtl.Text = rowFormApply.ActivityBeginDate.ToString("yyyy-MM-dd");
}
if (!rowFormApply.IsActivityEndDateNull()) {
this.ActivityEndCtl.Text = rowFormApply.ActivityEndDate.ToString("yyyy-MM-dd");
}
this.ProjectDescCtl.Text = rowFormApply.IsProjectDescNull() ? "" : rowFormApply.ProjectDesc;
if (!rowFormApply.IsApplyFileNameNull())
this.UCFileUpload.AttachmentFileName = rowFormApply.ApplyFileName;
if (!rowFormApply.IsApplyRealFileNameNull())
this.UCFileUpload.RealAttachmentFileName = rowFormApply.ApplyRealFileName;
if (!rowFormPayment.IsRemarkNull()) {
this.RemarkCtl.Text = rowFormPayment.Remark;
}
if (!rowFormPayment.IsAttachedFileNameNull()) {
this.UCPaymentFile.AttachmentFileName = rowFormPayment.AttachedFileName;
}
if (!rowFormPayment.IsRealAttachedFileNameNull()) {
this.UCPaymentFile.RealAttachmentFileName = rowFormPayment.RealAttachedFileName;
}
this.InvoiceStatusCtl.Text = new InvoiceStatusTableAdapter().GetDataByID(rowFormPayment.InvoiceStatusID)[0].Name;
if (!rowFormPayment.IsVendorIDNull()) {
MasterData.VendorRow vendor = mdBLL.GetVendorByID(rowFormPayment.VendorID);
this.VendorCtl.Text = vendor.VendorName + "-" + vendor.VendorCode;
}
this.txtVatType.Text = mdBLL.GetVatTypeById(rowFormPayment.VatTypeID)[0].VatTypeName;
//PO
if (!rowFormPayment.IsFormPOIDNull()) {
FormDS.FormRow rowFormPO = this.FormSaleBLL.GetFormByID(rowFormPayment.FormPOID)[0];
this.hlPO.Text = rowFormPO.FormNo;
this.hlPO.NavigateUrl = CommonUtility.GetPOPostBackUrl(rowFormPO.FormID);
} else {
this.hlPO.Text = "无";
}
//历史单据
if (rowForm.IsRejectedFormIDNull()) {
lblRejectFormNo.Text = "无";
} else {
FormDS.FormRow rejectedForm = this.FormSaleBLL.GetFormByID(rowForm.RejectedFormID)[0];
this.lblRejectFormNo.Text = rejectedForm.FormNo;
this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/FormSale/NoActivityAdvancedPaymentApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
}
//明细
this.odsInvoice.SelectParameters["FormID"].DefaultValue = rowFormPayment.FormSalePaymentID.ToString();
this.odsPaymentDetails.SelectParameters["FormSalePaymentID"].DefaultValue = rowFormPayment.FormSalePaymentID.ToString();
//审批页面处理&按钮处理
AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
//.........这里部分代码省略.........
示例3: ExportSaleDataByFormID
//.........这里部分代码省略.........
//{
// logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:票扣的数据不导入!");
// return false;
//}
//if (l_drFormSalePayment.PaymentTypeID == 5)
//{
// logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:调整因子的数据不导入!");
// return false;
//}
FormDS.FormSalePaymentDetailDataTable l_dtFormSalePaymentDetail = formsalebll.GetFormSalePaymentDetailByPaymentID(FormID);
for (int i = 0; i < l_dtFormSalePaymentDetail.Rows.Count; i++) {
if (l_dtFormSalePaymentDetail[i].AmountRMB == Decimal.Zero) {
Count++;
continue;
}
//PurchaseDS.FormInvoiceDataTable l_dtFormInvoice = formPurchaseBLL.GetFormInvoiceByFormID(FormID);
ExportDataDS.ExportDataRow l_drExportData = l_dtExportData.NewExportDataRow();
l_drExportData.FormID = FormID;
l_drExportData.CompanyCode = l_drExportData.CompanyCode = masterdatabll.GetCompanyById(masterdatabll.GetVendorTypeById(masterdatabll.GetVendorByID(l_drFormSalePayment.VendorID).VendorTypeID).CompanyID).CompanyCode;
l_drExportData.VendorCode = masterdatabll.GetVendorByID(l_drFormSalePayment.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");
//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_drFormSalePayment.AmountBeforeTax;
//l_drExportData.Currency = masterdatabll.GetCurrencyByID(formsalebll.GetFormSaleApplyByID(l_dtFormSalePaymentDetail[i].FormSaleApplyID)[0].CurrencyID).CurrencyShortName;
//l_drExportData.ExchangeRate = formsalebll.GetFormSaleApplyByID(l_dtFormSalePaymentDetail[i].FormSaleApplyID)[0].ExchangeRate;
l_drExportData.ManageExpenseItem = masterdatabll.GetExpenseItemById(l_dtFormSalePaymentDetail[i].ExpenseItemID).ExpenseItemName;
//profit center取AccrualCode,如果没有报错
if (masterdatabll.GetCostCenterById(l_drform.CostCenterID).IsAccrualCodeNull()) {
logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:Profit Center Accrual Code为空,无法导出!");
return false;
} else {
l_drExportData.CostCenter = masterdatabll.GetCostCenterById(l_drform.CostCenterID).AccrualCode;
}
if (l_dtFormSalePaymentDetail[i].ApplyPeriod.AddMonths(5).Year == l_drform.SubmitDate.AddMonths(5).Year)
l_drExportData.AccountCode = masterdatabll.GetExpenseItemById(l_dtFormSalePaymentDetail[i].ExpenseItemID).AccrualAccountingCode;
else
l_drExportData.AccountCode = masterdatabll.GetExpenseItemById(l_dtFormSalePaymentDetail[i].ExpenseItemID).LastAccountingCode;
l_drExportData.DetailMoney = l_dtFormSalePaymentDetail[i].AmountBeforeTax;
//PO No 变为取报销单的PO的No
if (l_drFormSalePayment.IsFormPOIDNull()) {
//PurchaseDS.FormPODataTable formPO = formPurchaseBLL.GetFormPOByParentFormID(l_dtFormSalePaymentDetail[i].FormSaleApplyID);
//if (formPO.Rows.Count > 0) {
// l_drExportData.PONumber = formPO[0].BPCSPONo;
// PurchaseDS.FormPODetailDataTable formPODetail = formPurchaseBLL.GetPODetailByFormPOID(formPO[0].FormPOID);
// l_drExportData.POLineNumber = formPODetail.Rows.Count.ToString();
//} else {
l_drExportData.PONumber = 0;
l_drExportData.POLineNumber = "0";
//}
} else {
//若已选PO,取所选PO信息
PurchaseDS.FormPORow formPO = formPurchaseBLL.GetFormPOByID(l_drFormSalePayment.FormPOID);
PurchaseDS.FormPODetailDataTable formPODetail = formPurchaseBLL.GetPODetailByFormPOID(l_drFormSalePayment.FormPOID);
l_drExportData.PONumber = formPO.BPCSPONo;
l_drExportData.POLineNumber = formPODetail.Count.ToString();
}
l_drExportData.FormNo = l_drform.FormNo;
l_drExportData.FinanceRemark = l_drform.FinanceRemark;
l_drExportData.TaxRateCode = masterdatabll.GetVatTypeById(l_drFormSalePayment.VatTypeID)[0].VatTypeName;
l_drExportData.TaxAmt = l_dtFormSalePaymentDetail[i].TaxAmount;
l_dtExportData.AddExportDataRow(l_drExportData);
Count++;
}
if (l_dtExportData.Rows.Count == 0) {
logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:无明细数据,无法导出!");
return false;
}
if (l_dtFormSalePaymentDetail.Rows.Count == Count)
ExportByFormView(l_dtExportData);
else {
logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:明细数据数量不一致,无法导出!");
return false;
}
}
} catch (Exception e) {
logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:" + e.Message);
return false;
}
return true;
}
示例4: 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;
}
示例5: ExportPersonalReimburseDataByFormID
/// <summary>
/// 个人费用报销
/// </summary>
/// <param name="FormID"></param>
/// <returns></returns>
private bool ExportPersonalReimburseDataByFormID(int FormID, int logId)
{
ExportDataDS.ExportDataDataTable l_dtExportData = new ExportDataDS.ExportDataDataTable();
FormDS.FormPersonalReimburseDetailDataTable l_dtPersonalReimburseDetail = new FormDS.FormPersonalReimburseDetailDataTable();
FormMarketingBLL formmarkbll = new FormMarketingBLL();
FormTEBLL formtebll = new FormTEBLL();
StuffUserBLL stuffuserdll = new StuffUserBLL();
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_dtPersonalReimburseDetail = formtebll.GetFormPersonalReimburseDetailByFormPersonalReimburseID(l_drform.FormID);
int i = 0;
FormDS.FormPersonalReimburseDataTable l_dtPersonalReimburse = formtebll.GetFormPersonalReimburseByID(l_drform.FormID);
foreach (FormDS.FormPersonalReimburseDetailRow l_drtemp in l_dtPersonalReimburseDetail) {
ExportDataDS.ExportDataRow l_drExportData = l_dtExportData.NewExportDataRow();
l_drExportData.FormID = FormID;
l_drExportData.VendorCode = stuffuserdll.GetStuffUserById(l_drform.UserID)[0].VendorCode;
l_drExportData.CompanyCode = masterdatabll.GetCompanyById(masterdatabll.GetCostCenterById(l_drform.CostCenterID).CompanyID).CompanyCode;
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;
}
//如果Vendor Code的公司和成本中心的公司不一致,则报错
MasterData.VendorDataTable tbVendor = new BusinessObjects.MasterDataTableAdapters.VendorTableAdapter().GetDataByVendorCode(l_drExportData.VendorCode);
if (tbVendor.Rows.Count > 0) {
string vendorCompanyCode = masterdatabll.GetCompanyById(tbVendor[0].CompanyID).CompanyCode;
if (l_drExportData.CompanyCode != vendorCompanyCode) {
logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:Company Code不符,请检查!");
return false;
}
}
l_drExportData.Reference = "";
l_drExportData.Invoice = l_drform.FormNo;
l_drExportData.Invoicedate = l_drform.SubmitDate.ToString("yyyyMMdd");
l_drExportData.TotalMoney = l_dtPersonalReimburse[0].Amount;
//l_drExportData.Currency = masterdatabll.GetCurrencyByID(l_drtemp.CurrencyID).CurrencyShortName;
//l_drExportData.ExchangeRate = l_drtemp.ExchangeRate;
l_drExportData.ManageExpenseItem = masterdatabll.GetManageExpenseItemById(l_drtemp.ManageExpenseItemID).ManageExpenseItemName;
l_drExportData.CostCenter = masterdatabll.GetCostCenterById(l_drform.CostCenterID).CostCenterCode;
l_drExportData.AccountCode = masterdatabll.GetAccountingCodeByExpenseItemAndCostCenter(l_drtemp.ManageExpenseItemID, l_drform.CostCenterID);
l_drExportData.DetailMoney = l_drtemp.RMB;
l_drExportData.PONumber = 0;
l_drExportData.POLineNumber = "0";
l_drExportData.FinanceRemark = l_drform.FinanceRemark;
l_drExportData.FormNo = l_drform.FormNo;
l_drExportData.TaxRateCode = masterdatabll.GetVatTypeById(1)[0].VatTypeName;
l_drExportData.TaxAmt = 0;
l_dtExportData.AddExportDataRow(l_drExportData);
i++;
}
if (l_dtExportData.Rows.Count == 0) {
logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:无明细数据,无法导出!");
return false;
}
if (l_dtExportData.Rows.Count == l_dtPersonalReimburseDetail.Rows.Count) {
ExportByFormView(l_dtExportData);
} else {
logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:导出数据与明细数据数量不一致!");
return false;
}
}
} catch (Exception e) {
logbll.InsertExportLogDetail(logId, "单据编号:" + l_drform.FormNo + ",提交人:" + new StuffUserBLL().GetStuffUserById(l_drform.UserID)[0].StuffName + ",错误信息:" + e.Message);
return false;
}
return true;
}
示例6: ExportVendorAVM
/// <summary>
/// Vendor导出
/// </summary>
/// <param name="FormID"></param>
/// <returns></returns>
private bool ExportVendorAVM(MasterData.VendorRow vendor, int logId)
{
string BakPath = ConfigurationManager.AppSettings["ExportService.BakPath"];
FormVendorBLL formvendorbll = new FormVendorBLL();
MasterDataBLL masterdatabll = new MasterDataBLL();
try {
string FileName = ConfigurationManager.AppSettings["ExportService.VendorAVMFileName"];
string spit = "\t";
MasterData.PaymentTermRow paymentTerm = null;
MasterData.VendorTypeRow vendorType = null;
MasterData.CompanyRow company = null;
MasterData.CurrencyRow currency = null;
MasterData.MethodPaymentRow paymentType = null;
MasterData.VatTypeRow VatType = null;
MasterData.BankCodeRow bankCode = null;
MasterData.TransTypeRow transType = null;
MasterData.ACTypeRow acType = null;
paymentTerm = masterdatabll.GetPaymentTermById(vendor.PaymentTermID)[0];
vendorType = masterdatabll.GetVendorTypeById(vendor.VendorTypeID);
company = masterdatabll.GetCompanyById(vendor.CompanyID);
currency = masterdatabll.GetCurrencyByID(vendorType.CurrencyID);
paymentType = masterdatabll.GetMethodPaymentById(vendor.MethodPaymentID)[0];
VatType = masterdatabll.GetVatTypeById(vendor.VATTypeID)[0];
bankCode = masterdatabll.GetBankCodeById(vendor.BankCodeID)[0];
transType = masterdatabll.GetTransTypeById(vendor.TransTypeID)[0];
acType = masterdatabll.GetACTypeById(vendor.ACTypeID)[0];
string ActionName = "";
string content = "";
switch (vendor.ActionType) {
case 0:
ActionName = "D";
#region 删除
content =
"" + spit +
ActionName + spit +
"" + spit +
"VZ" + spit +
bSubstring(vendor.VendorCode, 5) + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
0 + spit +
0 + spit +
0 + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
0 + spit +
"" + spit +
"" + spit +
"" + spit +
0 + spit +
"" + spit +
0 + spit +
0 + spit +
0 + spit +
0 + spit +
0 + spit +
0 + spit +
"" + spit +
"" + spit +
0 + spit +
"" + spit +
"" + spit +
0 + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
0 + spit +
0 + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
0 + spit +
0 + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
"" + spit +
//.........这里部分代码省略.........
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
if (!this.IsPostBack) {
String title = this.GetLocalResourceObject("titleLabel.Text").ToString();
PageUtility.SetContentTitle(this.Page, title);
int formID = int.Parse(Request["ObjectId"]);
this.ViewState["ObjectId"] = formID;
PurchaseDS.FormRow rowForm = this.FormVendorBLL.GetFormByID(formID)[0];
PurchaseDS.FormVendorRow rowForVendor = this.FormVendorBLL.GetFormVendorByID(formID)[0];
if (rowForm.IsProcIDNull()) {
ViewState["ProcID"] = "";
} else {
ViewState["ProcID"] = rowForm.ProcID;
}
this.FormNoCtl.Text = rowForm.FormNo;
AuthorizationDS.StuffUserRow applicant = new AuthorizationBLL().GetStuffUserById(rowForm.UserID);
this.StuffNameCtl.Text = CommonUtility.GetStaffFullName(applicant);
this.PositionNameCtl.Text = new OUTreeBLL().GetPositionById(rowForm.PositionID).PositionName;
if (new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID) != null) {
this.DepartmentNameCtl.Text = new OUTreeBLL().GetOrganizationUnitById(rowForm.OrganizationUnitID).OrganizationUnitName;
}
this.StuffNoCtl.Text = applicant.IsStuffNoNull() ? "" : applicant.StuffNo;
this.AttendDateCtl.Text = applicant.AttendDate.ToShortDateString();
//历史单据
if (rowForm.IsRejectedFormIDNull()) {
lblRejectFormNo.Text = "无";
} else {
PurchaseDS.FormRow rejectedForm = this.FormVendorBLL.GetFormByID(rowForm.RejectedFormID)[0];
this.lblRejectFormNo.Text = rejectedForm.FormNo;
this.lblRejectFormNo.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/FormPurchase/FormVendorApproval.aspx?ShowDialog=1&ObjectId=" + rejectedForm.FormID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
}
PurchaseDS.FormVendorRow FormVendorTR = FormVendorBLL.GetFormVendorByID(formID)[0];
if (!FormVendorTR.IsVendorNameNull()) {
txtVendorName.Text = FormVendorTR.VendorName;
}
if (!FormVendorTR.IsVendorAddressNull()) {
txtVendorAddress.Text = FormVendorTR.VendorAddress;
}
if (!FormVendorTR.IsCityNull()) {
txtCity.Text = FormVendorTR.City;
}
if (!FormVendorTR.IsPostalNull()) {
txtPostal.Text = FormVendorTR.Postal;
}
if (!FormVendorTR.IsContactNameNull()) {
txtContactName.Text = FormVendorTR.ContactName;
}
MasterDataBLL masterDataBLL = new MasterDataBLL();
if (!FormVendorTR.IsVendorTypeIDNull()) {
this.VendorTypeControl.VendorTypeID = FormVendorTR.VendorTypeID.ToString();
MasterData.VendorTypeRow VendorTypeRow = masterDataBLL.GetVendorTypeById(FormVendorTR.VendorTypeID);
txtCurrency.Text = masterDataBLL.GetCurrencyByID(VendorTypeRow.CurrencyID).CurrencyFullName;
txtCompany.Text = masterDataBLL.GetCompanyById(VendorTypeRow.CompanyID).CompanyName;
txtCompanyCode.Text = masterDataBLL.GetCompanyById(VendorTypeRow.CompanyID).CompanyCode;
}
if (!FormVendorTR.IsPhoneNumberNull()) {
this.txtPhoneNumber.Text = FormVendorTR.PhoneNumber;
}
if (!FormVendorTR.IsOneTimeVendorNull()) {
this.txtOneTimeVendor.Text = FormVendorTR.OneTimeVendor ? "Y" : "N";
}
if (!FormVendorTR.IsHoldVendorNull()) {
this.txtHoldVendor.Text = FormVendorTR.HoldVendor ? "Y" : "N";
}
if (!FormVendorTR.IsPurchaseingPostalCodeNull()) {
this.txtPurchaseingPostalCode.Text = FormVendorTR.PurchaseingPostalCode;
}
if (!FormVendorTR.IsAlphaSearchKeyNull()) {
this.txtAlphaSearchKey.Text = FormVendorTR.AlphaSearchKey;
}
if (!FormVendorTR.IsPurchasingCityNull()) {
this.txtPurchasingCity.Text = FormVendorTR.PurchasingCity;
}
if (!FormVendorTR.IsPurchasingContactNull()) {
this.txtPurchasingContact.Text = FormVendorTR.PurchasingContact;
}
if (!FormVendorTR.IsPurchasingAddressNull()) {
this.txtPurchasingAddress.Text = FormVendorTR.PurchasingAddress;
}
if (!FormVendorTR.IsPurchasePhoneNumberNull()) {
this.txtPurchasePhoneNumber.Text = FormVendorTR.PurchasePhoneNumber;
}
if (!FormVendorTR.IsBankCodeNull()) {
this.txtBankCode.Text = FormVendorTR.BankCode;
}
if (!FormVendorTR.IsMethodPaymentIDNull()) {
this.txtMethodPayment.Text = masterDataBLL.GetMethodPaymentById(FormVendorTR.MethodPaymentID)[0].MethodPaymentName;
}
if (!FormVendorTR.IsPaymentTermIDNull()) {
this.txtPaymentTerm.Text = masterDataBLL.GetPaymentTermById(FormVendorTR.PaymentTermID)[0].PaymentTermName;
}
if (!FormVendorTR.IsTransTypeIDNull()) {
this.txtTransType.Text = masterDataBLL.GetTransTypeById(FormVendorTR.TransTypeID)[0].TransTypeName;
}
if (!FormVendorTR.IsVATTypeIDNull()) {
txtVATRate.Text = masterDataBLL.GetVatTypeById(FormVendorTR.VATTypeID)[0].VatTypeName;
//.........这里部分代码省略.........