protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 117, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

                this.navigation1.Routes.Add("财务发票列表", "FinanceInvoiceList.aspx");
                this.navigation1.Routes.Add("财务发票修改", string.Empty);
                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                int fundsInvoiceId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out fundsInvoiceId))
                    Response.Redirect("FinanceInvoiceList.aspx");

                //获取财务发票
                NFMT.Invoice.BLL.FinanceInvoiceBLL financeInvoiceBLL = new NFMT.Invoice.BLL.FinanceInvoiceBLL();
                result = financeInvoiceBLL.Get(user, fundsInvoiceId);
                if (result.ResultStatus != 0)
                    Response.Redirect("FinanceInvoiceList.aspx");
                NFMT.Invoice.Model.FinanceInvoice fundsInvoice = result.ReturnValue as NFMT.Invoice.Model.FinanceInvoice;
                if (fundsInvoice == null || fundsInvoice.FinanceInvoiceId <= 0)
                    Response.Redirect("FinanceInvoiceList.aspx");

                this.curFundsInvoice = fundsInvoice;

                //获取主发票信息
                NFMT.Operate.BLL.InvoiceBLL invoiceBLL = new NFMT.Operate.BLL.InvoiceBLL();
                result = invoiceBLL.Get(user, fundsInvoice.InvoiceId);
                if (result.ResultStatus != 0)
                    Response.Redirect("FinanceInvoiceList.aspx");
                NFMT.Operate.Model.Invoice invoice = result.ReturnValue as NFMT.Operate.Model.Invoice;
                if (invoice == null || invoice.InvoiceId <= 0)
                    Response.Redirect("FinanceInvoiceList.aspx");

                this.curInvoice = invoice;

                NFMT.Invoice.BLL.FinBusInvAllotDetailBLL finBusInvAllotDetailBLL = new NFMT.Invoice.BLL.FinBusInvAllotDetailBLL();
                result = finBusInvAllotDetailBLL.GetBIds(user, fundsInvoice.FinanceInvoiceId);
                if (result.ResultStatus != 0)
                    Response.Redirect("FinanceInvoiceList.aspx");

                this.hidsids.Value = result.ReturnValue.ToString();

                string dirStr = "开出";
                if (invoice.InvoiceDirection == 34)
                {
                    dirStr = "收入";
                    outSelf = 0;
                    inSelf = 1;
                }
                invoiceDirection = invoice.InvoiceDirection;
                //title init
                this.titInvDate.InnerHtml = string.Format("{0}日期:", dirStr);

                //attach
                this.attach1.BusinessIdValue = this.curInvoice.InvoiceId;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 90, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.提交审核, NFMT.Common.OperateEnum.作废, NFMT.Common.OperateEnum.撤返, NFMT.Common.OperateEnum.执行完成, NFMT.Common.OperateEnum.执行完成撤销 });

                string redirectUrl = string.Format("{0}Invoice/FinBusInvAllotList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

                this.navigation1.Routes.Add("财务发票分配", redirectUrl);
                this.navigation1.Routes.Add("财务发票分配明细", string.Empty);

                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                allotId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out allotId) || allotId <= 0)
                    Response.Redirect(redirectUrl);

                NFMT.Invoice.BLL.FinBusInvAllotBLL finBusInvAllotBLL = new NFMT.Invoice.BLL.FinBusInvAllotBLL();
                result = finBusInvAllotBLL.GetFinanceInvoiceId(user, allotId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                int fundsInvoiceId = (int)result.ReturnValue;

                NFMT.Invoice.BLL.FinBusInvAllotDetailBLL finBusInvAllotDetailBLL = new NFMT.Invoice.BLL.FinBusInvAllotDetailBLL();
                result = finBusInvAllotDetailBLL.GetJson(user, allotId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                this.hidJson.Value = Newtonsoft.Json.JsonConvert.SerializeObject(dt);

                if (dt != null && dt.Rows.Count > 0)
                {
                    foreach (System.Data.DataRow dr in dt.Rows)
                    {
                        bIds += dr["BusinessInvoiceId"].ToString() + ",";
                    }
                }
                if (!string.IsNullOrEmpty(bIds) && bIds.IndexOf(",") > -1)
                    bIds = bIds.Substring(0, bIds.Length - 1);

                //获取财务发票
                NFMT.Invoice.BLL.FinanceInvoiceBLL financeInvoiceBLL = new NFMT.Invoice.BLL.FinanceInvoiceBLL();
                result = financeInvoiceBLL.Get(user, fundsInvoiceId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Invoice.Model.FinanceInvoice fundsInvoice = result.ReturnValue as NFMT.Invoice.Model.FinanceInvoice;
                if (fundsInvoice == null || fundsInvoice.FinanceInvoiceId <= 0)
                    Response.Redirect(redirectUrl);

                this.curFundsInvoice = fundsInvoice;

                //获取主发票信息
                NFMT.Operate.BLL.InvoiceBLL invoiceBLL = new NFMT.Operate.BLL.InvoiceBLL();
                result = invoiceBLL.Get(user, fundsInvoice.InvoiceId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Operate.Model.Invoice invoice = result.ReturnValue as NFMT.Operate.Model.Invoice;
                if (invoice == null || invoice.InvoiceId <= 0)
                    Response.Redirect(redirectUrl);

                this.curInvoice = invoice;

                string dirStr = "开出";
                if (invoice.InvoiceDirection == 34)
                {
                    dirStr = "收入";
                    outSelf = 0;
                    inSelf = 1;
                }
                invoiceDirection = invoice.InvoiceDirection;
                //title init
                this.titInvDate.InnerHtml = string.Format("{0}日期:", dirStr);

                NFMT.Data.Model.Currency cur = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(a => a.CurrencyId == this.curInvoice.CurrencyId);
                if (cur != null)
                    currencyName = cur.CurrencyName;

                //获取财务发票已分配金额
                result = financeInvoiceBLL.GetAllotAmount(user, fundsInvoiceId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                allotAmount = (decimal)result.ReturnValue;

                result = finBusInvAllotBLL.Get(user, allotId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                finBusInvAllot = result.ReturnValue as NFMT.Invoice.Model.FinBusInvAllot;
                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                string json = serializer.Serialize(finBusInvAllot);
                this.hidModel.Value = json;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string redirectUrl = "FinanceInvoiceList.aspx";

                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 117, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

                this.navigation1.Routes.Add("财务发票列表", redirectUrl);
                this.navigation1.Routes.Add("财务发票修改", string.Empty);
                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                finInvoiceId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out finInvoiceId))
                    this.WarmAlert("参数错误", redirectUrl);

                //获取财务票
                NFMT.Invoice.BLL.FinanceInvoiceBLL financeInvoiceBLL = new NFMT.Invoice.BLL.FinanceInvoiceBLL();
                result = financeInvoiceBLL.Get(user, finInvoiceId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                curFundsInvoice = result.ReturnValue as NFMT.Invoice.Model.FinanceInvoice;
                if (curFundsInvoice == null || curFundsInvoice.FinanceInvoiceId <= 0)
                    this.WarmAlert("获取财务票误错", redirectUrl);

                //获取发票
                NFMT.Operate.BLL.InvoiceBLL invoiceBLL = new NFMT.Operate.BLL.InvoiceBLL();
                result = invoiceBLL.Get(user, curFundsInvoice.InvoiceId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                curInvoice = result.ReturnValue as NFMT.Operate.Model.Invoice;
                if (curInvoice == null || curInvoice.InvoiceId <= 0)
                    this.WarmAlert("获取发票误错", redirectUrl);

                //获取开票申请ID
                NFMT.Invoice.BLL.InvoiceApplyFinanceBLL invoiceApplyFinanceBLL = new NFMT.Invoice.BLL.InvoiceApplyFinanceBLL();
                result = invoiceApplyFinanceBLL.GetInvApplyIdByFinInvId(user, finInvoiceId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                invoiceApplyId = (int)result.ReturnValue;

                //获取下方的id
                NFMT.Invoice.BLL.InvoiceApplyBLL invoiceApplyBLL = new NFMT.Invoice.BLL.InvoiceApplyBLL();
                result = invoiceApplyBLL.GetBIidsByInvApplyIdExceptFinInvoice(user, invoiceApplyId, finInvoiceId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);
                this.hiddownIds.Value = result.ReturnValue == null ? "" : result.ReturnValue.ToString();

                //获取上方的id
                NFMT.Invoice.BLL.FinBusInvAllotDetailBLL finBusAllotDetailBLL = new NFMT.Invoice.BLL.FinBusInvAllotDetailBLL();
                result = finBusAllotDetailBLL.GetBIds(user, finInvoiceId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);
                this.hidupIds.Value = result.ReturnValue.ToString();

                string dirStr = "开出";
                this.titInvDate.InnerHtml = string.Format("{0}日期:", dirStr);
                this.attach1.BusinessIdValue = this.curInvoice.InvoiceId;
            }
        }