protected void lvBugs_ItemCommand(object sender, ListViewCommandEventArgs e)
{
switch (e.CommandName)
{
case "SortDescription":
BindBugsColumnsNames();
if (e.CommandArgument.ToString() == "ASC")
{
Asc = true;
SortExpression = "SortDescription";
if (hdnTab.Value == "projectBugs")
{
BindProjectBugs();
}
else
{
BindBugs();
}
LinkButton btnDescription = (LinkButton)lvBugs.FindControl("btnDescription");
if (btnDescription != null)
{
btnDescription.CommandArgument = "DESC";
btnDescription.Text += " <img src='../style/arrow_order_down.gif'/>";
}
}
else
{
Asc = false;
SortExpression = "SortDescription";
if (hdnTab.Value == "projectBugs")
{
BindProjectBugs();
}
else
{
BindBugs();
}
LinkButton btnDescription = (LinkButton)lvBugs.FindControl("btnDescription");
if (btnDescription != null)
{
btnDescription.CommandArgument = "ASC";
btnDescription.Text += " <img src='../style/arrow_order_up.gif'/>";
}
}
break;
case "SortPriority":
BindBugsColumnsNames();
if (e.CommandArgument.ToString() == "ASC")
{
Asc = true;
SortExpression = "SortPriority";
if (hdnTab.Value == "projectBugs")
{
BindProjectBugs();
}
else
{
BindBugs();
}
LinkButton bntPriority = (LinkButton)lvBugs.FindControl("btnPriority");
if (bntPriority != null)
{
bntPriority.CommandArgument = "DESC";
bntPriority.Text += " <img src='../style/arrow_order_down.gif'/>";
}
}
else
{
Asc = false;
SortExpression = "SortPriority";
if (hdnTab.Value == "projectBugs")
{
BindProjectBugs();
}
else
{
BindBugs();
}
LinkButton bntPriority = (LinkButton)lvBugs.FindControl("btnPriority");
if (bntPriority != null)
{
bntPriority.CommandArgument = "ASC";
bntPriority.Text += " <img src='../style/arrow_order_up.gif'/>";
}
}
break;
case "SortOwner":
BindBugsColumnsNames();
if (e.CommandArgument.ToString() == "ASC")
{
Asc = true;
SortExpression = "SortOwner";
if (hdnTab.Value == "projectBugs")
{
BindProjectBugs();
}
else
{
BindBugs();
}
LinkButton btnOwner = (LinkButton)lvBugs.FindControl("btnOwner");
if (btnOwner != null)
{
btnOwner.CommandArgument = "DESC";
btnOwner.Text += " <img src='../style/arrow_order_down.gif'/>";
}
}
else
{
Asc = false;
SortExpression = "SortOwner";
if (hdnTab.Value == "projectBugs")
{
BindProjectBugs();
}
else
{
BindBugs();
}
LinkButton btnOwner = (LinkButton)lvBugs.FindControl("btnOwner");
if (btnOwner != null)
{
btnOwner.CommandArgument = "ASC";
btnOwner.Text += " <img src='../style/arrow_order_up.gif'/>";
}
}
break;
case "SortProject":
BindBugsColumnsNames();
if (e.CommandArgument.ToString() == "ASC")
{
Asc = true;
SortExpression = "SortProject";
if (hdnTab.Value == "projectBugs")
{
BindProjectBugs();
}
else
{
BindBugs();
}
LinkButton btnProject = (LinkButton)lvBugs.FindControl("btnProject");
if (btnProject != null)
{
btnProject.CommandArgument = "DESC";
btnProject.Text += " <img src='../style/arrow_order_down.gif'/>";
}
}
else
{
Asc = false;
SortExpression = "SortProject";
if (hdnTab.Value == "projectBugs")
{
BindProjectBugs();
}
else
{
BindBugs();
}
LinkButton btnProject = (LinkButton)lvBugs.FindControl("btnProject");
if (btnProject != null)
{
btnProject.CommandArgument = "ASC";
btnProject.Text += " <img src='../style/arrow_order_up.gif'/>";
}
}
break;
case "SortStatus":
BindBugsColumnsNames();
if (e.CommandArgument.ToString() == "ASC")
{
Asc = true;
SortExpression = "SortStatus";
if (hdnTab.Value == "projectBugs")
{
BindProjectBugs();
}
else
{
BindBugs();
}
LinkButton btnStatus = (LinkButton)lvBugs.FindControl("btnStatus");
if (btnStatus != null)
{
btnStatus.CommandArgument = "DESC";
btnStatus.Text += " <img src='../style/arrow_order_down.gif'/>";
}
}
else
{
Asc = false;
SortExpression = "SortStatus";
if (hdnTab.Value == "projectBugs")
{
BindProjectBugs();
}
else
{
BindBugs();
}
LinkButton btnStatus = (LinkButton)lvBugs.FindControl("btnStatus");
if (btnStatus != null)
{
btnStatus.CommandArgument = "ASC";
btnStatus.Text += " <img src='../style/arrow_order_up.gif'/>";
}
}
break;
}
}