protected void btnExportExcel_Click(object sender, System.EventArgs e) { int year = System.Convert.ToInt32(this.dropYear.SelectedValue); PCPettyCashService pCPettyCashService = new PCPettyCashService(); DataTable monthCash = pCPettyCashService.GetMonthCash(year, this.userCode); for (int i = 0; i < monthCash.Rows.Count; i++) { DataRow dataRow = monthCash.Rows[i]; dataRow["Matter"] = dataRow["Matter"].ToString().Replace("<br />", ";\t"); } string[] headerName = new string[] { "序号", "日期", "事项", "借款金额" }; string[] fieldName = new string[] { "No", "Date", "Matter", "Cash" }; string[] totalField = new string[] { "Cash" }; ExcelHelper.ExportExcel(monthCash, headerName, fieldName, totalField, this.lblTitle.Text + ".xls", base.Request.Browser.Browser); }
private void BindGvwMonthCash(int year, string userCode) { PCPettyCashService pCPettyCashService = new PCPettyCashService(); this.gvwMonthCash.DataSource = pCPettyCashService.GetMonthCash(year, userCode); this.gvwMonthCash.DataBind(); }
protected void gvwMonthCash_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Footer) { PCPettyCashService pCPettyCashService = new PCPettyCashService(); int year = System.Convert.ToInt32(this.dropYear.SelectedValue); e.Row.Cells[1].Text = "合计"; e.Row.Cells[3].Text = pCPettyCashService.GetCashTotal(year, this.userCode).ToString("#0.000"); e.Row.Cells[3].Style.Add("text-align", "right"); e.Row.Cells[3].CssClass = "decimal_input"; } }
public string GetPettyCashMatter(object pettyCashId) { PCPettyCashService pCPettyCashService = new PCPettyCashService(); if (pettyCashId != null) { PCPettyCash byId = pCPettyCashService.GetById(pettyCashId.ToString()); if (byId != null) { return(byId.Matter); } } return(string.Empty); }
private void InitDiary() { BudIndirectDiaryCost byId = this.diarySer.GetById(this.diaryId); this.lblName.Text = byId.Name; this.lblInputDate.Text = byId.InputDate.ToString("yyyy-MM-dd"); this.lblDepartment.Text = byId.Department; this.lblInputUser.Text = byId.InputUser; this.lblIssueBy.Text = byId.IssuedBy; this.lblCode.Text = byId.IndireCode; if (byId.CostType == "P") { PTPrjInfoService pTPrjInfoService = new PTPrjInfoService(); PTPrjInfo byId2 = pTPrjInfoService.GetById(byId.ProjectId); if (byId2 != null) { this.lblPrjName.Text = byId2.PrjName; } } else { this.ltlCostTypeName.Text = "组织机构"; PTdbmService pTdbmService = new PTdbmService(); PTdbm byId3 = pTdbmService.GetById(byId.ProjectId); if (byId3 != null) { this.lblPrjName.Text = byId3.V_bmqc; } } PCPettyCashService pCPettyCashService = new PCPettyCashService(); PCPettyCash byId4 = pCPettyCashService.GetById(byId.PettyCashId); if (byId4 != null) { this.lblPettyCash.Text = byId4.Matter; } }