protected void OnDataTextChanged1(object sender, EventArgs e) { UserControls_BudgetSalesFeeViewControl uc = (UserControls_BudgetSalesFeeViewControl)this.fvBudgetAllocationInDetails.FindControl("UCBudgetSales"); FormDS.BudgetSalesFeeViewRow row = this.BudgetAllocationApplyBLL.GetBudgetSalesFeeViewRowById(int.Parse(uc.BudgetSalesFeeId.ToString())); TextBox temp = (TextBox)this.fvBudgetAllocationInDetails.FindControl("txtExpenseTypeName"); //temp.Text = row.ExpenseItemName; temp.Text = GetExpenseItemNameByID(row.ExpenseItemID); temp = (TextBox)this.fvBudgetAllocationInDetails.FindControl("txtPeriod"); temp.Text = row.Period.ToString("yyyy/MM"); temp = (TextBox)this.fvBudgetAllocationInDetails.FindControl("txtOriginalBudget"); temp.Text = row.OriginalBudget.ToString(); temp = (TextBox)this.fvBudgetAllocationInDetails.FindControl("txtNormalBudget"); temp.Text = row.NormalBudget.ToString(); temp = (TextBox)this.fvBudgetAllocationInDetails.FindControl("txtAdjustBudget"); temp.Text = row.AdjustBudget.ToString(); temp = (TextBox)this.fvBudgetAllocationInDetails.FindControl("txtTotalBudget"); temp.Text = row.TotalBudget.ToString(); }
protected void odsBudgetAllocationOutDetails_Inserting(object sender, ObjectDataSourceMethodEventArgs e) { int index = -1; UserControls_BudgetSalesFeeViewControl uc = (UserControls_BudgetSalesFeeViewControl)this.fvBudgetAllocationOutDetails.FindControl("UCBudgetSales"); if (uc.BudgetSalesFeeId == string.Empty) { PageUtility.ShowModelDlg(this, "请选择客户、费用期间、费用项!"); e.Cancel = true; return; } foreach (FormDS.FormBudgetAllocationDetailRow row in this.InnerDS.FormBudgetAllocationDetail.Rows) { if ((row.AllocationType == (int)SystemEnums.AllocationType.Out) && row.BudgetSalesFeeId.ToString().Equals(uc.BudgetSalesFeeId)) { index = 1; } } if (index == 1) { PageUtility.ShowModelDlg(this, "添加失败,客户、费用期间、费用项不能重复!"); e.Cancel = true; return; } if (this.ViewState["ObjectId"] != null) { e.InputParameters["FormBudgetAllocationID"] = int.Parse(this.ViewState["ObjectId"].ToString()); } e.InputParameters["BudgetSaleFeeViewId"] = uc.BudgetSalesFeeId; TextBox txtAmount = (TextBox)this.fvBudgetAllocationOutDetails.FindControl("txtTransferBudget"); e.InputParameters["TransferBudget"] = txtAmount.Text; e.InputParameters["User"] = Session["StuffUser"]; e.InputParameters["AllocationType"] = SystemEnums.AllocationType.Out; tempOutId = uc.BudgetSalesFeeId; }