protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dpLogDate.Value = DateTime.Now.ToString("yyyy-MM"); var department = EnterpriseService.GetDepartmentById(this.DepartmentId); if (department != null) { lbDepartmentName.Text = department.DepName; } loadData(this.Id); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (this.EditType != "" && this.EditType == "ClaimSalePerson") { initControl(); } loadDate(); if (Id != -1) { var Info = base.XMFinancialCapitalFlowService.GetXMFinancialCapitalFlowByID(Id); if (Info != null) { this.txtDate.Value = ((DateTime)Info.Date).ToString("yyyy-MM-dd"); this.txtPerson.Text = Info.AssociatedPerson; var department = EnterpriseService.GetDepartmentById((int)Info.DepartmentID); if (department == null) { ddlBelongingCompany.SelectedValue = "0"; } else { ddlBelongingCompany.SelectedValue = department.EnterpriseID.ToString(); } ddlBelongingCompany_SelectedIndexChanged(sender, e); this.ddlBelongingDep.SelectedValue = Info.DepartmentID.ToString(); ddlBelongingDep_SelectedIndexChanged(sender, e); if (Info.BelongingProjectID != null) { this.ddlBelongingProject.SelectedValue = Info.BelongingProjectID.ToString(); } this.ddlPaymentCollectionType.SelectedValue = Info.PaymentCollectionType.ToString(); this.txtAmount.Text = Info.Amount.ToString(); ReceivablesValue = GetCodeName(Info.ReceivablesType.ToString(), 224); BudgetValue = GetBudgetSettingName(Info.BudgetType.ToString()); FinancialValue = Info.IsIncome == true ? "1" : "0"; this.txtAbstract.Text = Info.Abstract.ToString(); this.txtRemark.Text = Info.Remark.ToString(); } } } }