Beispiel #1
0
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(GridView1.SelectedRow.Cells[3].Text);

        DataSet ds = new DataSet();

        ds = objlogindal.selectLoginByID(id);

        if (ds.Tables[0].Rows.Count > 0)
        {
            txtcreatedate.Text       = Convert.ToDateTime(ds.Tables [0].Rows[0]["createdate"].ToString()).ToString("yyyy-MM-dd");
            txtsecureanswer.Text     = ds.Tables[0].Rows[0]["secureanswer"].ToString();
            txtsecurityquestion.Text = ds.Tables[0].Rows[0]["securityquestion"].ToString();
            txtusername.Text         = ds.Tables[0].Rows[0]["username"].ToString();


            for (int i = 0; i < drpuserrole.Items.Count; i++)
            {
                if (drpuserrole.Items[i].Text == ds.Tables[0].Rows[0]["userrole"].ToString())
                {
                    drpuserrole.SelectedIndex = i;
                }
            }

            for (int i = 0; i < drpaccountstatus.Items.Count; i++)
            {
                if (drpaccountstatus.Items[i].Text == ds.Tables[0].Rows[0]["accountstatus"].ToString())
                {
                    drpaccountstatus.SelectedIndex = i;
                }
            }
            btnsubmit.Text             = "Update";
            MultiView1.ActiveViewIndex = 1;
        }
    }
Beispiel #2
0
    public void bindprofile()
    {
        DataSet dscustomer = new DataSet();

        dscustomer = objcustomerdal.selectCustomerByLoginID(Convert.ToInt32(Session["loginid"].ToString()));

        DataSet dslogin = new DataSet();

        dslogin = objlogindal.selectLoginByID(Convert.ToInt32(Session["loginid"].ToString()));

        if (dscustomer.Tables[0].Rows.Count > 0 && dslogin.Tables[0].Rows.Count > 0)
        {
            txtfirstname.Text = dscustomer.Tables[0].Rows[0]["firstname"].ToString();
            txtlastname.Text  = dscustomer.Tables[0].Rows[0]["lastname"].ToString();
            txtaddress.Text   = dscustomer.Tables[0].Rows[0]["address"].ToString();
            txtpincode.Text   = dscustomer.Tables[0].Rows[0]["pincode"].ToString();
            txtmobile.Text    = dscustomer.Tables[0].Rows[0]["mobile"].ToString();
            txtemail.Text     = dscustomer.Tables[0].Rows[0]["email"].ToString();
            txtdob.Text       = Convert.ToDateTime(dscustomer.Tables[0].Rows[0]["dob"].ToString()).ToString("yyyy-MM-dd");

            txtusername.Text         = dslogin.Tables[0].Rows[0]["username"].ToString();
            txtsecurityquestion.Text = dslogin.Tables[0].Rows[0]["securityquestion"].ToString();
            txtsecureanswer.Text     = dslogin.Tables[0].Rows[0]["secureanswer"].ToString();

            for (int i = 0; i < drpstate.Items.Count; i++)
            {
                if (drpstate.Items[i].Text == dscustomer.Tables[0].Rows[0]["statename"].ToString())
                {
                    drpstate.SelectedIndex = i;
                }
            }
            bindcity(Convert.ToInt32(drpstate.SelectedValue));
            for (int i = 0; i < drpcity.Items.Count; i++)
            {
                if (drpcity.Items[i].Text == dscustomer.Tables[0].Rows[0]["cityname"].ToString())
                {
                    drpcity.SelectedIndex = i;
                }
            }

            for (int i = 0; i < drpgender.Items.Count; i++)
            {
                if (drpgender.Items[i].Text == dscustomer.Tables[0].Rows[0]["gender"].ToString())
                {
                    drpgender.SelectedIndex = i;
                }
            }
        }
    }
    public void bindprofile()
    {
        DataSet dsprovider = new DataSet();

        dsprovider = objserviceproviderdal.selectServiceProviderByLoginID(Convert.ToInt32(Session["loginid"].ToString()));


        DataSet dslogin = new DataSet();

        dslogin = objlogindal.selectLoginByID(Convert.ToInt32(Session["loginid"].ToString()));

        txtserviceprovidername.Text = dsprovider.Tables[0].Rows[0]["serviceprovidername"].ToString();
        txtaddress.Text             = dsprovider.Tables[0].Rows[0]["address"].ToString();
        txtpincode.Text             = dsprovider.Tables[0].Rows[0]["pincode"].ToString();
        txtmobile.Text  = dsprovider.Tables[0].Rows[0]["mobile"].ToString();
        txtemail.Text   = dsprovider.Tables[0].Rows[0]["email"].ToString();
        txtwebsite.Text = dsprovider.Tables[0].Rows[0]["website"].ToString();
        txtaboutserviceprovider.Text = dsprovider.Tables[0].Rows[0]["aboutserviceprovider"].ToString();

        for (int i = 0; i < drpstate.Items.Count; i++)
        {
            if (drpstate.Items[i].Text == dsprovider.Tables[0].Rows[0]["statename"].ToString())
            {
                drpstate.SelectedIndex = i;
            }
        }
        bindcity(Convert.ToInt32(drpstate.SelectedValue));

        for (int i = 0; i < drpcity.Items.Count; i++)
        {
            if (drpcity.Items[i].Text == dsprovider.Tables[0].Rows[0]["cityname"].ToString())
            {
                drpcity.SelectedIndex = i;
            }
        }
        for (int i = 0; i < drpserviceprovidertype.Items.Count; i++)
        {
            if (drpserviceprovidertype.Items[i].Text == dsprovider.Tables[0].Rows[0]["serviceprovidertype"].ToString())
            {
                drpserviceprovidertype.SelectedIndex = i;
            }
        }


        txtusername.Text         = dsprovider.Tables[0].Rows[0]["username"].ToString();
        txtsecurityquestion.Text = dsprovider.Tables[0].Rows[0]["securityquestion"].ToString();
        txtsecureanswer.Text     = dsprovider.Tables[0].Rows[0]["secureanswer"].ToString();
    }