public string getCampaignList(bool Interna, MD_UserEntity UserSession, string primarykey, string fields, string ordefiled, string orderway, int currentpage, int pagesize, string orderClass, int CT, int CA) { string Title = Interna ? IN_Language.CGL_Title(EM_Language.en_us) : IN_Language.CGL_Title(EM_Language.zh_cn); string Description = Interna ? IN_Language.CGL_Description(EM_Language.en_us) : IN_Language.CGL_Description(EM_Language.zh_cn); string Whom = Interna ? IN_Language.CGL_Whom(EM_Language.en_us) : IN_Language.CGL_Whom(EM_Language.zh_cn); string Active = Interna ? IN_Language.CGL_Active(EM_Language.en_us) : IN_Language.CGL_Active(EM_Language.zh_cn); string Status = Interna ? IN_Language.CGL_Status(EM_Language.en_us) : IN_Language.CGL_Status(EM_Language.zh_cn); string Update_dt = Interna ? IN_Language.CGL_Update_dt(EM_Language.en_us) : IN_Language.CGL_Update_dt(EM_Language.zh_cn); string Operate = Interna ? IN_Language.CGL_Operate(EM_Language.en_us) : IN_Language.CGL_Operate(EM_Language.zh_cn); StringBuilder sbList = new StringBuilder(); sbList.Append("<table class=\"t-bd\" Style=\"width:796px\"><tr>"); sbList.Append("<th style=\"cursor:pointer;width:120px\" "); sbList.Append("class=\"w40\" onclick=\"changeOrder(this,'CG_Title')\">" + Title + "<span class=\"taxis\" title=\"Sort by the column \"></span></th>"); sbList.Append("<th Style=\"width:350px\">" + Description + "</th>"); //sbList.Append("<th>" + Whom + "</th>"); sbList.Append("<th Style=\"width:100px\" class=\"w40\" onclick=\"changeOrder(this,'CG_Status')\">" + Status + "<span class=\"taxis\" title=\"Sort by the column \"></span></th>"); sbList.Append("<th Style=\"width:120px\" style=\"cursor:pointer;\" "); if (ordefiled.Equals("CG_Update_dt")) { sbList.Append("class=\"taxisCurrent\" onclick=\"changeOrder(this,'CG_Update_dt')\">" + Update_dt + "<span class=\""); sbList.Append(orderClass); sbList.Append("\" title=\"Sort by the column \"></span></th>"); } else { sbList.Append(" onclick=\"changeOrder(this,'CG_Update_dt')\">" + Update_dt + "<span class=\"taxis\" title=\"Sort by the column \"></span></th>"); } sbList.Append("<th Style=\"width:60px\" class=\"w100\">" + Operate + "</th>"); int pagecount = -1, rowscount = -1; MD_CampaignList CampaignList = Cam.GetCampaignList(UserSession.User.UG_UType, UserSession.DealerEmpl.DE_AD_OM_Code, primarykey, fields, ordefiled, orderway, currentpage, pagesize, CT, out pagecount, out rowscount, CA); if (null != CampaignList && null != CampaignList.CampaignList) { //生成分页html var strPager = new StringBuilder(); if (1 < pagecount) { strPager = Pager.JavascriptPagination(true, currentpage, pagecount, rowscount); } for (int i = 0; i < CampaignList.CampaignList.Count; i++) { CT_Campaigns Camp = CampaignList.CampaignList[i]; Camp.Interna = Interna; string Name = string.Empty; BL_Reports Report = new BL_Reports(); CT_Reports RE = Report.GetReplaceReport(Interna, new CT_Param_Value() { RP_Code = Camp.CG_RP_Code, PV_Type = 1, PV_CG_Code = Camp.CG_Code, PV_UType = UserSession.User.UG_UType, PV_AD_OM_Code = UserSession.DealerEmpl.DE_AD_OM_Code }); if (RE == null) { Name = ""; } else { Name = RE.RP_Name_EN; } sbList.Append("<tr value='" + Camp.CG_Code + "'><td style=\"text-align:left\">"); sbList.Append(Camp.CG_Title.Length > 30 ? Camp.CG_Title.Substring(0, 30) : Camp.CG_Title); sbList.Append("</td><td style=\"text-align:left\" title='" + Camp.CG_Desc + "'>"); sbList.Append("<div style=\"border-bottom:1px solid #c3c3c3\">"); sbList.Append(Camp.CG_Desc.Length > 60 ? Camp.CG_Desc.Substring(0, 60) : Camp.CG_Desc); sbList.Append("</div><div>"); if (null != Name) { sbList.Append(Name.Length > 60 ? Name.Substring(0, 60) : Name); } sbList.Append("</div>"); sbList.Append("</td>"); sbList.Append("<td >" + Camp.CG_S + "</td>"); //sbList.Append("</td><td >"); //sbList.Append(Camp.SS + "</td>"); sbList.Append("<td >"); var CG_Update_dt = Camp.CG_Update_dt.ToString("MM/dd/yyyy HH:mm:ss"); CG_Update_dt = CG_Update_dt == "01/01/0001 00:00:00" ? "" : CG_Update_dt; sbList.Append(CG_Update_dt); sbList.Append("</td><td style=\"text-align:left\">"); sbList.Append("<a href=\"/manage/Campaign/Campaign.aspx?CA=" + Camp.CG_Cat + "&CG_Code="); sbList.Append(Camp.CG_Code); sbList.Append("\"><i class=\"btnModify\" title=\"edit\"></i></a>"); sbList.Append("<a href=\"javascript:;\"><i class=\"btnDelete\" title=\"Delete\" onclick=\"Delete(event,"); sbList.Append(Camp.CG_Code); sbList.Append(",'"); sbList.Append(Camp.CG_Filename); sbList.Append("')\"></i></a>"); if (Camp.CG_Status == 10 && DateTime.Now < Camp.CG_End_Dt && Camp.CG_Start_Dt < DateTime.Now) { sbList.Append("<a href=\"javascript:;\"><i class=\"btnRun\" title=\"Run\" onclick=\"Run(event,"); sbList.Append(Camp.CG_Code); sbList.Append(","); sbList.Append(Camp.CG_RP_Code); sbList.Append(")\"></i></a>"); } sbList.Append("</td></tr>"); } sbList.Append("</table>"); sbList.Append(strPager); } else { sbList.Append("<tr ><td colspan=\"10\"><div class=\"noData\">No matching data!</div></td></tr>"); sbList.Append("</tbody>"); sbList.Append("</table>"); } return(sbList.ToString()); }
/// <summary> /// 获取Event列表 /// </summary> /// <param name="EV_UType"></param> /// <param name="EV_AD_OM_Code"></param> /// <param name="primarykey"></param> /// <param name="fields"></param> /// <param name="ordefiled"></param> /// <param name="orderway"></param> /// <param name="currentpage"></param> /// <param name="pagesize"></param> /// <param name="orderClass"></param> /// <returns></returns> public string getEventList(bool Interna, MD_UserEntity UserSession, string primarykey, string fields, string ordefiled, string orderway, int currentpage, int pagesize, string orderClass) { string Title = Interna ? IN_Language.CGL_Title(EM_Language.en_us) : IN_Language.CGL_Title(EM_Language.zh_cn); string Description = Interna ? IN_Language.CGL_Description(EM_Language.en_us) : IN_Language.CGL_Description(EM_Language.zh_cn); string Whom = Interna ? IN_Language.CGL_Whom(EM_Language.en_us) : IN_Language.CGL_Whom(EM_Language.zh_cn); string Active = Interna ? IN_Language.CGL_Active(EM_Language.en_us) : IN_Language.CGL_Active(EM_Language.zh_cn); string Update_dt = Interna ? IN_Language.CGL_Update_dt(EM_Language.en_us) : IN_Language.CGL_Update_dt(EM_Language.zh_cn); string Operate = Interna ? IN_Language.CGL_Operate(EM_Language.en_us) : IN_Language.CGL_Operate(EM_Language.zh_cn); StringBuilder sbList = new StringBuilder(); sbList.Append("<table class=\"t-bd\" Style=\"width:930px\"><tr>"); sbList.Append("<th style=\"cursor:pointer;width:150px;\" "); sbList.Append("class=\"w40\" onclick=\"changeOrder(this,'EV_Title')\">" + Title + "<span class=\"taxis\" title=\"Sort by the column \"></span></th>"); sbList.Append("<th Style=\"width:400px\">" + Description + "</th>"); sbList.Append("<th>" + Whom + "</th>"); sbList.Append("<th>" + Active + "</th>"); sbList.Append("<th style=\"cursor:pointer;\" "); if (ordefiled.Equals("EV_Update_dt")) { sbList.Append("class=\"taxisCurrent\" onclick=\"changeOrder(this,'EV_Update_dt')\">" + Update_dt + "<span class=\""); sbList.Append(orderClass); sbList.Append("\" title=\"Sort by the column \"></span></th>"); } else { sbList.Append(" onclick=\"changeOrder(this,'EV_Update_dt')\">" + Update_dt + "<span class=\"taxis\" title=\"Sort by the column \"></span></th>"); } sbList.Append("<th class=\"w100\">" + Operate + "</th>"); int pagecount = -1, rowscount = -1; MD_EventList EventList = Event.getEventList(UserSession.User.UG_UType, UserSession.DealerEmpl.DE_AD_OM_Code, primarykey, fields, ordefiled, orderway, currentpage, pagesize, out pagecount, out rowscount); if (null != EventList && EventList.EventList.Count > 0) { //生成分页html var strPager = new StringBuilder(); if (1 < pagecount) { strPager = Pager.JavascriptPagination(true, currentpage, pagecount, rowscount); } for (int i = 0; i < EventList.EventList.Count; i++) { CT_Events Ev = EventList.EventList[i]; Ev.Interna = Interna; string Name = string.Empty; BL_Reports Report = new BL_Reports(); CT_Reports RE = Report.GetReplaceReport(Interna, new CT_Param_Value() { RP_Code = Ev.EV_RP_Code, PV_Type = 2, PV_CG_Code = Ev.EV_Code, PV_UType = UserSession.User.UG_UType, PV_AD_OM_Code = UserSession.DealerEmpl.DE_AD_OM_Code }); if (RE == null) { Name = ""; } else { Name = RE.RP_Name_EN; } sbList.Append("<tr value='" + Ev.EV_Code + "'><td style=\"text-align:left\">"); sbList.Append(Ev.EV_Title.Length > 30 ? Ev.EV_Title.Substring(0, 30) : Ev.EV_Title); sbList.Append("</td><td style=\"text-align:left\" title='" + Ev.EV_Desc + "'>"); sbList.Append("<div style=\"border-bottom:1px solid #c3c3c3\">"); sbList.Append(Ev.EV_Desc.Length > 60 ? Ev.EV_Desc.Substring(0, 60) : Ev.EV_Desc); sbList.Append("</div><div>"); sbList.Append(Name.Length > 60 ? Name.Substring(0, 60) : Name); sbList.Append("</div>"); sbList.Append("</td><td >"); sbList.Append(Ev.S); sbList.Append("</td><td >"); sbList.Append(Ev.SS); sbList.Append("</td><td >"); sbList.Append(Ev.EV_Update_dt.ToString("MM/dd/yyyy HH:mm:ss")); sbList.Append("</td><td >"); sbList.Append("<a href=\"/manage/Event/Edit_Event.aspx?id="); sbList.Append(Ev.EV_Code); sbList.Append("\"><i class=\"btnModify\" title=\"edit\"></i></a>"); sbList.Append("<a href=\"javascript:;\"><i class=\"btnDelete\" title=\"Delete\" onclick=\"Delete(event,"); sbList.Append(Ev.EV_Code); sbList.Append(",'"); sbList.Append(Ev.EV_Filename); sbList.Append("')\"></i></a>"); sbList.Append("<a href=\"javascript:;\"><i class=\"btnRun\" title=\"Run\" onclick=\"Run(event,"); sbList.Append(Ev.EV_Code); sbList.Append(","); sbList.Append(Ev.EV_RP_Code); sbList.Append(")\"></i></a>"); sbList.Append("</td></tr>"); } sbList.Append("</table>"); sbList.Append(strPager); } else { sbList.Append("<tr ><td colspan=\"10\"><div class=\"noData\">No matching data!</div></td></tr>"); sbList.Append("</tbody>"); sbList.Append("</table>"); } return(sbList.ToString()); }