private string DanhSachNguoiDung(int?phongid, int?SubstituteId) { string html = ""; if (phongid.HasValue) { qtUserService _user = new qtUserService(); IEnumerable <qtUser> list = _user.FindList().Where(m => m.DepartmentId == phongid && m.Status == true); if (list.Count() > 0) { html += "<table class='grid' style='width: 100%;'>" + "<thead>" + "<tr>" + "<th>#</th>" + "<th> Họ và tên </th>" + "<th> Chức vụ </th>" + "</thead>"; foreach (C.Core.Model.qtUser user in list) { string check = checkUser(SubstituteId, user.UserId); html += "<tr>" + "<td><input type='checkbox' value=" + user.UserId + " name='cbxItem' id='cbxItem' " + check + " ></td>" + "<td>" + user.UserName + "</td>" + "<td>" + user.qtPosition.PositionName + "</td>" + "</tr>"; } html += "</table>"; } } ViewBag.dsNguoiDung = html; return(html); }
public ActionResult Create(int?Id) { qtUserService _user = new qtUserService(); IEnumerable <qtUser> list = _user.FindList().Where(m => m.Status == true && m.IsAdmin == false).OrderBy(m => m.SortOrder); ViewBag.User = list.ToSelectList(u => u.UserName + "-" + u.qtPosition.PositionName + "-" + u.qtDepartment.DepartmentName + "-" + u.qtUnit.UnitName, u => u.UserId.ToString(), Id.ToString()); GetUnit(Id); ViewBag.UserId = Id; return(View()); }
private void DanhSachNguoiDung(int?donviId, int?UserConfigId) { string html = ""; if (donviId.HasValue) { qtUserService _user = new qtUserService(); qtDepartmentService _dep = new qtDepartmentService(); IEnumerable <qtDepartment> listdep = _dep.FindList().Where(m => m.UnitId == donviId && m.Status == true); if (listdep.Count() > 0) { html += "<table class='grid' style='width: 100%;'>" + "<thead>" + "<tr>" + "<th width='15%' >#</th>" + "<th width='35%'> Họ và tên </th>" + "<th width='15%'> Thứ tự </th>" + "<th width='40%'> Chức vụ </th>" + "</thead>"; foreach (qtDepartment item in listdep) { html += "<tr>" + "<td colspan='4'>" + item.DepartmentName + "</td>" + "</tr>"; IEnumerable <qtUser> list = _user.FindList().Where(m => m.UnitId == donviId && m.DepartmentId == item.DepartmentId && m.Status == true); if (list.Count() > 0) { foreach (C.Core.Model.qtUser user in list) { qtUserConfigDetail check = checkUser(UserConfigId, user.UserId, null); string _checked = check != null ? "checked='checked'" : ""; string value = check != null?check.OrderBy.ToString() : ""; html += "<tr>" + "<td><input type='checkbox' value=" + user.UserId + " name='cbxItem' id='cbxItem' " + _checked + " ></td>" + "<td>" + user.UserName + "</td>" + //"<td> </td>"+ "<td>" + " <input type='text' class='width-10' id='OrderBy" + user.UserId + "' name='OrderBy" + user.UserId + "' value='" + value + "' />" + "</td>" + "<td>" + user.qtPosition.PositionName + "</td>" + "</tr>"; } } } html += "</table>"; } } ViewBag.dsNguoiDung = html; }