default.aspx.cs page:
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class Admin_Updatedoctors : System.Web.UI.Page
{
BAL bal = new BAL();
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
Binddata();
}
protected void Binddata()
{
try
{
ds = bal.getdoctors();
gvdisplay.DataSource = ds;
gvdisplay.DataBind();
}
catch (Exception ex)
{
lblerrmsg.Text = ex.Message;
}
}
protected void gvdisplay_Click(object sender, GridViewCommandEventArgs e)
{
try
{
Int64 str = Convert.ToInt64(e.CommandArgument);
if (e.CommandName == "Eedit")
{
ds = bal.getsingledoctor(str);
txtdoctorid.Text = ds.Tables[0].Rows[0][0].ToString();
txtname.Text = ds.Tables[0].Rows[0][1].ToString();
txtspecialisation.Text = ds.Tables[0].Rows[0][2].ToString();
txtphonenumber.Text = ds.Tables[0].Rows[0][3].ToString();
txtemail.Text = ds.Tables[0].Rows[0][4].ToString();
txtcity.Text = ds.Tables[0].Rows[0][5].ToString();
txtstate.Text = ds.Tables[0].Rows[0][6].ToString();
txtcountry.Text = ds.Tables[0].Rows[0][7].ToString();
txtgender.Text = ds.Tables[0].Rows[0][8].ToString();
updatepnl.Visible = true;
}
else
{
lblerrmsg.Text = "cant edit";
}
}
catch (Exception ex)
{
lblerrmsg.Text = ex.Message;
}
}
}
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class Admin_Updatedoctors : System.Web.UI.Page
{
BAL bal = new BAL();
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
Binddata();
}
protected void Binddata()
{
try
{
ds = bal.getdoctors();
gvdisplay.DataSource = ds;
gvdisplay.DataBind();
}
catch (Exception ex)
{
lblerrmsg.Text = ex.Message;
}
}
protected void gvdisplay_Click(object sender, GridViewCommandEventArgs e)
{
try
{
Int64 str = Convert.ToInt64(e.CommandArgument);
if (e.CommandName == "Eedit")
{
ds = bal.getsingledoctor(str);
txtdoctorid.Text = ds.Tables[0].Rows[0][0].ToString();
txtname.Text = ds.Tables[0].Rows[0][1].ToString();
txtspecialisation.Text = ds.Tables[0].Rows[0][2].ToString();
txtphonenumber.Text = ds.Tables[0].Rows[0][3].ToString();
txtemail.Text = ds.Tables[0].Rows[0][4].ToString();
txtcity.Text = ds.Tables[0].Rows[0][5].ToString();
txtstate.Text = ds.Tables[0].Rows[0][6].ToString();
txtcountry.Text = ds.Tables[0].Rows[0][7].ToString();
txtgender.Text = ds.Tables[0].Rows[0][8].ToString();
updatepnl.Visible = true;
}
else
{
lblerrmsg.Text = "cant edit";
}
}
catch (Exception ex)
{
lblerrmsg.Text = ex.Message;
}
}
}
No comments:
Post a Comment