protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Button      request     = e.Item.FindControl("btnrequest") as Button;
            Button      ViewProfile = e.Item.FindControl("btnprofile") as Button;
            HiddenField hId         = e.Item.FindControl("hiddid") as HiddenField;
            int         confrim     = 0;
            int         delete      = 0;
            int         equal       = 0;
            ds    = objdf.FillDsS("select * from RequestMaster where Sender_Id = '" + Session["id"] + "' and Recevier_Id = '" + hId.Value + "' or Recevier_Id = '" + Session["id"] + "' and Sender_Id = '" + hId.Value + "'");
            equal = ds.Tables[0].Rows.Count;

            if (ds.Tables[0].Rows.Count > 0)
            {
                request.Enabled = false;
            }
            ds      = objdf.FillDsS("select * from RequestMaster where Sender_Id = '" + Session["id"] + "' and Recevier_Id = '" + hId.Value + "' and  Confrim = '" + 1 + "' or Recevier_Id = '" + Session["id"] + "' and Sender_Id = '" + hId.Value + "'and  Confrim = '" + 1 + "'");
            confrim = ds.Tables[0].Rows.Count;
            if (confrim == 1)
            {
                ViewProfile.Visible = true;
                request.Visible     = false;
            }
            ds     = objdf.FillDsS("select * from RequestMaster where Sender_Id = '" + Session["id"] + "' and Recevier_Id = '" + hId.Value + "' and  _Delete = '" + 1 + "' or Recevier_Id = '" + Session["id"] + "' and Sender_Id = '" + hId.Value + "'and  _Delete = '" + 1 + "'");
            delete = ds.Tables[0].Rows.Count;
            if (delete == equal)
            {
                ViewProfile.Visible = false;
                request.Enabled     = true;
            }
        }
    }
    public void FillDataddl()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from Country");

        ddlcountry.DataSource     = ds;
        ddlcountry.DataTextField  = "country";
        ddlcountry.DataValueField = "id";
        ddlcountry.DataBind();

        ddlcountry.Items.Insert(0, new ListItem("Select Country*", "0"));
        ddlstate.Items.Insert(0, new ListItem("Select State*", "0"));
        ddlcity.Items.Insert(0, new ListItem("Select City*", "0"));

        FillGender();
        ddlgender.Items.Insert(0, new ListItem("Select Gender*", "0"));
        FillMotherTongue();
        ddlmothertongue.Items.Insert(0, new ListItem("Select MotherTongue*", "0"));
        FillReligion();
        ddlreligion.Items.Insert(0, new ListItem("Select Religion*", "0"));
        FillProfileFor();
        ddlprofilefor.Items.Insert(0, new ListItem("Select ProfileFor*", "0"));
    }
Esempio n. 3
0
    public void Count_1()
    {
        int count = 0;

        ds    = objdf.FillDsS("select * from RequestMaster where Sender_Id = '" + Session["id"] + "' and Confrim ='" + 0 + "' and _Delete ='" + 0 + "'");
        ds2   = objdf.FillDsS("Select Count_1 from Count_Master where Person_Id = '" + Session["id"] + "'");
        count = Convert.ToInt32(ds2.Tables[0].Rows[0]["Count_1"].ToString());
        if (ds.Tables[0].Rows.Count > count)
        {
            count = ds.Tables[0].Rows.Count - count;
            lblSentRequest.Text = count.ToString();
            count = ds.Tables[0].Rows.Count;

            SqlParameter[] param = new SqlParameter[2];
            param[0]       = new SqlParameter("@userid", SqlDbType.Int);
            param[0].Value = Session["id"];
            param[1]       = new SqlParameter("@Count_1", SqlDbType.Int);
            param[1].Value = count;
            int result = objdf.ExecuteQuery("usp_UpdateCount1", param);
            if (result > 0)
            {
                //Response.Write("<script>alert(' sent Count 1 Updated Successfully')</script>");
            }
        }
        else
        {
            if (ds.Tables[0].Rows.Count < count)
            {
                count = ds.Tables[0].Rows.Count;
                //lblSentRequest.Text = null;
                SqlParameter[] param = new SqlParameter[2];
                param[0]       = new SqlParameter("@userid", SqlDbType.Int);
                param[0].Value = Session["id"];
                param[1]       = new SqlParameter("@Count_1", SqlDbType.Int);
                param[1].Value = count;
                int result = objdf.ExecuteQuery("usp_UpdateCount1", param);
                if (result > 0)
                {
                    //Response.Write("<script>alert('sent Count 2 Updated Successfully')</script>");
                }
            }
        }
    }
    public void FillProfileFor()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from ProfileFor");

        ddlprofilefor.DataSource     = ds;
        ddlprofilefor.DataTextField  = "profilefor";
        ddlprofilefor.DataValueField = "id";
        ddlprofilefor.DataBind();
    }
    public void FillGender()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from Gender");

        ddlgender.DataSource     = ds;
        ddlgender.DataTextField  = "gender";
        ddlgender.DataValueField = "id";
        ddlgender.DataBind();
    }
    public void FillMotherTongue()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from MotherTongue");

        ddlmothertongue.DataSource     = ds;
        ddlmothertongue.DataTextField  = "mothertongue";
        ddlmothertongue.DataValueField = "id";
        ddlmothertongue.DataBind();
    }
    public void FillReligion()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from Religion");

        ddlreligion.DataSource     = ds;
        ddlreligion.DataTextField  = "religion";
        ddlreligion.DataValueField = "id";
        ddlreligion.DataBind();
    }
    public void FillHobbies()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from Hobbies");

        ddldrinking.DataSource     = ds;
        ddldrinking.DataTextField  = "hobbies";
        ddldrinking.DataValueField = "id";
        ddldrinking.DataBind();
        ddldrinking.Items.Insert(0, new ListItem("Drinking / Smoking*", "0"));
    }
    public void FillEmployeein()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from EmployeeIn");

        ddlemployee.DataSource     = ds;
        ddlemployee.DataTextField  = "employeein";
        ddlemployee.DataValueField = "id";
        ddlemployee.DataBind();
        ddlemployee.Items.Insert(0, new ListItem("Employee In*", "0"));
    }
    public void FillHeight()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from Height");

        ddlheight.DataSource     = ds;
        ddlheight.DataTextField  = "height";
        ddlheight.DataValueField = "id";
        ddlheight.DataBind();
        ddlheight.Items.Insert(0, new ListItem("Height*", "0"));
    }
    public void FillFamily()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from FamilyStatus");

        ddlfamilystatus.DataSource     = ds;
        ddlfamilystatus.DataTextField  = "familystatus";
        ddlfamilystatus.DataValueField = "id";
        ddlfamilystatus.DataBind();
        ddlfamilystatus.Items.Insert(0, new ListItem("Family Status*", "0"));
    }
    public void FillMarital()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from MaritalStatus");

        ddlmaritalstatus.DataSource     = ds;
        ddlmaritalstatus.DataTextField  = "maritalstatus";
        ddlmaritalstatus.DataValueField = "id";
        ddlmaritalstatus.DataBind();
        ddlmaritalstatus.Items.Insert(0, new ListItem("Marital Status*", "0"));
    }
    public void FilllLiving()
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from LivingStatus");

        ddlfamily.DataSource     = ds;
        ddlfamily.DataTextField  = "livingstatus";
        ddlfamily.DataValueField = "id";
        ddlfamily.DataBind();
        ddlfamily.Items.Insert(0, new ListItem("You live with youe family?", "0"));
    }
Esempio n. 14
0
    protected void ddlstate_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataFunction objdf = new DataFunction();
        DataSet      ds    = new DataSet();

        ds = objdf.FillDsS("select * from CityMaster where stateid =" + ddlstate.SelectedValue);

        ddlcity.DataSource = ds;

        ddlcity.DataTextField  = "city";
        ddlcity.DataValueField = "id";
        ddlcity.DataBind();
        ddlcity.Items.Insert(0, new ListItem("Select City*", "0"));
    }
Esempio n. 15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["username"] == null)
     {
         Response.Redirect("loginpage.aspx");
     }
     else
     {
         if (!IsPostBack)
         {
             ds = objdf.FillDsS("select * from UserMaster um where um.id = '" + Session["id"] + "'");
             Session["username"] = ds.Tables[0].Rows[0]["username"].ToString();
             lblusername.Text    = "Hi" + " " + Session["username"];
             Userprofiledetails();
         }
     }
 }
    protected void btnlogin_Click(object sender, EventArgs e)
    {
        ds = objdf.FillDsS("select * from UserMaster where useremail ='" + txtloginemail.Text + "' AND userpassword ='******'");


        if (ds.Tables[0].Rows.Count > 0)
        {
            int id = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString());
            Session["username"] = ds.Tables[0].Rows[0]["username"];
            Session["id"]       = ds.Tables[0].Rows[0]["id"];
            Response.Redirect("home.aspx?id=" + id);
        }
        else
        {
            Response.Write("<script>alert('username and passwors are wrong')</script>");
        }
    }
Esempio n. 17
0
    protected void ddlcountry_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataFunction objdf = new DataFunction();

        DataSet ds = new DataSet();

        ds = objdf.FillDsS("select * from StateMaster where countryid=" + ddlcountry.SelectedIndex);



        ddlstate.DataSource = ds;

        ddlstate.DataTextField  = "state";
        ddlstate.DataValueField = "id";

        ddlstate.DataBind();

        ddlstate.Items.Insert(0, new ListItem("Select State*", "0"));
    }
Esempio n. 18
0
    protected void btnverify_Click(object sender, EventArgs e)
    {
        if (txtverify.Text == ViewState["msgotp"].ToString())
        {
            Response.Write("<script>alert('otp verifyed')</script>");

            ds = objdf.FillDsS("select * from UserMaster where useremail ='" + txtemail.Text + "'");


            if (ds.Tables[0].Rows.Count > 0)
            {
                Session["username"] = ds.Tables[0].Rows[0]["username"];
                Session["id"]       = ds.Tables[0].Rows[0]["id"].ToString();

                Response.Redirect("home.aspx");
            }
        }
        else
        {
            Response.Write("<script>alert('otp not verifyed')</script>");
        }
        txtverify.Text = "";
    }