Ejemplo n.º 1
0
        protected void UpdateMemberAvatar(object sender, ImageClickEventArgs e)
        {
            int cchid    = 0,
                avatarID = 0;

            if (int.TryParse(hfChosenMember.Value, out cchid) &&
                int.TryParse((sender as ImageButton).CommandArgument, out avatarID))
            {
                using (sc_InsertUpdateMemberAvatar ima = new sc_InsertUpdateMemberAvatar())
                {
                    ima.CCHID    = cchid;
                    ima.AvatarID = avatarID;
                    ima.PostData();
                    MemberAvatars.AsEnumerable().Where(ma => ma.Field <int>("CCHID") == cchid).First().SetField("AvatarID", avatarID);
                    MemberAvatars.AsEnumerable().Where(ma => ma.Field <int>("CCHID") == cchid).First().SetField("AvatarFileName", AvatarFilesByID[avatarID]);
                }
            }

            hfChosenMember.Value = "";
        }
Ejemplo n.º 2
0
        protected void UpdateMemberAvatar(object sender, ImageClickEventArgs e)
        {
            int cchid = 0,
                avatarID = 0;
            if (int.TryParse(hfChosenMember.Value, out cchid) &&
                int.TryParse((sender as ImageButton).CommandArgument, out avatarID))
            {
                using (sc_InsertUpdateMemberAvatar ima = new sc_InsertUpdateMemberAvatar())
                {
                    ima.CCHID = cchid;
                    ima.AvatarID = avatarID;
                    ima.PostData();
                    MemberAvatars.AsEnumerable().Where(ma => ma.Field<int>("CCHID") == cchid).First().SetField("AvatarID", avatarID);
                    MemberAvatars.AsEnumerable().Where(ma => ma.Field<int>("CCHID") == cchid).First().SetField("AvatarFileName", AvatarFilesByID[avatarID]);
                }
            }

            hfChosenMember.Value = "";
        }