예제 #1
0
        private void btnYES_Click(object sender, System.EventArgs e)
        {
            DataTable dtSpareEquip = null;

            try
            {
                equip        = new clsEquipment();
                equip.iOrgId = OrgId;
                equip.iId    = EquipId;
                dtSpareEquip = equip.GetSpareEquipList();

                if (dtSpareEquip.Rows.Count > 0)
                {                 // view spare equipments
                    pnlSelectSpare.Visible  = true;
                    pnlNoSpare.Visible      = false;
                    pnlViewQuestion.Visible = false;

                    repSpareEquip.DataSource = new DataView(dtSpareEquip);
                    repSpareEquip.DataBind();
                }
                else
                {
                    // no spare
                    pnlNoSpare.Visible      = true;
                    pnlSelectSpare.Visible  = false;
                    pnlViewQuestion.Visible = false;
                    btnBack.Visible         = false;

                    NextBackControl.sCSSClass = "ok_input_button";
                    if (Operation == "CheckIn")
                    {
                        NextBackControl.BackText = "<< Back";
                        NextBackControl.BackPage = BackPage;
                        NextBackControl.NextText = "Continue >>";
                    }
                    else
                    {
                        NextBackControl.NextText    = "Back to Main Menu";
                        NextBackControl.BackVisible = false;
                    }
                }
            }
            catch (Exception ex)
            {
                _functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
                Session["lastpage"]     = CurrentPage;
                Session["error"]        = ex.Message;
                Session["error_report"] = ex.ToString();
                Response.Redirect("error.aspx", false);
            }
            finally
            {
                if (equip != null)
                {
                    equip.Dispose();
                }
            }
        }