protected void ServicesList_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            if (e.CommandName == "View")
            {
                MessageUserControl.TryRun(() =>
                {
                    ViewServiceDetail.Enabled = true;
                    ViewServiceDetail.Visible = true;

                    var description = e.Item.FindControl("DescriptionLabel") as Label;
                    var comments    = e.Item.FindControl("HiddenFieldComments") as HiddenField;
                    var hours       = e.Item.FindControl("HiddenFieldHours") as HiddenField;
                    var SDID        = e.Item.FindControl("HiddenFieldSDID") as HiddenField;

                    ViewDescriptionText.Text  = description.Text;
                    ViewHoursText.Text        = hours.Value;
                    ViewCommentsText.Text     = comments.Value;
                    ViewServiceDetailID.Value = SDID.Value;
                }, "Success", "Data Found");
            }

            if (e.CommandName == "Start")
            {
                MessageUserControl.TryRun(() =>
                {
                    var SDID       = e.Item.FindControl("HiddenFieldSDID") as HiddenField;
                    int pkey       = int.Parse(SDID.Value);
                    var controller = new JobingController();
                    controller.UpdateServiceDetailStatusAsS(pkey);
                    ServicesList.DataBind();
                }, "Success", "The selected Service Detail is started and all parts needed have been taken out from inventory");
            }
            if (e.CommandName == "Done")
            {
                MessageUserControl.TryRun(() =>
                {
                    var SDID       = e.Item.FindControl("HiddenFieldSDID") as HiddenField;
                    int pkey       = int.Parse(SDID.Value);
                    var controller = new JobingController();
                    controller.UpdateServiceDetailStatusAsD(pkey);
                    ServicesList.DataBind();
                }, "Success", "The selected Service Detail is closed and cannot be edited any more.");
            }
            if (e.CommandName == "Remove")
            {
                MessageUserControl.TryRun(() =>
                {
                    var SDID             = e.Item.FindControl("HiddenFieldSDID") as HiddenField;
                    int pkey             = int.Parse(SDID.Value);
                    POCOServiceDetail SD = new POCOServiceDetail();
                    SD.ServiceDetailID   = pkey;
                    var controller       = new JobingController();
                    controller.RemoveServiceDetail(SD);
                    ServicesList.DataBind();
                }, "Success", "The selected Service Detail is Removed. If the last service detail of this job is removed then the job will be deleted. And all service detail parts records will be deleted");
            }
        }
        protected void ShowAllJobs_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            if (e.CommandName == "View")
            {
                MessageUserControl.TryRun(() =>
                {
                    ViewJobPanel.Enabled     = true;
                    ViewJobPanel.Visible     = true;
                    CurrentJobList.Enabled   = false;
                    CurrentJobList.Visible   = false;
                    NewJobPanel.Enabled      = false;
                    NewJobPanel.Visible      = false;
                    CouponList.SelectedIndex = 0;
                    Description.Text         = null;
                    Hours.Text         = null;
                    Comment.Text       = null;
                    var jobID          = e.Item.FindControl("JobIDLabel") as Label;
                    var customerName   = e.Item.FindControl("CustomerFullName") as Label;
                    var phone          = e.Item.FindControl("Phone") as Label;
                    JobIDLabel2.Text   = jobID.Text;
                    CustomerLabel.Text = "Customer: " + customerName.Text;
                    ContactLabel.Text  = "Contact: " + phone.Text;
                    ServiceDetails.DataBind();
                }, "Success", "Data found");
            }

            if (e.CommandName == "Serving")
            {
                MessageUserControl.TryRun(() =>
                {
                    ViewServicePanel.Enabled  = true;
                    ViewServicePanel.Visible  = true;
                    ViewServiceDetail.Enabled = false;
                    ViewServiceDetail.Visible = false;
                    CurrentJobList.Enabled    = false;
                    CurrentJobList.Visible    = false;
                    NewJobPanel.Enabled       = false;
                    NewJobPanel.Visible       = false;
                    var jobID           = e.Item.FindControl("JobIDLabel") as Label;
                    var customerName    = e.Item.FindControl("CustomerFullName") as Label;
                    var phone           = e.Item.FindControl("Phone") as Label;
                    JobIDLabel4.Text    = jobID.Text;
                    CustomerLabel2.Text = "Customer: " + customerName.Text;
                    ContactLabel2.Text  = "Contact: " + phone.Text;
                    ServicesList.DataBind();
                }, "Success", "Data found");
            }
        }