protected void gv_Budget_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string text = this.gvBudget.DataKeys[e.Row.RowIndex].Value.ToString(); CostAccounting byId = CostAccounting.GetById(text); e.Row.Attributes["layer"] = (byId.Code.Length / 3).ToString(); e.Row.Attributes["orderNumber"] = byId.Code; e.Row.Attributes["id"] = text; e.Row.Attributes["code"] = this.gvBudget.DataKeys[e.Row.RowIndex].Values[1].ToString(); string text2 = e.Row.Cells[3].Text; if (text2 == "D") { text2 = "直接成本"; } else { if (text2 == "I") { text2 = "间接成本"; } else { text2 = string.Empty; } } e.Row.Cells[3].Text = text2; } }
public void GetCBS() { this.costAccountList = CostAccounting.GetByD(); CostAccounting item = CostAccounting.Create(" ", " ", " ", " ", " "); this.costAccountList.Insert(0, item); }
protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { System.Collections.Generic.List <CostAccounting> byD = CostAccounting.GetByD(); this.ddlCBS.DataSource = byD; this.ddlCBS.DataTextField = "Name"; this.ddlCBS.DataValueField = "Code"; this.ddlCBS.DataBind(); this.ddlCBS.Items.Insert(0, new ListItem("--请选择直接成本--", "")); if (string.Compare(this.action, "Add", true) == 0) { this.InitAdd(); return; } if (string.Compare(this.action, "Update", true) == 0) { this.InitUpdate(); return; } if (string.Compare(this.action, "Query", true) == 0) { this.InitUpdate(); } } }
protected void BindUpdateData(string id) { CostAccounting byId = CostAccounting.GetById(id); this.txtCBSCode.Text = byId.Code; this.txtCBSName.Text = byId.Name; this.txtNote.Text = byId.Note; this.ddlType.SelectedValue = byId.Type; }
protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { System.Collections.Generic.List <CostAccounting> byD = CostAccounting.GetByD(); this.ViewState["CBSList"] = byD; this.DataBindContractType(); } }
public string CBSName(string CBSCode) { CostAccounting byCode = CostAccounting.GetByCode(CBSCode); if (byCode == null) { return(string.Empty); } return(byCode.Name); }
protected void btnDel_Click(object sender, System.EventArgs e) { System.Collections.Generic.List <string> listFromJson = JsonHelper.GetListFromJson(this.hfldChecked.Value); string str = "失败,正在使用不能删除"; bool flag = CostAccounting.Del(listFromJson); if (flag) { str = "成功"; } base.RegisterScript("top.ui.show('删除" + str + "!');location='CostAccounting.aspx';"); }
protected void gvDiaryDetails_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["id"] = this.gvDiaryDetails.DataKeys[e.Row.RowIndex]["Id"].ToString(); e.Row.Attributes["Id"] = this.gvDiaryDetails.DataKeys[e.Row.RowIndex]["Id"].ToString(); DropDownList dropDownList = e.Row.Cells[3].FindControl("ddlCBSCode") as DropDownList; if (dropDownList != null) { dropDownList.DataSource = CostAccounting.GetIndirectCost(); dropDownList.DataTextField = "Name"; dropDownList.DataValueField = "Code"; dropDownList.DataBind(); dropDownList.SelectedValue = this.gvDiaryDetails.DataKeys[e.Row.RowIndex]["CBSCode"].ToString(); } } }
protected CostAccounting GetCostAcc() { string id = string.Empty; if (string.Compare(base.Request["action"], "add", true) == 0) { id = Guid.NewGuid().ToString(); } else { id = base.Request["parent"]; } string name = this.txtCBSName.Text.Trim(); string selectedValue = this.ddlType.SelectedValue; string note = this.txtNote.Text.Trim(); string text = this.txtCBSCode.Text; return(CostAccounting.Create(id, name, text, selectedValue, note)); }
protected void btnSave_Click(object sender, EventArgs e) { if (this.txtNote.Text.Trim().Length > 200) { base.RegisterShow("系统提示", "说明不得超过200个字!"); return; } CostAccounting costAcc = this.GetCostAcc(); if (string.Compare(base.Request["action"], "add", true) == 0) { string inputUser = PageHelper.QueryUser(this, base.UserCode); costAcc.Add(costAcc, inputUser); } else { costAcc.Update(costAcc); } base.RegisterScript("top.ui.tabSuccess({ parentName: '_costaccounting' });"); }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { string strA = base.Request["action"]; string text = base.Request["parent"]; if (string.Compare(strA, "add", true) == 0) { this.txtCBSCode.Text = CostAccounting.GetCode(text); this.ddlType.SelectedValue = CostAccounting.GetById(text).Type; } else { if (string.Compare(strA, "update", true) == 0) { this.BindUpdateData(text); } } //this.ddlType.SelectedValue == "I"; } }
protected void BindGv() { this.gvBudget.DataSource = CostAccounting.GetAll(); this.gvBudget.DataBind(); }