public string loadForm(string branchType) { string result = ""; int i = 1; string label = ""; var m = db.sp_web_loadMess(branchType); foreach (var item in m.ToList()) { result += "<tr id='" + item.Id + "' read='" + item.StatusId.ToString() + "' class='detail-rows'>"; result += "<td class='center'>" + i.ToString() + " </td>"; if (item.StatusId == 0) { label = "blink label label-success"; } else { label = "label label-primary"; } result += "<td>" + item.Name + "</td>"; result += "<td><label class='" + label + "'>" + item.Status + "</label></td>"; result += "<td>" + item.CreateAt.Value.ToString("dd/MM/yyyy HH:mm:ss") + "</td>"; result += "<td>" + item.UserName + "</td>"; result += "<td>" + item.Message + "</td>"; result += "<td><a href='" + item.Path + "' target='_blank'>" + item.Path + "</a></td>"; result += "</tr>"; i++; } return(result); }