public FormDS.FormBudgetAllocationDetailDataTable GetFormBudgetAllocationDetail(int FormBudgetAllocationID, SystemEnums.AllocationType AllocationType) { FormDS.FormBudgetAllocationDetailDataTable table = new FormDS.FormBudgetAllocationDetailDataTable(); DataRow[] rows = this.TAFormBudgetAllocationDetail.GetDataByFormID(FormBudgetAllocationID).Select("AllocationType=" + (int)AllocationType); foreach (FormDS.FormBudgetAllocationDetailRow item in rows) { table.ImportRow(item); } return(table); }
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); }