Exemplo n.º 1
0
 public ActionResult MemberV2(int PageSize, int CurrentPage, Model.M.M1Params m1params)
 {
     m1params.Years = Request.QueryString.Get("Years"); //Years 多条
     string Filter = U.BuildFilter(m1params);
     int Count = 0;
     List<Member> TL = new List<Model.M.Member>();
     //第一行
     var TM = new Member();
     TM.ID = "序号";
     //TM.MID = "学员号";
     //TM.IDSN = "报名序号";
     TM.IDCard = "身份证号";
     TM.Name = "学员姓名";
     //TM.Phone = "手机";
     //TM.Type = "类型";
     TM.Year = "年份";
     TM.Minutes = "课时";
     //TM.IID = "发票";
     TM.Score = "考试";
     //TM.Status = "结业";
     //TM.RegDate = "注册时间";
     TM.PayDate = "缴费时间";
     TM.CommitDate = "结业时间";
     TM.RegionCode = "区域代码";
     TL.Add(TM);
     //数据行
     var L = DAL.M.Get.M1(PageSize, CurrentPage, Filter, out Count);
     foreach (var m in L)
     {
         TM = new Member();
         TM.ID = m.ID.ToString();
         //TM.MID = m.MID.ToString();
         //TM.IDSN = "'" + m.IDSN;
         TM.IDCard = "'" + m.IDCard;
         TM.Name = m.Name;
         //TM.Phone = m.Phone;
         //TM.Type = m.Type == 0 ? "行政" : "企业";
         TM.Year = m.Year.ToString();
         TM.Minutes = string.Format("{0}", m.Minutes.ToString("0.#"));
         //TM.IID = m.IID > 0 ? "发票" : "-";
         TM.Score = m.Score.ToString();
         //TM.Status = m.Status == 1 ? "已结业" : "-";
         //TM.RegDate = m.RegDate.ToString();
         if (m.PayDate > DateTime.MinValue)
         {
             TM.PayDate = m.PayDate.ToString();
         }
         if (m.CommitDate > DateTime.MinValue)
         {
             TM.CommitDate = m.CommitDate.ToString();
         }
         TM.RegionCode = m.RegionCode.ToString();
         TL.Add(TM);
     }
     string CSV = U.ConvertToCSV<Member>(TL);
     U.ExportCSV(CSV);
     return Content(string.Empty);
 }
Exemplo n.º 2
0
 public ActionResult Member(int PageSize, int CurrentPage)
 {
     int Count = 0;
     List<Member> TL = new List<Model.M.Member>();
     //第一行
     var TM = new Member();
     TM.ID = "序号";
     TM.MID = "学员号";
     TM.IDSN = "报名序号";
     TM.IDCard = "身份证号";
     TM.Name = "学员姓名";
     TM.Type = "类型";
     TM.Year = "年份";
     TM.Minutes = "课时(分钟)";
     TM.IID = "发票";
     TM.Score = "考试";
     TM.Status = "结业";
     TM.RegDate = "注册时间";
     TL.Add(TM);
     //数据行
     var L = DAL.M.Get.M1(PageSize, CurrentPage, out Count);
     foreach (var m in L)
     {
         TM = new Member();
         TM.ID = m.ID.ToString();
         TM.MID = m.MID.ToString();
         TM.IDSN = "'" + m.IDSN;
         TM.IDCard = "'" + m.IDCard;
         TM.Name = m.Name;
         TM.Type = m.Type == 0 ? "行政" : "企业";
         TM.Year = m.Year.ToString();
         TM.Minutes = string.Format("{0}", m.Minutes.ToString("0.#"));
         TM.IID = m.IID > 0 ? "发票" : "-";
         TM.Score = m.Score > 0 ? m.Score.ToString() : "-";
         TM.Status = m.Status == 1 ? "结业" : "-";
         TM.RegDate = m.RegDate.ToString();
         TL.Add(TM);
     }
     string CSV = U.ConvertToCSV<Member>(TL);
     U.ExportCSV(CSV);
     return Content(string.Empty);
 }