Switch Case In ASp.net For Clear Method
------------------------------------------------------------------
private void DesableEnableClear(string Status)
{
TextBox[] arr = { txtHeltID, txtHelthType };
switch (Status)
{
case "D":
foreach (TextBox txt in arr)
{
txt.Enabled = false;
}
txtHeltID.Text = "";
break;
case "E":
foreach (TextBox txt in arr)
{
txt.Enabled = true;
}
txtHeltID.Text = LoadMaxID();
break;
case "C":
foreach (TextBox txt in arr)
{ txt.Text = ""; }
btnSave.Enabled = true;
txtHeltID.Text = LoadMaxID();
break;
case "GL":
btnSave.Enabled = true;
btnDelete.Enabled = false;
btnUpdate.Enabled = false;
panelg.Visible = true;
break;
case "GR":
btnSave.Enabled = false;
btnDelete.Enabled = true;
btnUpdate.Enabled = true;
panelg.Visible = false;
break;
case "U":
btnSave.Enabled = true;
btnDelete.Enabled = false;
btnUpdate.Enabled = false;
panelg.Visible = false;
break;
case "SD":
lblSearch.Visible = false;
txtSearch.Visible = false;
break;
case "SE":
lblSearch.Visible = true;
txtSearch.Visible = true;
break;
default :
// Response.Write("Hello");
break;
} ////
------------------------------------------------------------------
private void DesableEnableClear(string Status)
{
TextBox[] arr = { txtHeltID, txtHelthType };
switch (Status)
{
case "D":
foreach (TextBox txt in arr)
{
txt.Enabled = false;
}
txtHeltID.Text = "";
break;
case "E":
foreach (TextBox txt in arr)
{
txt.Enabled = true;
}
txtHeltID.Text = LoadMaxID();
break;
case "C":
foreach (TextBox txt in arr)
{ txt.Text = ""; }
btnSave.Enabled = true;
txtHeltID.Text = LoadMaxID();
break;
case "GL":
btnSave.Enabled = true;
btnDelete.Enabled = false;
btnUpdate.Enabled = false;
panelg.Visible = true;
break;
case "GR":
btnSave.Enabled = false;
btnDelete.Enabled = true;
btnUpdate.Enabled = true;
panelg.Visible = false;
break;
case "U":
btnSave.Enabled = true;
btnDelete.Enabled = false;
btnUpdate.Enabled = false;
panelg.Visible = false;
break;
case "SD":
lblSearch.Visible = false;
txtSearch.Visible = false;
break;
case "SE":
lblSearch.Visible = true;
txtSearch.Visible = true;
break;
default :
// Response.Write("Hello");
break;
} ////
No comments:
Post a Comment