public static string QuerySubscribeInfo(string subscribestart, string subscribeend, string busiunit, string istigger, string busitype, string ordercode, string cusno, string divideno, string contract, string submitstart, string submitend, int pagesize, int lastnum) { string sum = "0"; WGUserEn user = (WGUserEn)HttpContext.Current.Session["user"]; if (user == null || user.GwyUserID <= 0) { return(""); } DataTable infodt = SubscribeModel.getNewSubscribeInfo_Order(subscribestart, subscribeend, busiunit, istigger, busitype, ordercode, cusno, divideno, contract, submitstart, submitend, pagesize, lastnum, user.GwyUserID, out sum); //DataTable infodt = SubscribeModel.getNewSubscribeInfo_Order(subscribestart, subscribeend, busiunit, istigger, busitype, ordercode, cusno, divideno, contract, // submitstart, submitend, pagesize, lastnum, 1124, out sum); if (infodt == null || infodt.Rows.Count == 0) { return(""); } try { foreach (DataRow dr in infodt.Rows) { if (string.IsNullOrEmpty(dr["divideno"].ToString2())) { dr["divideno"] = ""; } if (string.IsNullOrEmpty(dr["logisticsname"].ToString2())) { dr["logisticsname"] = ""; } if (string.IsNullOrEmpty(dr["contractno"].ToString2())) { dr["contractno"] = ""; } dr["declstatus"] = SwitchHelper.switchValue("declstatus", dr["declstatus"].ToString2()); dr["inspstatus"] = SwitchHelper.switchValue("inspstatus", dr["inspstatus"].ToString2()); dr["sum"] = sum; } IsoDateTimeConverter iso = new IsoDateTimeConverter();//序列化JSON对象时,日期的处理格式 iso.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; string json = JsonConvert.SerializeObject(infodt, iso); return(json); } catch (Exception e) { LogHelper.Write("MyBusiness_QueryData:" + e.Message); return(""); } }
public static string NewQuerySubscribeInfo() { WGUserEn user = (WGUserEn)HttpContext.Current.Session["user"]; if (user == null || user.GwyUserID <= 0) { return(""); } DataTable infodt = SubscribeModel.getNewSubscribeInfo_Order(user.GwyUserID); //DataTable infodt = SubscribeModel.getNewSubscribeInfo_Order(1124); if (infodt == null || infodt.Rows.Count == 0) { return(""); } try { foreach (DataRow dr in infodt.Rows) { if (string.IsNullOrEmpty(dr["divideno"].ToString2())) { dr["divideno"] = ""; } if (string.IsNullOrEmpty(dr["logisticsname"].ToString2())) { dr["logisticsname"] = ""; } if (string.IsNullOrEmpty(dr["contractno"].ToString2())) { dr["contractno"] = ""; } dr["declstatus"] = SwitchHelper.switchValue("declstatus", dr["declstatus"].ToString2()); dr["inspstatus"] = SwitchHelper.switchValue("inspstatus", dr["inspstatus"].ToString2()); } IsoDateTimeConverter iso = new IsoDateTimeConverter();//序列化JSON对象时,日期的处理格式 iso.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; string json = JsonConvert.SerializeObject(infodt, iso); return(json); } catch (Exception e) { LogHelper.Write("MyBusiness_QueryData:" + e.Message); return(""); } }