Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            string redirectUrl = string.Format("{0}Funds/ReceivableList.aspx", NFMT.Common.DefaultValue.NftmSiteName);
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

            if (!IsPostBack)
            {
                this.navigation1.Routes.Add("收款登记", redirectUrl);
                this.navigation1.Routes.Add("收款登记明细", string.Empty);

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

                this.hidid.Value = receivableId.ToString();

                NFMT.Funds.BLL.ReceivableBLL bll = new NFMT.Funds.BLL.ReceivableBLL();
                NFMT.Common.ResultModel result = bll.Get(user, receivableId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                receivable = result.ReturnValue as NFMT.Funds.Model.Receivable;
                if (receivable != null)
                {
                    this.dtReceiveDate.InnerText = receivable.ReceiveDate.ToShortDateString();

                    NFMT.User.Model.Corporation innerCorp = NFMT.User.UserProvider.Corporations.SingleOrDefault(a => a.CorpId == receivable.ReceivableCorpId);
                    this.ddlReceivableCorpId.InnerText = innerCorp.CorpName;

                    NFMT.Data.Model.Bank recebank = NFMT.Data.BasicDataProvider.Banks.SingleOrDefault(a => a.BankId == receivable.ReceivableBank);
                    this.ddlReceivableBank.InnerText = recebank.BankName;

                    NFMT.Data.Model.BankAccount receAccount = NFMT.Data.BasicDataProvider.BankAccounts.SingleOrDefault(a => a.BankAccId == receivable.ReceivableAccoontId);
                    this.ddlReceivableAccoontId.InnerText = receAccount.AccountNo;

                    this.nbPayBala.InnerText = receivable.PayBala.ToString();

                    NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(a => a.CurrencyId == receivable.CurrencyId);
                    this.ddlCurrencyId.InnerText = currency.CurrencyName;

                    this.ddlPayCorpId.InnerText = receivable.PayCorpName;

                    this.ddlPayBankId.InnerText = receivable.PayBank;

                    this.ddlPayAccountId.InnerText = receivable.PayAccount;

                    this.txbPayWord.InnerText = receivable.PayWord;

                    this.txtBankLog.InnerText = receivable.BankLog;

                    string json = serializer.Serialize(receivable);
                    this.hidModel.Value = json;
                }
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            string redirectUrl = string.Format("{0}Funds/ReceivableList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            if (!IsPostBack)
            {
                this.navigation1.Routes.Add("收款登记", redirectUrl);
                this.navigation1.Routes.Add("收款登记修改", string.Empty);

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

                this.hidid.Value = receivableId.ToString();

                NFMT.Funds.BLL.ReceivableBLL bll = new NFMT.Funds.BLL.ReceivableBLL();
                NFMT.Common.ResultModel result = bll.Get(user, receivableId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Funds.Model.Receivable receivable = result.ReturnValue as NFMT.Funds.Model.Receivable;
                if (receivable != null)
                {
                    this.curReceivable = receivable;
                    //this.hidReceiveDate.Value = receivable.ReceiveDate.ToShortDateString();
                    ////NFMT.User.Model.Corporation innerCorp = NFMT.User.UserProvider.Corporations.SingleOrDefault(a => a.CorpId == receivable.ReceivableCorpId);
                    //this.hidReceivableCorpId.Value = receivable.ReceivableCorpId.ToString();
                    ////NFMT.Data.Model.Bank recebank = NFMT.Data.BasicDataProvider.Banks.SingleOrDefault(a => a.BankId == receivable.ReceivableBank);
                    //this.hidReceivableBank.Value = receivable.ReceivableBank.ToString();
                    ////NFMT.Data.Model.BankAccount receAccount = NFMT.Data.BasicDataProvider.BankAccounts.SingleOrDefault(a => a.BankAccId == receivable.ReceivableAccoontId);
                    //this.hidReceivableAccoontId.Value = receivable.ReceivableAccoontId.ToString();
                    //this.hidPayBala.Value = receivable.PayBala.ToString();
                    //this.hidCurrencyId.Value = receivable.CurrencyId.ToString();
                    //this.hidPayCorpId.Value = receivable.PayCorpId.ToString();
                    //this.hidPayBankId.Value = receivable.PayBankId.ToString();
                    //this.hidPayAccountId.Value = receivable.PayAccountId.ToString();
                    //this.txbPayWord.Value = receivable.PayWord;
                    //this.txtBankLog.Value = receivable.BankLog;
                    //this.txtPayAccount.Value = receivable.PayAccount;
                    //this.txtPayBank.Value = receivable.PayBank;
                    //this.txtPayCorp.Value = receivable.PayCorpName;
                }
            }
        }