Пример #1
0
    void GetRegisteredUsersList()
    {
        PanelCheckNewFiles.Visible   = false;
        PanelCheckNewUsers.Visible   = false;
        PanelRegisteredUser.Visible  = true;
        PanelSearchAllFiles.Visible  = false;
        PanelUpdateAdminInfo.Visible = false;

        FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();
        var res    = from v in DB.GetTable <UserInfo>() select v;
        int UserNo = 0;

        foreach (var r in res)
        {
            UserNo++;
            Image UserImg = new Image();
            UserImg.ImageUrl = r.UserProfilePicFile;
            UserImg.Height   = 50; UserImg.Width = 50;
            HyperLink UserLink = new HyperLink(); UserLink.CssClass = "BodyStyle";
            UserLink.Text        = r.Username + "  [" + r.UserFirstName + " " + r.UserMiddleName + " " + r.UserLastName + "]";
            UserLink.Target      = "_blank";
            UserLink.NavigateUrl = "AdminUserAccountControl.aspx?User="******"&nbsp; &nbsp;"));
            PlaceHolderRegisteredUsers.Controls.Add(UserLink);
            PlaceHolderRegisteredUsers.Controls.Add(new LiteralControl("<br />"));
        }
        lblRegisteredUsersNo.Text = UserNo.ToString() + " registered user(s) found!";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();
        var res    = from v in DB.GetTable <FileSharingRequest>() select v.ID;
        int nextID = 0;

        foreach (var r in res)
        {
            if ((int)r > nextID)
            {
                nextID = (int)r;
            }
        }
        nextID++;
        TextBox1.Text = "nextID = " + nextID;
    }
Пример #3
0
    /* void SearchAllFiles()
     * {
     *  PanelCheckNewFiles.Visible = false;
     *  PanelCheckNewUsers.Visible = false;
     *  PanelRegisteredUser.Visible = false;
     *  PanelSearchAllFiles.Visible = true;
     *  PanelUpdateAdminInfo.Visible = false;
     *
     *  lblSearchResultNo.Visible = true;
     *
     *  //try
     *  {
     *      /*
     * Facilities added:
     * Searching is not case sensitive
     * Seaching is not leading or trailing white spaces sensitive
     */ /*
     *      int SearchResNo = 0;
     *      if (txtSearch.Text.Trim() != "")
     *      {
     *          FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();
     *          // var SearchedFiles = from v in (from v0 in DB.GetTable<DBFile>() where v0.Mode == "General" select v0) where v.UploadedFileName.Contains(txtSearch.Text.Trim()) select v;
     *          var SearchedFiles = DB.DBFiles.Where(x => x.UploadedFileName.Contains(txtSearch.Text.Trim()) && x.Mode == "General");
     *          //DirectoryInfo mydir = new DirectoryInfo(@Server.MapPath("~/UploadedFiles/ServerDatabase/" + (DropDownListSearchCategory.SelectedItem.Text).Trim() + "s/"));
     *          foreach (var r in SearchedFiles)
     *          {
     *              SearchResNo++;
     *              string FileCategory = r.Category.ToString();
     *
     *              // --- Creating label to show the searched file's info
     *              Label lbl = new Label();
     *              lbl.Text = "[ Category: " + FileCategory + " | Size: " + r.UploadedFileSize + " | Uploader's Name: " + r.UploaderUserName + " |  Upload Date: " + r.UploadDateTime + " ]";
     *              lbl.CssClass = "SearchlblStyle"; lbl.BorderWidth = 0;
     *              // *** Creating label to show the searched file's info
     *
     *              // --- Creating hyperlink to link the file to the database address
     *              HyperLink FileLink = new HyperLink();
     *              FileLink.Target = "_blank";
     *              FileLink.CssClass = "SearchResultsStyle"; FileLink.BorderWidth = 0;
     *              FileLink.Text = Convert.ToString(r.UploadedFileName);
     *              FileLink.NavigateUrl = Convert.ToString(r.FileAddressInServerDB);
     *              // *** Creating hyperlink to link the file to the database address
     *
     *              // --- Creating Image to display the correct icon with respect to the category of the file
     *              Image ImgIcon = new Image();
     *              switch (FileCategory)
     *              {
     *                  case "Image": ImgIcon.ImageUrl = "~/Images/SearchResultsIcon/Image.png"; ImgIcon.Height = 20; ImgIcon.Width = 20; break;
     *                  case "Video": ImgIcon.ImageUrl = "~/Images/SearchResultsIcon/Video.ico"; ImgIcon.Height = 20; ImgIcon.Width = 20; break;
     *                  case "Music": ImgIcon.ImageUrl = "~/Images/SearchResultsIcon/itunes-icon.png.png"; ImgIcon.Height = 20; ImgIcon.Width = 20; break;
     *                  case "Document": ImgIcon.ImageUrl = "~/Images/SearchResultsIcon/Document.png"; ImgIcon.Height = 20; ImgIcon.Width = 20; break;
     *                  case "Executable": ImgIcon.ImageUrl = "~/Images/SearchResultsIcon/Executable.png"; ImgIcon.Height = 20; ImgIcon.Width = 20; break;
     *              }
     *              // --- Attatching all Controls (Image, HyperLink, Label) to the Placeholder Control
     *              PlaceHolder1.Controls.Add(new LiteralControl("<br />"));
     *              PlaceHolder1.Controls.Add(new LiteralControl("&nbsp;"));
     *              PlaceHolder1.Controls.Add(ImgIcon); PlaceHolder1.Controls.Add(new LiteralControl("&nbsp; "));
     *              PlaceHolder1.Controls.Add(FileLink); PlaceHolder1.Controls.Add(new LiteralControl("&nbsp; "));
     *              PlaceHolder1.Controls.Add(lbl);
     *              // --- Attatching all Controls (Image, HyperLink, Label) to the Placeholder Control
     *          }
     *      }
     *          lblSearchResultNo.Text = SearchResNo.ToString() + " results returned!";
     *  }
     * } */
    void LoadAdminCredentials()
    {
        PanelCheckNewFiles.Visible   = false;
        PanelCheckNewUsers.Visible   = false;
        PanelRegisteredUser.Visible  = false;
        PanelSearchAllFiles.Visible  = false;
        PanelUpdateAdminInfo.Visible = true;

        FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();
        var res = from v in DB.GetTable <AdminInfo>() select v;

        foreach (var r in res)
        {
            txtAdminUsername.Text = r.AdminName;
            txtAdminPassword.Text = r.AdminPwd;
        }
    }
Пример #4
0
 void ChangeInfo()
 {
     if (CheckForAnyErrors())
     {
         PanelAcceptInfos1.Visible = true;
         PanelAcceptInfos2.Visible = true;
         PanelShowInfos.Visible    = false;
         FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();
         // var res = from v in DB.GetTable<UserInfo>() where v.Username == txtUsername.Text select v;
         var res = DB.UserInfos.Where(x => x.Username == txtUsername.Text);
         foreach (var r in res)
         {
             txtUsername.Text   = r.Username;
             txtFirstName.Text  = r.UserFirstName;
             txtMiddleName.Text = r.UserMiddleName;
             txtLastName.Text   = r.UserLastName;
             if (RadioButtonMale.Checked)
             {
                 r.UserGender = "Male";
             }
             else
             {
                 r.UserGender = "Female";
             }
             txtDOB.Text = r.UserDOB;
             DropDownListCountry.SelectedItem.Text = r.UserCountry;
             DropDownListCities.SelectedItem.Text  = r.UserCity;
             txtPhNo.Text  = r.UserPhoneNumber;
             txtEMail.Text = r.UserEMail;
             DropDownListSecurityQuestion.SelectedItem.Text = r.UserSecurityQuestion;
             txtSecurityAnswer.Text = r.UserSecurityAnswer;
         }
         var delres = from delv in DB.GetTable <UserInfo>() where delv.Username == txtUsername.Text select delv;
         foreach (var r in delres)
         {
             DB.UserInfos.DeleteOnSubmit(r);
         }
         DB.SubmitChanges();
         PanelAcceptInfos1.Enabled = true;
         PanelAcceptInfos2.Enabled = false;
         CheckUsernameAvailbility();
     }
 }
Пример #5
0
    protected void txtUsername_TextChanged(object sender, EventArgs e)
    {
        FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();
        bool test = DB.UserInfos.Where(x => x.Username == txtUsername.Text).Count() == 1?true:false;

        if (test == true)
        {
            txtUsername.Enabled = false;
            lblWarning.Text     = "";
            var qn = from v in DB.GetTable <UserInfo>() where v.Username == txtUsername.Text select v.UserSecurityQuestion;
            foreach (var r in qn)
            {
                txtSecurityQuestion.Text = r;
            }
            txtSecurityQuestion.Enabled = false;
        }
        else
        {
            lblWarning.Text = "No such username was found! Please check the username first!";
        }
    }
Пример #6
0
    void m1()
    {
        FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();

        string[] names = new string[DB.UserInfos.Count() * 3];

        var res = from v in DB.GetTable <UserInfo>() select v;
        int i   = -1;

        foreach (var r in res)
        {
            names[++i] = r.UserFirstName.ToString().Trim();
            names[++i] = r.UserLastName.ToString().Trim();
            names[++i] = r.Username.ToString().Trim();
        }

        TextBox1.Text = "names:\t";
        foreach (string s in names)
        {
            TextBox1.Text += s + " ";
        }
    }
    void populateGridViewSearchedUsers()
    {
        if (txtSearchUser.Text.Trim() == "")
        {
            lblSearchUserErrorMessage.Text = "Please enter a non-null search term!"; return;
        }

        SqlConnection con = new SqlConnection(constr);

        con.Open();
        string        sqlQuery = "select UserFirstName \"First Name\", UserMiddleName \"Middle Name\", UserLastName \"Last Name\", Username \"Username\" from UserInfos where UserFirstName like '%" + txtSearchUser.Text.Trim() + "%' or UserMiddleName  like '%" + txtSearchUser.Text.Trim() + "%' or UserLastName like '%" + txtSearchUser.Text.Trim() + "%' ";
        SqlCommand    cmd      = new SqlCommand(sqlQuery, con);
        SqlDataReader reader   = cmd.ExecuteReader();

        GridViewSearchedUsers.DataSource = reader;
        GridViewSearchedUsers.DataBind();
        con.Close();

        lblSearchUserErrorMessage.Text = GridViewSearchedUsers.Rows.Count + " result(s) returned!";
        FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();

        for (int i = 0; i < GridViewSearchedUsers.Rows.Count; i++)
        {
            ImageButton imgbtnProPic = new ImageButton();
            imgbtnProPic             = (ImageButton)GridViewSearchedUsers.Rows[i].FindControl("imgbtnUserProPic");
            imgbtnProPic.PostBackUrl = "AdminUserAccountControl.aspx?User="******"btnAddUser");
            btnAdd.CommandArgument = GridViewSearchedUsers.Rows[i].Cells[4].Text;
        }
    }
Пример #8
0
    public string[] getUserInfosSuggestionList(string prefixText, int count)
    {
        FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();

        string[]      names     = new string[DB.UserInfos.Count()];
        List <string> MatchList = new List <string>();

        var res = from v in DB.GetTable <UserInfo>() select v;
        int i   = 0;

        foreach (var r in res)
        {
            names[i++] = r.UserFirstName + " " + r.UserLastName + " [" + r.Username + "]";
        }

        foreach (string element in names)
        {
            if (element.ToLower().Contains(prefixText.ToLower()))
            {
                MatchList.Add(element);
            }
        }
        return(MatchList.ToArray());
    }
Пример #9
0
    protected void btnGetPwd_Click(object sender, EventArgs e)
    {
        Wait();
        FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();
        bool test = DB.UserInfos.Where(x => x.Username == txtUsername.Text && x.UserSecurityQuestion == txtSecurityQuestion.Text && x.UserSecurityAnswer == txtSecurityAnswer.Text).Count() == 1?true:false;

        if (test == true)
        {
            PanelShowUserPwd.Visible   = true;
            PanelGetUserInputs.Visible = false;
            var pwd = from v in DB.GetTable <UserInfo>() where v.Username == txtUsername.Text select v.UserPwd;
            foreach (var r in pwd)
            {
                lblShowUserPwd.Text = "Your account password was: '" + r + "'";
            }
        }
        else
        {
            if (txtUsername.Text != "" && txtSecurityQuestion.Text != "" && txtSecurityAnswer.Text != "")
            {
                lblWarning.Text = "Your security answer did not matched with the security answer you provided! Please try again!";
            }
        }
    }
Пример #10
0
    void UploadFile()
    {
        try
        {
            DropDownListSearchCategory.Enabled = true;
            if (DropDownListUploadMode.SelectedItem.Text == "General Mode")
            {
                if (FileUpload1.HasFile)
                {
                    FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();

                    // Inserting values to each column of the uploaded file's record


                    int NewFileNo = 0;
                    if (DB.DBFiles.Count() == 0)
                    {
                        NewFileNo = 0;
                    }
                    else
                    {
                        var res = from v in DB.GetTable <DBFile>() select v.FileNo;
                        foreach (var r in res)
                        {
                            NewFileNo = r;
                        }
                    }
                    DBFile record = new DBFile();
                    record.FileNo = NewFileNo + 1;
                    // $$$$$$$$$$$$$$$$$$$$$$$$$ record.UploaderUserName = Request.QueryString[""].ToString();
                    record.UploaderUserName = "******";
                    record.Mode             = "General";
                    record.SharedWith       = "Nobody";
                    DateTime now = DateTime.Now;
                    record.UploadDateTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); // 'YYYY-MM-DD HH:MM:SS'
                    switch (DropDownListSearchCategory.SelectedItem.Text)
                    {
                    case "Image":
                    {
                        //Response.Write("Image");
                        record.Category         = DropDownListSearchCategory.SelectedItem.Text;
                        record.UploadedFileName = Path.GetFileNameWithoutExtension(FileUpload1.FileName);
                        // ++++++++++++++++++++++++++++++
                        string filenameWithExt = Path.GetFileName(FileUpload1.FileName);
                        record.UploadedFileName_WithExt = filenameWithExt;

                        if (Convert.ToInt32(FileUpload1.PostedFile.ContentLength) < 1024)
                        {
                            record.UploadedFileSize = Convert.ToString(FileUpload1.PostedFile.ContentLength) + "B";
                        }
                        else if (Convert.ToInt32(FileUpload1.PostedFile.ContentLength) >= 1024 && Convert.ToInt32(FileUpload1.PostedFile.ContentLength) <= (1024 * 1024))
                        {
                            record.UploadedFileSize = Convert.ToString(FileUpload1.PostedFile.ContentLength / 1024) + "KB";
                        }
                        else
                        {
                            record.UploadedFileSize = Convert.ToString(FileUpload1.PostedFile.ContentLength / (1024 * 1024)) + "MB";
                        }

                        if (FileUpload1.PostedFile.ContentType == "image/jpeg" || FileUpload1.PostedFile.ContentType == "image/png" || FileUpload1.PostedFile.ContentType == "image/jpg" || FileUpload1.PostedFile.ContentType == "image/gif" || FileUpload1.PostedFile.ContentType == "image/x-icon")
                        {
                            if (FileUpload1.PostedFile.ContentLength < 10485760)
                            {
                                // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                                //record.FileAddressInServerDB = "~/UploadedFiles/ServerDatabase/Images/" + filenameWithExt;
                                FileUpload1.SaveAs(Server.MapPath("~/UploadedFiles/ServerDatabase/TempFiles/TempUploads/" + filenameWithExt));

                                // zipping the file and saving it to the appropriate directory of the ServerDatabase
                                using (var zip = new ZipFile())
                                {
                                    string fullFileAddress = Server.MapPath(".") + @"/UploadedFiles/ServerDatabase/Images/" + filenameWithExt + ".zip";
                                    zip.AddDirectory(Server.MapPath(".") + @"/UploadedFiles/ServerDatabase/TempFiles/TempUploads/");
                                    zip.Save(fullFileAddress);
                                    string[] files = System.IO.Directory.GetFiles(Server.MapPath("~/UploadedFiles/ServerDatabase/TempFiles/TempUploads/"));
                                    foreach (string f in files)
                                    {
                                        System.IO.File.Delete(f);
                                    }
                                }

                                lblUploadStatus.Text = "Upload Status: File '" + filenameWithExt + "' uploaded successfully!";
                                DB.DBFiles.InsertOnSubmit(record);
                                DB.SubmitChanges();
                                DropDownListSearchCategory.ClearSelection();
                                DropDownListUploadMode.ClearSelection();
                                //Image1.ImageUrl = "~\\ImageControl Icons\\Tick.ico";
                            }
                            else
                            {
                                lblUploadStatus.Text = "Upload Status: Error: File size should be less than 10MB!";
                                //Image1.ImageUrl = "~\\ImageControl Icons\\Warning.ico";
                            }
                        }
                        else
                        {
                            lblUploadStatus.Text = "Upload Status: Error: Only " + DropDownListSearchCategory.SelectedItem.Text + " file(*.jpg, *.jpeg, *.png, *.gif, *.ico) can be uploaded!";
                        }
                        break;
                    }
                    }
                }
                else
                {
                    lblUploadStatus.Text = "FileUpload1 does not have a file!";
                }
            }
            else
            {
                lblUploadStatus.Text = "Please choose an upload category!";
            }
        }
        catch (Exception exc)
        {
            Response.Write("Exc inside UploadFile(): " + exc.Message);
        }
    }
Пример #11
0
    bool AcceptSelectedFilesForSharing()
    {
        if (GetNoOfFilesSelected()[0] == 0)
        {
            return(false);
        }
        else
        {
            FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();
            var    res = DB.FileSharingRequests.Where(x => x.ID == int.Parse(Request.QueryString["FSR_ID"]));
            string RequestedUser = null, RequestingUser = null;
            foreach (var r in res)
            {
                RequestedUser  = r.RequestedUser.ToString();
                RequestingUser = r.RequestingUser.ToString();
                // --- Changing Confirmed field of FileSharingRequests to "Y"
                r.Confirmed = 'Y';
                // *** Changing Confirmed field of FileSharingRequests to "Y"
            }

            //Response.Write("RequestedUser = "******", RequestingUser = "******"chkRow");

                if ((chk.Checked) && ((DB.DBFiles.Where(x => (x.UploadedFileName_WithExt.ToString().Trim() == GridViewSharedFilesDetails.Rows[i].Cells[1].Text.Trim()) && (x.UploaderUserName.ToString().Trim() == RequestedUser.Trim()) && (x.SharedWith.ToString().Contains(RequestingUser.Trim()))).Count() > 0 ? true : false) == false))
                {
                    acceptedSharedFiles[indexAcceptedSharedFiles++] = GridViewSharedFilesDetails.Rows[i].Cells[1].Text;

                    // --- Adding selected files to the requested user's DBFiles from requesting user's DBFiles
                    DBFile DBFileNewRecord = new DBFile();
                    var    res1            = DB.DBFiles.Where(x => x.UploadedFileName_WithExt == GridViewSharedFilesDetails.Rows[i].Cells[1].Text && x.UploaderUserName == RequestingUser);
                    int    NewFileNo       = 0;
                    if (DB.DBFiles.Count() == 0)
                    {
                        NewFileNo = 0;
                    }
                    else
                    {
                        var res2 = from v in DB.GetTable <DBFile>() select v.FileNo;
                        foreach (var r in res2)
                        {
                            NewFileNo = r;
                        }
                    }
                    DBFileNewRecord.FileNo           = ++NewFileNo;
                    DBFileNewRecord.UploaderUserName = RequestedUser;
                    foreach (var r in res1)
                    {
                        DBFileNewRecord.Category                 = r.Category;
                        DBFileNewRecord.Mode                     = r.Mode;
                        DBFileNewRecord.UploadedFileName         = r.UploadedFileName;
                        DBFileNewRecord.UploadedFileSize         = r.UploadedFileSize;
                        DBFileNewRecord.UploadDateTime           = r.UploadDateTime;
                        DBFileNewRecord.UploadedFileName_WithExt = r.UploadedFileName_WithExt;

                        // --- Adding the SharedWith field to the requested user's DBFiles
                        DBFileNewRecord.SharedWith = RequestingUser + " ";
                        // *** Adding the SharedWith field to the requested user's DBFiles

                        // --- Modifying the SharedWith field of the requesting user's DBFiles
                        string sharedWithUsers_String = r.SharedWith.ToString();
                        if (sharedWithUsers_String.Trim() == "Nobody")
                        {
                            r.SharedWith = RequestedUser + " ";
                        }
                        else
                        {
                            char[] sharedWithUsers_chars = sharedWithUsers_String.ToCharArray();
                            int    usersSharedWith_index = 0; string[] usersSharedWith = new string[25];
                            foreach (char c in sharedWithUsers_chars)
                            {
                                if (c == ' ')
                                {
                                    usersSharedWith_index++;
                                }
                                else
                                {
                                    usersSharedWith[usersSharedWith_index] += c.ToString();
                                }
                            }

                            if (!usersSharedWith.Contains(RequestedUser))
                            {
                                r.SharedWith += RequestedUser + " ";
                            }
                        }
                        // *** Modifying the SharedWith field of the requesting user's DBFiles
                    }

                    DB.DBFiles.InsertOnSubmit(DBFileNewRecord);
                    DB.SubmitChanges();
                }
            }

            // --- Sending notification to the Requesting user

            string notification = "* [" + Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")) + "]  " + RequestedUser + " accepted your file sharing request(s) and added " + indexAcceptedSharedFiles.ToString() + " file(s) namely";

            for (int i = 0; i < indexAcceptedSharedFiles; i++)
            {
                if (i == (indexAcceptedSharedFiles - 1) && (indexAcceptedSharedFiles > 1))
                {
                    notification += " and '" + acceptedSharedFiles[i] + "' ";
                }
                else if (indexAcceptedSharedFiles == 1)
                {
                    notification += " '" + acceptedSharedFiles[i] + "' ";
                }
                else
                {
                    notification += " '" + acceptedSharedFiles[i] + "', ";
                }
            }

            notification += "to his/her Database.|";

            var resAddNtf = DB.UserInfos.Where(x => x.Username == RequestingUser);
            foreach (var r in resAddNtf)
            {
                r.Notifications = notification + r.Notifications.ToString();
            }
            DB.SubmitChanges();

            // --- Sending notification to the Requesting user

            return(true);
        }
    }
    void populateGridViewAddedUsers()
    {
        //try
        //{
        string[] usersAddedInNewGroup = getUsersAddedInNewGroup();

        string        sqlQuery = "";
        SqlConnection con      = new SqlConnection(constr);

        con.Open();

        sqlQuery = "select UserFirstName \"First Name\", UserMiddleName \"Middle Name\", UserLastName \"Last Name\", Username \"Username\" from UserInfos where ";
        int noOfUsers = getArrayFilledUpSize(usersAddedInNewGroup);

        for (int i = 0; i < noOfUsers; i++)
        {
            if (i == (noOfUsers - 1))
            {
                sqlQuery += " Username='******' ";
            }
            else
            {
                sqlQuery += " Username='******' or ";
            }
        }

        //Response.Write("GridViewAddedUsers sqlQuery = " + sqlQuery);

        SqlCommand    cmd    = new SqlCommand(sqlQuery, con);
        SqlDataReader reader = cmd.ExecuteReader();

        GridViewAddedUsers.DataSource = reader;
        GridViewAddedUsers.DataBind();
        con.Close();

        lblUsersAddedCounter.Text = GridViewAddedUsers.Rows.Count + " user(s) selected for adding!";
        FunZoneDatabaseDataContext DB = new FunZoneDatabaseDataContext();

        for (int i = 0; i < GridViewAddedUsers.Rows.Count; i++)
        {
            ImageButton imgbtnProPic = new ImageButton();
            imgbtnProPic             = (ImageButton)GridViewAddedUsers.Rows[i].FindControl("imgbtnUserProPic0");
            imgbtnProPic.PostBackUrl = "AdminUserAccountControl.aspx?User="******"btnRemoveUser");
            if (GridViewAddedUsers.Rows[i].Cells[4].Text == Session["user"].ToString())
            {
                btnRemove.Enabled = false;
            }
            else
            {
                btnRemove.CommandArgument = GridViewAddedUsers.Rows[i].Cells[4].Text;
            }
        }
        if (GridViewAddedUsers.Rows.Count > 1)
        {
        }
        else
        {
        }

        //}
        //catch (Exception exc) { Response.Write(" | <b>Exc caught</b> inside populateGridViewAddedUsers()! Exc Details: " + exc.Message + " sqlQuery=" + sqlQuery + " | "); }
    }