if (sMode == "view")
{
// process for showing user detail to administrator
// write code to get user detail
DataTable dtViewData = null;
string sStatusTmp = lib.getCurrentStatus(sCompany,sLocation, sEmpCode.Trim());
dtViewData = lib.ViewData(sCompany, sLocation,sEmpCode);
if (dtViewData != null)
{
label1.Text = dtViewData.Rows[0].ItemArray[2].ToString();
Label2.Text = dtViewData.Rows[0].ItemArray[7].ToString();
TextBox1.Text = dtViewData.Rows[0].ItemArray[3].ToString();
label5.Text = dtViewData.Rows[0].ItemArray[4].ToString();
label3.Text = dtViewData.Rows[0].ItemArray[5].ToString();
label4.Text = dtViewData.Rows[0].ItemArray[6].ToString();
btnSubmit.Enabled = false;
TextBox1.Enabled = false;
label5.Enabled = false;
}
}
else
{
string sStatusTmp = lib.getCurrentStatus(sCompany, sLocation, sEmpCode.Trim());
label1.Text = sEmpCode;
Label2.Text = DateTime.Now.ToShortDateString();
// show blank below feild to user - user will fill the feild.
TextBox1.Text = sexpense;
label5.Text = sexpensetxt;
DataTable dtdate = lib.getdateDetail("MCL", "RNV", sEmpCode);
label3.Text = dtdate.Rows[0].ItemArray[0].ToString();
label4.Text = dtdate.Rows[0].ItemArray[1].ToString();
}
}
Thanks a lot...