public void AddFormBudgetAllocationDetail(AuthorizationDS.StuffUserRow User, int?FormBudgetAllocationID, int BudgetSaleFeeViewId, decimal TransferBudget, SystemEnums.AllocationType AllocationType) { int count = this.FormDataSet.FormBudgetAllocationDetail.Count; FormDS.BudgetSalesFeeViewRow budgetSalesFeeRow = this.BudgetSalesFeeViewTA.GetDataByID(BudgetSaleFeeViewId)[0]; FormDS.FormBudgetAllocationDetailRow rowDetail = this.FormDataSet.FormBudgetAllocationDetail.NewFormBudgetAllocationDetailRow(); if (TransferBudget > budgetSalesFeeRow.TotalBudget) { throw new ApplicationException("调入/调出预算不能超出总预算!"); } rowDetail.FormBudgetAllocationID = FormBudgetAllocationID.GetValueOrDefault(); rowDetail.CustomerID = budgetSalesFeeRow.CustomerID; rowDetail.CustomerName = budgetSalesFeeRow.CustomerName; rowDetail.ExpenseItemID = budgetSalesFeeRow.ExpenseItemID; rowDetail.ExpenseItemName = budgetSalesFeeRow.ExpenseItemName; rowDetail.Period = budgetSalesFeeRow.Period; rowDetail.OriginalBudget = budgetSalesFeeRow.OriginalBudget; rowDetail.NormalBudget = budgetSalesFeeRow.NormalBudget; rowDetail.TotalBudget = budgetSalesFeeRow.TotalBudget; rowDetail.AdjustBudget = budgetSalesFeeRow.AdjustBudget; rowDetail.TransferBudget = TransferBudget; rowDetail.AllocationType = (int)AllocationType; rowDetail.CustomerName = budgetSalesFeeRow.CustomerName; rowDetail.ExpenseItemName = budgetSalesFeeRow.ExpenseItemName; rowDetail.BudgetSalesFeeId = budgetSalesFeeRow.BudgetSalesFeeID; // 填加行并进行更新处理 this.FormDataSet.FormBudgetAllocationDetail.AddFormBudgetAllocationDetailRow(rowDetail); }
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(); }