示例#1
0
        /// <summary>
        /// 搜索各到账类型列表
        /// </summary>
        /// <returns></returns>
        public JsonResult PayList_searchMoney(string contract, string channel, string begin, string end, string person, string type)
        {
            DaPayList dal = new DaPayList();
            IList<PayList> pays = dal.getList(contract, channel, begin, end, person, Convert.ToInt32(type), BaseHelper.getCookie().id.ToString());

            var result = new CustomJsonResult();
            result.dateFormat = "yyyy-MM-dd";
            result.Data = new { total = pays.Count, rows = pays };
            return result;
        }
示例#2
0
 /// <summary>
 /// 获取到账总金额
 /// </summary>
 /// <returns></returns>
 public JsonResult PayList_getMoney(string contract, string channel, string begin, string end, string person)
 {
     DaPayList dal = new DaPayList();
     var result = new CustomJsonResult();
     result.Data = dal.getMoney(contract, channel, begin, end, person, BaseHelper.getCookie().id.ToString());
     return result;
 }
示例#3
0
        /// <summary>
        /// 导出到账情况
        /// </summary>
        /// <param name="contract"></param>
        /// <param name="channel"></param>
        /// <param name="begin"></param>
        /// <param name="end"></param>
        /// <param name="person"></param>
        /// <param name="type"></param>
        public void PayList_output(string contract, string channel, string begin, string end, string person, string type)
        {
            DaPayList dal = new DaPayList();
            DataTable dt = dal.getDataTable(contract, channel, begin, end, person, Convert.ToInt32(type), BaseHelper.getCookie().id.ToString());

            if (dt.Rows.Count > 0)
            {
                string filename = "myPayList.xls";
                System.IO.StringWriter tw = new System.IO.StringWriter();
                System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
                DataGrid dgGrid = new DataGrid();
                dgGrid.DataSource = dt;
                dgGrid.DataBind();

                //Get the HTML for the control.
                dgGrid.RenderControl(hw);
                //Write the HTML back to the browser.
                //Response.ContentType = application/vnd.ms-excel;
                Response.ContentType = "application/vnd.ms-excel";
                Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");
                Response.Write(tw.ToString());
            }
            else
            {
                Response.Write("无数据可导出!");
            }

            Response.End();
        }
示例#4
0
        /// <summary>
        /// 获取客户到账情况列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public JsonResult ContractList_getPayList(string id)
        {
            DaPayList dal = new DaPayList();
            IList<PayList> list = dal.getListByContract(id);

            var result = new CustomJsonResult();
            result.Data = new { total = list.Count, rows = list };
            return result;
        }