private void BudgetConDataBind() { DataTable dt = BGBudgetConManager.GetAllBudgetCon(); repBudPro.DataSource = dt; repBudPro.DataBind(); }
protected void repBudPro_ItemCommand(object source, RepeaterCommandEventArgs e) { string piid = e.CommandArgument.ToString(); if (e.CommandName == "AltPro") { //修改 Response.Redirect("BudProjectAlter.aspx?piid=" + piid, true); } else if (e.CommandName == "DelPro") { //删除 BGBudgetConManager.DelAppPIIDConCell(piid); BGBudgetConCellManager.DelAppPIIDConCell(piid); BudgetConDataBind(); } }
protected void btnAdd_Click(object sender, EventArgs e) { //添加--> string piid = ddlPayIncome.SelectedItem.Value; int piidInt = common.IntSafeConvert(piid); BG_BudgetConCell cell = null; List <BG_BudgetConCell> list = new List <BG_BudgetConCell>(); if (ckA.Checked) { //A启用 cell = new BG_BudgetConCell(); cell.PIID = piidInt; cell.BCCName = common.RemoveUnsafeHtml(tbA.Text.Trim()); cell.BCCStan = ParseUtil.ToDecimal(tbCtrA.Text.Trim(), 0); cell.BCCUseSta = "启用"; list.Add(cell); } if (ckB.Checked) { //B启用 cell = new BG_BudgetConCell(); cell.PIID = piidInt; cell.BCCName = common.RemoveUnsafeHtml(tbB.Text.Trim()); cell.BCCStan = ParseUtil.ToDecimal(tbCtrB.Text.Trim(), 0); cell.BCCUseSta = "启用"; list.Add(cell); } if (ckC.Checked) { //C启用 cell = new BG_BudgetConCell(); cell.PIID = piidInt; cell.BCCName = common.RemoveUnsafeHtml(tbC.Text.Trim()); cell.BCCStan = ParseUtil.ToDecimal(tbCtrC.Text.Trim(), 0); cell.BCCUseSta = "启用"; list.Add(cell); } if (ckD.Checked) { //D启用 cell = new BG_BudgetConCell(); cell.PIID = piidInt; cell.BCCName = common.RemoveUnsafeHtml(tbD.Text.Trim()); cell.BCCStan = ParseUtil.ToDecimal(tbCtrD.Text.Trim(), 0); cell.BCCUseSta = "启用"; list.Add(cell); } if (ckE.Checked) { //E启用 cell = new BG_BudgetConCell(); cell.PIID = piidInt; cell.BCCName = common.RemoveUnsafeHtml(tbE.Text.Trim()); cell.BCCStan = ParseUtil.ToDecimal(tbCtrE.Text.Trim(), 0); cell.BCCUseSta = "启用"; list.Add(cell); } if (ckF.Checked) { //F启用 cell = new BG_BudgetConCell(); cell.PIID = piidInt; cell.BCCName = common.RemoveUnsafeHtml(tbF.Text.Trim()); cell.BCCStan = ParseUtil.ToDecimal(tbCtrF.Text.Trim(), 0); cell.BCCUseSta = "启用"; list.Add(cell); } //添加项目预算控制记录 BG_BudgetCon bgBudget = new BG_BudgetCon(); bgBudget.PIID = piidInt; bgBudget.YNUse = "启用"; bgBudget.BCRemark = "备注"; BGBudgetConManager.AddBudgetCon(bgBudget); //批量添加项目预算控制单元记录 BGBudgetConCellManager.AddBudgetConCell(list); Response.Redirect("BudProjectList.aspx", true); }