/// <summary> /// 显示已经登记了的卫星号码列表 /// </summary> private void ShowSatellites() { var number = txtQueryNumber.Value.Trim(); number = string.IsNullOrEmpty(number) ? "" : number; var totalRecords = 0; var pageIndex = "" == hidPageIndex.Value ? 1 : int.Parse(hidPageIndex.Value); var list = SatelliteInstance.FindPageList <TB_Satellite>(pageIndex, PageSize, out totalRecords, f => f.CardNo.IndexOf(number) >= 0 && f.CardNo.Length > 10, "RegisterDate", true); var totalPages = totalRecords / PageSize + (totalRecords % PageSize > 0 ? 1 : 0); string html = ""; if (totalRecords < 1) { html = "<tr><td colspan=\"7\">No records, you can change condition and try again, or " + " <a>Add</a> some new one.</td></tr>"; } else { var cnt = (pageIndex - 1) * PageSize; foreach (var obj in list) { cnt++; //var id = Utility.UrlEncode(Utility.Encrypt(obj.id.ToString())); html += "<tr>" + "<td style=\"text-align: center;\">" + cnt + "</td>" + "<td><a style=\"cursor: pointer;\" data-toggle=\"modal\" data-target=\"#modalManufacturing\" data-whatever=\"" + obj.CardNo + "\" data-id=\"" + obj.id + "\">" + obj.CardNo + "</a></td>" + "<td>" + obj.RegisterDate.Value.ToString("yyyy/MM/dd HH:mm:ss") + "</td>" + "<td style=\"text-align: center;\">" + (obj.Bound.Value ? "Yes" : "No") + "</td>" + "<td>" + (string.IsNullOrEmpty(obj.PcbNumber) ? "-" : obj.PcbNumber) + "</td>" + "<td>" + (string.IsNullOrEmpty(obj.ManufactureDate) ? "-" : obj.ManufactureDate) + "</td>" + "<td></td>" + "</tr>"; } } tbodyBody.InnerHtml = html; divPagging.InnerHtml = ""; if (totalRecords > 0) { ShowPaggings(pageIndex, totalPages, totalRecords, "iridium_model_register.aspx", divPagging); } }
/// <summary> /// 显示未绑定终端的卫星号码列表 /// </summary> private void ShowSatellites() { var totalRecords = 0; var pageIndex = "" == hidPageIndex.Value ? 1 : int.Parse(hidPageIndex.Value); var list = SatelliteInstance.FindPageList <TB_Satellite>(pageIndex, _page_size, out totalRecords, f => f.Bound == false, "CardNo"); var totalPages = totalRecords / _page_size + (totalRecords % _page_size > 0 ? 1 : 0); string html = ""; if (totalRecords < 1) { html = "<tr><td colspan=\"6\">No records</td></tr>"; } else { var cnt = (pageIndex - 1) * _page_size; foreach (var obj in list) { cnt++; var id = Utility.UrlEncode(Utility.Encrypt(obj.id.ToString())); html += "<tr>" + "<td style=\"text-align: center;\">" + "<input type=\"radio\" name=\"satId\" id=\"cb_" + id + "\" /></td>" + "<td style=\"text-align: center;\">" + cnt + "</td>" + "<td>" + obj.CardNo + "</td>" + "<td>" + obj.Bound.Value + "</td>" + "<td>" + obj.RegisterDate.Value.ToString("yyyy-MM-dd") + "</td>" + "<td></td>" + "</tr>"; } } tbodyBody.InnerHtml = html; divPagging.InnerHtml = ""; if (totalRecords > 0) { ShowPaggings(pageIndex, totalPages, totalRecords, "./terminal_satellite.aspx", divPagging); } }
private void ShowSatellites() { var totalRecords = 0; var pageIndex = "" == hidPageIndex.Value ? 1 : int.Parse(hidPageIndex.Value); var list = SatelliteInstance.FindPageList <TB_Satellite>(pageIndex, PageSize, out totalRecords, null, "CardNo"); var totalPages = totalRecords / PageSize + (totalRecords % PageSize > 0 ? 1 : 0); string html = ""; if (totalRecords < 1) { html = "<tr><td colspan=\"6\">No records, you can change condition and try again, or " + " <a>Add</a> some new one.</td></tr>"; } else { var cnt = (pageIndex - 1) * PageSize; foreach (var obj in list) { cnt++; var id = Utility.UrlEncode(Utility.Encrypt(obj.id.ToString())); html += "<tr>" + // 系统默认角色无法删除 "<td style=\"width: 40px; text-align: center;\"><input type=\"checkbox\" id=\"cb_" + id + "\" /></td>" + "<td style=\"width: 40px; text-align: center;\">" + cnt + "</td>" + "<td><a href=\"./satellite_manage.aspx?key=" + id + "\" >" + obj.CardNo + "</a></td>" + "<td>" + obj.RegisterDate.Value.ToString("yyyy-MM-dd") + "</td>" + "<td>" + obj.Bound.ToString() + "</td>" + "<td></td>" + "</tr>"; } } tbodyBody.InnerHtml = html; divPagging.InnerHtml = ""; if (totalRecords > 0) { ShowPaggings(pageIndex, totalPages, totalRecords, "./satellite_manage.aspx", divPagging); } }