Beispiel #1
0
    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;
        }
    }
Beispiel #2
0
        /// <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 +
                           "" + spit +
                           "" + "\r\n";
                        #endregion
                        break;
                    case 1:
                        ActionName = "A";
                        #region 新增
                        content =
                           "" + spit +
                           ActionName + spit +
                           (vendor.IsActive ? "A" : "D") + spit +
                           (vendor.IsActive ? "VM" : "VZ") + spit +
                           bSubstring(vendor.VendorCode, 5) + spit +
                           bSubstring(vendor.VendorName, 28) + spit +
                           bSubstring(vendor.VendorAddress, 28) + spit +
                           SpitVendorAddress(vendor.VendorAddress) + spit +
                           bSubstring(vendor.City, 17) + spit +
                           "" + spit +
                           bSubstring(vendor.Postal, 9) + spit +
                           bSubstring(paymentTerm.PaymentTermName, 2) + spit +
                           bSubstring(vendorType.VendorTypeName, 4) + spit +
                           bSubstring(vendor.VendorCode, 5) + spit +
                           0 + spit +
                           0 + spit +
                           "" + spit +
                           "N" + spit +
                           "" + spit +
                           bSubstring(vendor.PhoneNumber, 15) + spit +
                           bSubstring(company.CompanyCode, 2) + spit +
                           bSubstring(currency.CurrencyShortName, 3) + spit +
                           bSubstring(paymentType.MethodPaymentName, 1) + spit +
                           (vendor.OneTimeVendor ? "Y" : "N") + spit +
                           0 + spit +
                           (vendor.HoldVendor ? "Y" : "N") + spit +
                           0 + spit +
                           0 + spit +
                           0 + spit +
                           0 + spit +
                           0 + spit +
                           0 + spit +
                           "N" + spit +
                           bSubstring(vendor.AlphaSearchKey, 10) + spit +
                           0 + spit +
                           bSubstring(vendor.ContactName, 30) + spit +
                           "" + spit +
                           0 + spit +
                           bSubstring(vendor.PurchasingAddress, 28) + spit +
                           SpitVendorAddress(vendor.PurchasingAddress) + spit +
                           bSubstring(vendor.PurchasingCity, 28) + spit +
                           "" + spit +
                           bSubstring(vendor.PurchaseingPostalCode, 9) + spit +
                           bSubstring(vendor.PurchasingContact, 30) + spit +
                           "" + spit +
                           0 + spit +
                           0 + spit +
                           "N" + spit +
                           bSubstring(vendor.PurchasePhoneNumber, 15) + spit +
                           "" + spit +
                           "" + spit +
                           bSubstring(VatType.VatTypeName, 5) + spit +
                           "" + spit +
                           "" + spit +
                           0 + spit +
                           0 + spit +
                           "" + spit +
                           "" + spit +
                           "" + spit +
                           "" + spit +
                           "" + spit +
                           "" + spit +
                           0 + "\r\n";
                        #endregion
                        break;
                    case 2:
                        ActionName = "U";
                        #region 修改
                        QueryDS.FormVendorViewDataTable l_dtformvendor = formvendorbll.GetApproveFormVendorByVendorID(vendor.VendorID);
                        if (l_dtformvendor.Rows.Count > 1) {

                            QueryDS.FormVendorViewRow l_drformvendor = l_dtformvendor[1];
                            content =
                               "" + spit +
                               ActionName + spit +
                               "" + spit +
                               (vendor.IsActive ? "VM" : "VZ") + spit +
                               bSubstring(vendor.VendorCode, 5) + spit +
                               (bSubstring(vendor.VendorName, 28) == bSubstring(l_drformvendor.VendorName, 28) ? "" : bSubstring(vendor.VendorName, 28)) + spit +
                               (bSubstring(vendor.VendorAddress, 28) == bSubstring(l_drformvendor.VendorAddress, 28) ? "" : vendor.VendorAddress) + spit +
                               (SpitVendorAddress(vendor.VendorAddress) == SpitVendorAddress(l_drformvendor.VendorAddress) ? "" : SpitVendorAddress(vendor.VendorAddress)) + spit +
                               (bSubstring(vendor.City, 17) == bSubstring(l_drformvendor.City, 17) ? "" : bSubstring(vendor.City, 17)) + spit +
                               "" + spit +
                               (bSubstring(vendor.Postal, 9) == bSubstring(l_drformvendor.Postal, 9) ? "" : bSubstring(vendor.Postal, 9)) + spit +
                              bSubstring(l_drformvendor.MethodPaymentID == vendor.MethodPaymentID ? "" : paymentTerm.PaymentTermName, 2) + spit +
                               bSubstring(vendor.VendorTypeID == l_drformvendor.VendorTypeID ? "" : vendorType.VendorTypeName, 4) + spit +
                               0 + spit +
                               0 + spit +
                               0 + spit +
                               "" + spit +
                               "" + spit +
                               "" + spit +
                               (bSubstring(vendor.PhoneNumber, 15) == bSubstring(l_drformvendor.PhoneNumber, 15) ? "" : bSubstring(vendor.PhoneNumber, 15)) + spit +
                               (bSubstring(company.CompanyCode, 2) == bSubstring(l_drformvendor.CompanyCode, 2) ? "0" : bSubstring(company.CompanyCode, 2)) + spit +
                               (bSubstring(currency.CurrencyShortName, 3) == bSubstring(l_drformvendor.CurrencyShortName, 3) ? "" : bSubstring(currency.CurrencyShortName, 3)) + spit +
                               bSubstring(l_drformvendor.MethodPaymentID == vendor.MethodPaymentID ? "" : paymentType.MethodPaymentName, 1) + spit +
                               (vendor.OneTimeVendor == l_drformvendor.OneTimeVendor ? "" : (vendor.OneTimeVendor ? "Y" : "N")) + spit +
                               0 + spit +
                               (vendor.HoldVendor == l_drformvendor.HoldVendor ? "" : (vendor.HoldVendor ? "Y" : "N")) + spit +
                               0 + spit +
                               0 + spit +
                               0 + spit +
                               0 + spit +
                               0 + spit +
                               0 + spit +
                               "" + spit +
                               (bSubstring(vendor.AlphaSearchKey, 10) == bSubstring(l_drformvendor.AlphaSearchKey, 10) ? "" : bSubstring(vendor.AlphaSearchKey, 10)) + spit +
                               0 + spit +
                               (bSubstring(vendor.ContactName, 30) == bSubstring(l_drformvendor.ContactName, 30) ? "" : bSubstring(vendor.ContactName, 30)) + spit +
                               "" + spit +
                               0 + spit +
                               (bSubstring(vendor.PurchasingAddress, 28) == bSubstring(l_drformvendor.PurchasingAddress, 28) ? "" : bSubstring(vendor.PurchasingAddress, 28)) + spit +
                               (SpitVendorAddress(vendor.PurchasingAddress) == SpitVendorAddress(l_drformvendor.PurchasingAddress) ? "" : SpitVendorAddress(vendor.PurchasingAddress)) + spit +
                              (bSubstring(vendor.PurchasingCity, 28) == bSubstring(l_drformvendor.PurchasingCity, 28) ? "" : bSubstring(vendor.PurchasingCity, 28)) + spit +
                               "" + spit +
                               (bSubstring(vendor.PurchaseingPostalCode, 9) == bSubstring(l_drformvendor.PurchaseingPostalCode, 9) ? "" : bSubstring(vendor.PurchaseingPostalCode, 9)) + spit +
                               (bSubstring(vendor.PurchasingContact, 30) == bSubstring(l_drformvendor.PurchasingContact, 30) ? "" : bSubstring(vendor.PurchasingContact, 30)) + spit +
                               "" + spit +
                               0 + spit +
                               0 + spit +
                               "" + spit +
                               (bSubstring(vendor.PurchasePhoneNumber, 15) == bSubstring(l_drformvendor.PurchasePhoneNumber, 15) ? "" : bSubstring(vendor.PurchasePhoneNumber, 15)) + spit +
                               "" + spit +
                               "" + spit +
                               bSubstring(l_drformvendor.VATTypeID == vendor.VATTypeID ? "" : VatType.VatTypeName, 5) + spit +
                               "" + spit +
                               "" + spit +
                               0 + spit +
                               0 + spit +
                               "" + spit +
                               "" + spit +
                               "" + spit +
                               "" + spit +
                               "" + spit +
                               "" + spit +
                               "" + "\r\n";
                        } else {
                            logbll.InsertExportLogDetail(logId, "未找到Vendor历史数据!");
                        }
                        #endregion
                        break;
                    case 3:
                        ActionName = "R";
                        #region 重新激活
                        content =
                           "" + spit +
                           ActionName + spit +
                           "" + spit +
                           "VM" + 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 +
                           "" + spit +
                           "" + "\r\n";
                        #endregion
                        break;
                }
                content = content.Replace("\r", "").Replace("\n", "") + "\r\n";
                File.AppendAllText(path + FileName, content, Encoding.Default);
                File.AppendAllText(BakPath + DateTime.Now.ToString("yyyyMMddhhmmss") + FileName, content, Encoding.Default);
                UpdateVendorbyID(vendor.VendorID);
            } catch (Exception e) {
                logbll.InsertExportLogDetail(logId, "VendorCode:" + vendor.VendorCode + ",VendorName:" + vendor.VendorName + "" + ",错误信息:" + e.Message);
                return false;
            }
            return true;
        }
Beispiel #3
0
        private bool ExportVendorAVMX(MasterData.VendorRow vendor, int logId)
        {
            string BakPath = ConfigurationManager.AppSettings["ExportService.BakPath"];
            try {
                string FileName = ConfigurationManager.AppSettings["ExportService.VendorAVMXFileName"];
                string spit = "\t";
                MasterDataBLL masterdatabll = new MasterDataBLL();
                MasterData.CurrencyRow currency = null;
                MasterData.VendorTypeRow vendorType = null;
                MasterData.TransTypeRow transType = null;
                MasterData.BankCodeRow bankCode = null;
                MasterData.ACTypeRow acType = null;
                vendorType = masterdatabll.GetVendorTypeById(vendor.VendorTypeID);
                currency = masterdatabll.GetCurrencyByID(vendorType.CurrencyID);

                if (!vendor.IsBankCodeIDNull()) {
                    MasterData.BankCodeDataTable tbBankCode = masterdatabll.GetBankCodeById(vendor.BankCodeID);
                    bankCode = tbBankCode[0];
                    if (bankCode.BankCode.Equals("999")) {
                        throw new Exception("BankCode为999不导出!");
                    }
                }

                if (!vendor.IsTransTypeIDNull()) {
                    MasterData.TransTypeDataTable tbTransType = masterdatabll.GetTransTypeById(vendor.TransTypeID);
                    transType = tbTransType[0];
                }

                if (!vendor.IsACTypeIDNull()) {
                    MasterData.ACTypeDataTable tbACType = masterdatabll.GetACTypeById(vendor.ACTypeID);
                    acType = masterdatabll.GetACTypeById(vendor.ACTypeID)[0];
                }
                if (vendor.IsAccountNoNull()) {
                    throw new Exception("银行账号为空的不导出!");
                }

                string content =
                   (vendor.IsActive ? "VM" : "VZ") + spit +
                       bSubstring(vendor.VendorCode, 5) + spit +
                       bSubstring(currency.CurrencyShortName, 3) + spit +
                       bSubstring(bankCode.BankCode, 3) + spit +
                       bSubstring(transType == null ? "" : transType.TransTypeName, 2) + spit +
                       bSubstring(vendor.IsBankNameNull() ? "" : vendor.BankName, 68) + spit +
                       bSubstring(vendor.IsAccountNoNull() ? "" : vendor.AccountNo, 32) + spit +
                       bSubstring(vendor.VendorName, 58) + spit +
                       bSubstring(acType == null ? "" : acType.ACTypeName, 1) + spit +
                       0 + spit +
                       bSubstring(vendor.IsBankNoNull() ? "" : vendor.BankNo, 11);
                content = content.Replace("\r", "").Replace("\n", "") + "\r\n";
                File.AppendAllText(path + FileName, content, Encoding.Default);
                File.AppendAllText(BakPath + DateTime.Now.ToString("yyyyMMddhhmmss") + FileName, content, Encoding.Default);
            } catch (Exception e) {
                logbll.InsertExportLogDetail(logId, "VendorCode:" + vendor.VendorCode + ",VendorName:" + vendor.VendorName + "" + ",错误信息:" + e.Message);
                return false;
            }
            return true;
        }
    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;
            }
            if (!FormVendorTR.IsBankNameNull()) {
                txtBankName.Text = FormVendorTR.BankName.ToString();
            }
            if (!FormVendorTR.IsAccountNoNull()) {
                txtAccountNo.Text = FormVendorTR.AccountNo;
            }
            if (!FormVendorTR.IsBankNoNull()) {
                this.txtBankNo.Text = FormVendorTR.BankNo;
            }
            if (!FormVendorTR.IsACTypeIDNull()) {
                this.txtACType.Text = masterDataBLL.GetACTypeById(FormVendorTR.ACTypeID)[0].ACTypeName;
            }
            if (!FormVendorTR.IsAttachmentFileNameNull()) {
                this.UCFileUpload.AttachmentFileName = FormVendorTR.AttachmentFileName;
                this.UCFileUpload.RealAttachmentFileName = FormVendorTR.RealAttachmentFileName;
            }
            if (!FormVendorTR.IsModifyReasonNull()) {
                this.txtModifyReason.Text = FormVendorTR.ModifyReason;
            }
            if (!FormVendorTR.IsRemarkNull()) {
                this.txtRemark.Text = FormVendorTR.Remark;
            }
            //通过判断FormVendor有没有VendorID,判断是新增还是修改Vendor
            if (!FormVendorTR.IsVendorIDNull()) {
                this.ViewState["VendorID"] = FormVendorTR.VendorID;
            }
            if (FormVendorTR.ActionType != (int)SystemEnums.VendorActionType.Add) {
                this.trModifyReason.Visible = true;
            }

            //是新增还是修改
            this.ViewState["ActionType"] = FormVendorTR.ActionType;
            this.txtActionType.Text = CommonUtility.GetVendorActionTypeName(FormVendorTR.ActionType);

            //Vendor
            if (!FormVendorTR.IsVendorIDNull()) {
                hlVendor.Text = new MasterDataBLL().GetVendorByID(FormVendorTR.VendorID).VendorCode;
                hlVendor.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/Dialog/VendorDetail.aspx?ShowDialog=1&VendorID=" + FormVendorTR.VendorID + "','', 'dialogWidth:1000px;dialogHeight:750px;resizable:yes;')";
            } else {
                hlVendor.Text = "无";
            }

            //审批页面处理&按钮处理
            AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
            this.ViewState["StuffUserID"] = stuffUser.StuffUserId;
            if (rowForm.InTurnUserIds.Contains("P" + stuffUser.StuffUserId + "P")) {
                this.SubmitBtn.Visible = true;
                this.cwfAppCheck.IsView = false;
                this.ViewState["IsView"] = false;
            } else {
                this.SubmitBtn.Visible = false;
                this.cwfAppCheck.IsView = true;
                this.ViewState["IsView"] = true;
            }

            if (rowForm.StatusID == (int)SystemEnums.FormStatus.Rejected && stuffUser.StuffUserId == rowForm.UserID) {
                this.EditBtn.Visible = true;
                this.ScrapBtn.Visible = true;
            } else {
                this.EditBtn.Visible = false;
                this.ScrapBtn.Visible = false;
            }

            //如果是弹出,取消按钮不可见
            if (this.Request["ShowDialog"] != null) {
                if (this.Request["ShowDialog"].ToString() == "1") {
                    this.upButton.Visible = false;
                    this.Master.FindControl("divMenu").Visible = false;
                    this.Master.FindControl("tbCurrentPage").Visible = false;
                }
            }

            //是否有修改VendorType的权限
            int opManageId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.VendorTypeModify, SystemEnums.OperateEnum.Manage);
            AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow)this.Session["Position"];
            PositionRightBLL positionRightBLL = new PositionRightBLL();
            if (rowForm.StatusID == (int)SystemEnums.FormStatus.Awaiting && positionRightBLL.CheckPositionRight(position.PositionId, opManageId)) {
                this.VendorTypeControl.IsVisible = "inline";
                this.btnSave.Visible = true;
            } else {
                this.VendorTypeControl.IsVisible = "none";
                this.btnSave.Visible = false;
            }
        }
        this.cwfAppCheck.FormID = (int)this.ViewState["ObjectId"];
        this.cwfAppCheck.ProcID = this.ViewState["ProcID"].ToString();
        this.cwfAppCheck.IsView = (bool)this.ViewState["IsView"];
    }