Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Adding meta Discription
            HtmlMeta objMeta = new HtmlMeta();
            objMeta.Name    = "Description";
            objMeta.Content = WebConfig.GetValues("MetaDiscription");
            this.Header.Controls.Add(objMeta);

            // Adding meta KeyWords
            objMeta         = new HtmlMeta();
            objMeta.Name    = "keywords";
            objMeta.Content = WebConfig.GetValues("MetaKeword");
            this.Header.Controls.Add(objMeta);

            L_SiteName.Text = L_SiteName2.Text = L_SiteName3.Text = WebConfig.GetValues("FName");
            try
            {
                HttpCookieCollection objHttpCookieCollection = Request.Cookies;
                HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatCookie5639sb");
                L_MatID.Text = Crypto.DeCrypto(objHttpCookie.Values[2]);
            }
            catch (Exception)
            {
            }
        }
        else
        {
            Page.Validate();
            if (IsValid)
            {
                if (CB_Del_acc.Checked)
                {
                    // retriving Application String
                    HttpCookieCollection objHttpCookieCollection = Request.Cookies;
                    HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatCookie5639sb");
                    string strApplicationID = Crypto.DeCrypto(objHttpCookie.Values["ApplicationID"]);

                    //Checking Password
                    if (MatrimonialMemberShip.IsPasswordTrue(strApplicationID,
                                                             FormsAuthentication.HashPasswordForStoringInConfigFile(TB_Password_OLd.Text, "MD5")))// checkPassword(.text)
                    {
                        //Delete Accounts
                        if (MatrimonialMemberShip.DeleteAccount(strApplicationID, L_MatID.Text))
                        {
                            //Clearing User Info From Clie
                            //Redirect to Homepage
                            Response.Redirect("logout.aspx?id=del");
                        }
                        else
                        {
                            //Show Server not responding
                            Server.Transfer("../Extras/ErrorReprot.aspx");
                        }
                    }
                    else
                    {
                        //Display Wrong Password
                        L_WrongPassword.Visible = true;
                        L_Check.Visible         = false;
                    }
                }
                else
                {
                    // User is supposed to check the box
                    L_Check.Visible         = true;
                    L_WrongPassword.Visible = false;
                } //else
            }     // if is valid

            CB_Del_acc.Checked = false;
        } //else
    }     // methode
Exemple #2
0
    //public bool Bind(string MatrimonialID)
    //{

    //    this.IsBookMark = false;
    //    this.IsRemove = false;
    //    bool boolFlag = false;

    //    /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //    Procedure Name : Member_GetInfo
    //     * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //    Type: SELECT
    //     * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //    Parameters :
    //     * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //                LastLogIN
    //                Country -  City
    //                Name
    //                DOB
    //                Religion - Cast
    //                MaritalStatus
    //                PhotoPassword
    //     * * * * * * * * * * * * * * * * * * * * * * * * * * * */

    //    using (SqlConnection objConnection = DBConnection.GetSqlConnection())
    //    {

    //        //try
    //        //{

    //        //
    //        //Creating Command object
    //        SqlCommand objCommand = new SqlCommand("Member_GetInfo", objConnection);
    //        objCommand.CommandType = CommandType.StoredProcedure;
    //        //Adding Parameters
    //        objCommand.Parameters.Add(new SqlParameter("@MatrimonialID", SqlDbType.VarChar));
    //        objCommand.Parameters["@MatrimonialID"].Value = MatrimonialID;

    //        //Databse Operations
    //        objConnection.Open();
    //        SqlDataReader objReader = objCommand.ExecuteReader();
    //        objReader.Read();
    //        //Getting Values
    //        L_Location.Text = ControlDataLoader.GetIndexValue(ControlDataLoader.ControlType.Country, Convert.ToInt16(objReader["Country"])) + " <br/> " + objReader["City"].ToString();
    //        L_Religion.Text = ControlDataLoader.GetIndexValue(ControlDataLoader.ControlType.Religion, Convert.ToSByte(objReader["Religion"])) + " - " + ControlDataLoader.GetIndexValue(ControlDataLoader.ControlType.Cast, Convert.ToSByte(objReader["Cast"]));
    //        L_MatID.Text = MatrimonialID;
    //        L_MS.Text = ControlDataLoader.GetIndexValue(ControlDataLoader.ControlType.MaritalStatus, Convert.ToSByte(objReader["MaritalStatus"]));

    //        L_Age.Text = "AGE : " + AgeCalculator(Convert.ToDateTime(objReader["DOB"])).ToString();
    //        //DateTime dateTemp = Convert.ToDateTime(objReader["LastLogIN"]);
    //        //L_LastLogIn.Text = dateTemp.Day.ToString() + "-" + dateTemp.Month.ToString() + "-" + dateTemp.Year.ToString();

    //        HF_ViewPF.NavigateUrl = "~/Member/PrintProfile.aspx?matid=" + Server.UrlEncode(Crypto.EnCrypto(MatrimonialID));

    //        try
    //        {
    //            if (objReader["PhotoPassword"].ToString() == "")
    //            {
    //                IMG_Main.ImageUrl = "~/Extras/imagecon.aspx?matid=" + MatrimonialID + "&id=1";
    //            }
    //            else
    //            {
    //                IMG_Main.ImageUrl = "~/Resources/photoLocked.gif";

    //            }
    //        }
    //        catch (Exception)
    //        {
    //            IMG_Main.ImageUrl = "~/Extras/imagecon.aspx?matid=" + MatrimonialID + "&id=1";
    //        }
    //        IMG_Main.ImageUrl = "~/Extras/imagecon.aspx?matid=" + MatrimonialID + "&id=1";
    //        objReader.Close();

    //        boolFlag = true;
    //        //}
    //        //catch (Exception)
    //        //{
    //        //    this.Visible = false;
    //        //    boolFlag = false;

    //        //}
    //        //finally
    //        //{
    //        //    objConnection.Close();
    //        //}

    //    }
    //    return boolFlag;

    //}

    public bool DeleteMe()
    {
        return(MatrimonialMemberShip.DeleteAccount(MatrimonialMemberShip.GetApplicationID(HF_ViewPF.Text), HF_ViewPF.Text));
    }
 public bool DeleteMe()
 {
     return(MatrimonialMemberShip.DeleteAccount(MatrimonialMemberShip.GetApplicationID(L_MatID.Text), L_MatID.Text));
 }