Пример #1
0
        private void UpdateUserInfo(UserDto userDto)
        {
            var imageUrl = userDto.ImageUrl;

            if (String.IsNullOrEmpty(imageUrl))
            {
                imageUrl = GioiTinhUtil.GetDefaultPhotoUrlBy(userDto.GioiTinh);
            }
            var    headLoginName = userDto.FullName;
            string headLoginNameAdmin;
            var    roleCode = UserUtil.GetRoleCode(userDto);

            if (String.IsNullOrEmpty(roleCode))
            {
                headLoginNameAdmin = userDto.FullName;
            }
            else
            {
                headLoginNameAdmin = userDto.FullName + " - " + roleCode;
            }
            HeadLoginImg1.Src   = imageUrl;
            HeadLoginImg2.Src   = imageUrl;
            HeadLoginImg3.Src   = imageUrl;
            HeadLoginName1.Text = headLoginName;
            HeadLoginName2.Text = headLoginNameAdmin;
            HeadLoginName3.Text = headLoginName;
            UpdateLeftPanel(roleCode);
        }
Пример #2
0
//        private void FillToAccountBonusTable(AccountBonusDto[] acountBonusList)
//        {
//            AccountBonusTable.Text = "<table class=\"table no-margin\">";
//            AccountBonusTable.Text += "<thead>";
//            AccountBonusTable.Text += "<tr>";
//            AccountBonusTable.Text += "<th>Tháng</th>";
//            AccountBonusTable.Text += "<th>Tổng số</th>";
//            AccountBonusTable.Text += "<th>Trạng Thái</th>";
//            AccountBonusTable.Text += "</tr>";
//            AccountBonusTable.Text += "</thead>";
//            AccountBonusTable.Text += "<tbody>";
//            foreach (var accountBonusDto in acountBonusList)
//            {
//                AccountBonusTable.Text += "<tr>";
//                var dThang = DateUtil.GetDateTime(accountBonusDto.Thang);
//                string thang;
//                if (dThang != null)
//                {
//                    thang = "Tháng " + ((DateTime)dThang).Month;
//                }
//                else
//                {
//                    thang = string.Empty;
//                }
//                AccountBonusTable.Text += "<td><a href=\"#\">" + thang + "</a></td>";
//                AccountBonusTable.Text += "<td>" + accountBonusDto.Tong + "</td>";
//                var isPaid = accountBonusDto.IsPaid;
//                if (isPaid == 1)
//                {
//                    AccountBonusTable.Text += "<td><span class=\"label label-success\">Đã trả thưởng</span></td>";
//                }
//                else
//                {
//                    AccountBonusTable.Text += "<td><span class=\"label label-warning\">Chưa trả thưởng</span></td>";
//                }
//                AccountBonusTable.Text += "</tr>";
//            }
//            AccountBonusTable.Text += "</tbody>";
//            AccountBonusTable.Text += "</table>";
//        }
//
//        private void FillToNewManagerList(UserDto[] newManagerList)
//        {
//            NewManagerAmount.Text = newManagerList.Length + " Quản lý";
//            NewManagerList.Text = "<ul class=\"users-list clearfix\">";
//            foreach (var userDto in newManagerList)
//            {
//                NewManagerList.Text += "<li>";
//                var imageUrl = userDto.ImageUrl;
//                if (string.IsNullOrEmpty(imageUrl))
//                {
//                    imageUrl = GioiTinhUtil.GetDefaultPhotoUrlBy(userDto.GioiTinh);
//                }
//                imageUrl = imageUrl.Replace("~", "");
//                NewManagerList.Text += "<img src=\"" + imageUrl + "\" runat=\"server\" alt=\"User Image\"/>";
//                NewManagerList.Text += "<a class=\"users-list-name\" href=\"#\" title=\"" + userDto.FullName + "\">" + userDto.FullName + "</a>";
//                var createdDate = DateUtil.GetDateTimeAsDdmmyyyy(userDto.CreatedDate);
//                NewManagerList.Text += "<span class=\"users-list-date\">" + createdDate + "</span>";
//                NewManagerList.Text += "</li>";
//            }
//            NewManagerList.Text += "</ul>";
//        }

        private void FillToNewMemberList(UserDto[] newMemberList)
        {
            NewMemberAmount.Text = newMemberList.Length + " Thành viên";
            NewMemberList.Text   = "<ul class=\"users-list clearfix\">";
            foreach (var userDto in newMemberList)
            {
                NewMemberList.Text += "<li>";
                var imageUrl = userDto.ImageUrl;
                if (string.IsNullOrEmpty(imageUrl))
                {
                    imageUrl = GioiTinhUtil.GetDefaultPhotoUrlBy(userDto.GioiTinh);
                }
                imageUrl            = imageUrl.Replace("~", "");
                NewMemberList.Text += "<img src=\"" + imageUrl + "\" runat=\"server\" alt=\"User Image\"/>";
                NewMemberList.Text += "<a class=\"users-list-name\" href=\"#\" title=\"" + userDto.FullName + "\">" + userDto.FullName + "</a>";
                var createdDate = DateUtil.GetDateTimeAsDdmmyyyy(userDto.CreatedDate);
                NewMemberList.Text += "<span class=\"users-list-date\">" + createdDate + "</span>";
                NewMemberList.Text += "</li>";
            }
            NewMemberList.Text += "</ul>";
        }