protected void btnDeletePhoto_Click(object sender, EventArgs e)
 {
     BLL.Members objData = new BLL.Members();
     objData.LoadByPrimaryKey(CurrentMember);
     objData.SetColumnNull(BLL.Members.ColumnNames.MemberImagePath);
     objData.Save();
     imgMember.Src = "~/images/noImg.png";
     btnDeletePhoto.Visible = false;
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            BLL.Members objData = new BLL.Members();
            if (CurrentMember > 0)
                objData.LoadByPrimaryKey(CurrentMember);
            else
                objData.AddNew();

            objData.MemberName = txtName.Text;
            objData.MemberTelephone = txtTelephone.Text;
            objData.MemberEmail = txtEmail.Text;
            if (FileUploadMemberPhoto.HasFile)
            {
                string imagePath = "UploadedFiles/Members/" + FileUploadMemberPhoto.FileName;
                FileUploadMemberPhoto.SaveAs(MapPath("~/" + imagePath));
                objData.MemberImagePath = imagePath;
            }
            objData.Save();
            //loadCurrentMember();
            Response.Redirect("ManageMembers.aspx?mid=" + objData.MemberID);
        }
        protected void GridViewMembers_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
                case "EditMember":
                    Response.Redirect("ManageMembers.aspx?mid=" + e.CommandArgument);
                    break;

                case "DeleteMember":
                    BLL.Members objData = new BLL.Members();
                    objData.LoadByPrimaryKey(int.Parse(e.CommandArgument.ToString()));
                    objData.MarkAsDeleted();
                    objData.Save();
                    loadMembers();
                    break;

                default:
                    break;
            }
        }
        protected void loadMembers()
        {
            BLL.Members objData = new BLL.Members();
            objData.LoadAll();

            GridViewMembers.DataSource = objData.DefaultView;
            GridViewMembers.DataBind();
        }
 protected void loadCurrentMember()
 {
     BLL.Members objData = new BLL.Members();
     objData.LoadByPrimaryKey(CurrentMember);
     txtName.Text = objData.MemberName;
     txtEmail.Text = objData.MemberEmail;
     txtTelephone.Text = objData.MemberTelephone;
     if (!objData.IsColumnNull(BLL.Members.ColumnNames.MemberImagePath))
     {
         btnDeletePhoto.Visible = true;
         imgMember.Src = objData.MemberImagePath;
     }
     else
         btnDeletePhoto.Visible = false;
 }