private void BindAccountInfo()
        {
            dtlAccountInfo.DataSource = null;
            dtlAccountInfo.DataBind();
            try
            {
                BLL.Member member = new BLL.Member();
                if (member.GetMemberByUserName(MemberUserName))
                {

                    List<dynamic> dataSource = new List<dynamic>()
                        {
                            new {
                                UserName=member.UserName,
                                Email=member.Email,
                                Password=member.Password,
                                PasswordQuestion=member.PasswordQuestion,
                                QuestionAnswer=member.Answer,
                                CreationDate=member.CreationDate,
                                IP=member.s_IP,
                                MemberTypeExpiryDate=member.s_MemberTypeExpiryDate,
                                Credit_Money=member.s_Credit_Money,
                                MemberTypeColor=member.MemberType.MemberTypeSpecDuration.MemberTypeSpec.Color,
                                StatusName=member.StatusName,
                                IsOnline=(member.IsOnLine?"نعم":"لا"),
                                FriendsCount=member.FriendsCount()
                            }
                        };
                    dtlAccountInfo.DataSource = dataSource;
                    dtlAccountInfo.DataBind();
                    if (Helper.Admin.HasRole(Helper.Enums.AdminRoles.Admin_AccountInfo.ToString()))
                    {
                        Repeater repOwnerRooms = (Repeater)dtlAccountInfo.FindControl("repOwnerRooms");
                        Repeater repAdminRooms = (Repeater)dtlAccountInfo.FindControl("repAdminRooms");

                        BLL.RoomMember roomMember = new BLL.RoomMember();
                        roomMember.GetAllRoomsByAdminMemberID(member.MemberID);
                        repAdminRooms.DataSource = roomMember.DefaultView;
                        repAdminRooms.DataBind();
                        //string adminRoom = string.Join(",", roomMember.DefaultView.Table.AsEnumerable().Select(x => x["RoomName"].ToString()).ToArray());
                        BLL.Room room = new BLL.Room();
                        room.GetRoomsByCreatorID(member.MemberID);
                        repOwnerRooms.DataSource = room.DefaultView;
                        repOwnerRooms.DataBind();
                    }
                }
            }
            catch
            {
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BLL.Bot bllBot = new BLL.Bot();
                bllBot.LoadAllWithPoints();
                repBots.DataSource = bllBot.DefaultView;
                repBots.DataBind();

                BLL.Room bllRooms = new BLL.Room();
                bllRooms.GetRoomsByCreatorID(BLL.Member.CurrentMemberID);
                lstRooms.DataTextField = BLL.Room.ColumnNames.Name;
                lstRooms.DataValueField = BLL.Room.ColumnNames.RoomID;
                lstRooms.DataSource = bllRooms.DefaultView;
                lstRooms.DataBind();

                lblPointsBalance.Text = BLL.Member.CurrentMember.s_Credit_Point;

                _dicRoomsSpecs = new List<object>();
                _dicRoomsSpecs = bllRooms.DefaultView.Table.AsEnumerable().Select(m => new { RoomID = m[BLL.Room.ColumnNames.RoomID], SpecID = m["RoomTypeSpecID"] }).ToList();
                BindRoomsBots();

            }
        }