private void BindGrid() { lbl_message.Text = "费用报销审批汇总表"; int id = (int)ViewState["ID"]; FNA_FeeWriteOffBLL bll = new FNA_FeeWriteOffBLL(id); ViewState["Details"] = bll.Items.OrderBy(p => p.Client).ThenBy(p => p.AccountTitle).ThenBy(p => p.BeginMonth).ToList(); FNA_FeeWriteOff writeoff = bll.Model; if (writeoff == null) { Response.Redirect("FeeWriteOffList.aspx"); } BindGridPrint(); string type = ""; if (writeoff["InvoiceClassAB"] != "") { type = DictionaryBLL.GetDicCollections("FNA_InvoiceClassAB")[writeoff["InvoiceClassAB"]].Name; } // type = DictionaryBLL.Dictionary_Data_GetAlllList("TableName='FNA_InvoiceClassAB' AND Code='" + writeoff["InvoiceClassAB"] + "'")[0].Name; if (type == "") { type = "抵款"; } span_sheetcode.InnerText = writeoff.SheetCode; span_accountmonth.InnerText = new AC_AccountMonthBLL(writeoff.AccountMonth).Model.Name; if (bll.Model["InsteadPayStaff"] != "" && bll.Model["InsteadPayStaff"] != "0") { p_ddtype.InnerText = "员工"; span_client.InnerText = new Org_StaffBLL(int.Parse(bll.Model["InsteadPayStaff"])).Model.RealName; } else { span_client.InnerText = new CM_ClientBLL(writeoff.InsteadPayClient).Model.FullName; } int city5 = TreeTableBLL.GetSuperIDByLevel("MCS_SYS.dbo.Addr_OrganizeCity", writeoff.OrganizeCity, 5); span_orgnizecity.InnerText = TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "Name", "SuperID", 1, city5 > 0 ? city5 : writeoff.OrganizeCity); span_type.InnerText = type; span1.InnerText = span2.InnerText = "1"; //求费用核消金额合计 decimal _totalcost = 0; foreach (FNA_FeeWriteOffDetail _detail in bll.Items) { _totalcost += _detail.WriteOffCost + _detail.AdjustCost; } lab_SubTotalCostCN.Text = MCSFramework.Common.Rmb.CmycurD(_totalcost.ToString()); lab_SubTotalCost.Text = _totalcost.ToString("#,##0.00"); lab_SubTotalCost.Text = lab_SubTotalCost.Text; lab_SubTotalCost.Text = lab_SubTotalCost.Text; }
private void BindData() { int id = (int)ViewState["ID"]; FNA_FeeWriteOffBLL bll = new FNA_FeeWriteOffBLL(id); ViewState["Details"] = bll.Items.OrderBy(p => p.Client).ToList(); ViewState["FLPurchase"] = FNA_FeeWriteOffBLL.GetPurchaseVolume((int)ViewState["ID"]); FNA_FeeWriteOff writeoff = bll.Model; if (writeoff == null) { Response.Redirect("FeeWriteOffList.aspx"); } pn_FeeWriteOff.BindData(writeoff); ViewState["AccountMonth"] = writeoff.AccountMonth; ViewState["SheetCode"] = writeoff.SheetCode; ViewState["State"] = writeoff.State; ViewState["HasFeeApply"] = writeoff["HasFeeApply"]; ViewState["IsEvectionWriteOff"] = writeoff["IsEvectionWriteOff"]; ViewState["InsteadPayClient"] = bll.Model.InsteadPayClient; writeoff["Remark"] = writeoff["Remark"].Replace("\r", "<br/>"); detailPrint.Visible = true; if (bll.Model.InsteadPayClient > 0) { BindGridPrint(); string type = ""; if (writeoff["InvoiceClassAB"] != "0" && writeoff["InvoiceClassAB"] != "") { try { type = DictionaryBLL.Dictionary_Data_GetAlllList("TableName='FNA_InvoiceClassAB' AND Code='" + writeoff["InvoiceClassAB"] + "'")[0].Name; } catch { } } lbl_message.Text = "<font color='red'>" + new CM_ClientBLL((int)ViewState["InsteadPayClient"]).Model.FullName + "</font>代垫费用" + "<font color='red'>" + type + "</font>" + "明细表"; div_client.InnerText = new CM_ClientBLL((int)ViewState["InsteadPayClient"]).Model.FullName; div_type.InnerText = div_type2.InnerText = div_type3.InnerText = div_type0.InnerText = type; div_SheetCode.InnerText = writeoff.SheetCode; } else if (bll.Model["InsteadPayStaff"] != "0" && bll.Model["InsteadPayStaff"] != "") { BindGridPrint(); string type = ""; if (writeoff["InvoiceClassAB"] != "0" && writeoff["InvoiceClassAB"] != "") { try { type = DictionaryBLL.Dictionary_Data_GetAlllList("TableName='FNA_InvoiceClassAB' AND Code='" + writeoff["InvoiceClassAB"] + "'")[0].Name; } catch { } } lbl_message.Text = "<font color='red'>" + new Org_StaffBLL(int.Parse(writeoff["InsteadPayStaff"])).Model.RealName + "</font>代垫费用" + "<font color='red'>" + type + "</font>" + "明细表"; div_client.InnerText = new Org_StaffBLL(int.Parse(writeoff["InsteadPayStaff"])).Model.RealName; div_type.InnerText = div_type2.InnerText = div_type3.InnerText = div_type0.InnerText = type; div_SheetCode.InnerText = writeoff.SheetCode; div_insType.InnerText = "员工:"; label_insName.InnerText = "该员工"; label_insName2.InnerText = label_insName3.InnerText = "代垫员工"; } writeoff.InsteadPayClient = 0; pn_Remark.BindData(writeoff); //求费用核消金额合计 decimal _totalcost = 0; foreach (FNA_FeeWriteOffDetail _detail in bll.Items) { _totalcost += _detail.WriteOffCost + _detail.AdjustCost; } _totalcost = Math.Round(_totalcost, 1); lb_TotalCostCN.Text = MCSFramework.Common.Rmb.CmycurD(_totalcost.ToString()); lb_TotalCost.Text = _totalcost.ToString("#,##0.00"); lab_TotalCostCN.Text = lb_TotalCostCN.Text; lab_TotalCost.Text = lb_TotalCost.Text; BindGrid(); #region 绑定差旅行程 if (writeoff["IsEvectionWriteOff"] == "Y") { tb_EvectionRouteList.Visible = true; gv_EvectionRouteList.ConditionString = "FNA_EvectionRoute.WriteOffID = " + ViewState["ID"].ToString(); gv_EvectionRouteList.BindGrid(); } #endregion }