protected void gvSelectBroken_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
 {
     GridViewRow gvr = ((GridView)sender).Rows[e.NewSelectedIndex]; if (gvr == null) return;
     Literal lit = (Literal)WebTools.FindControlById("litSelectedBrokenCode", gvr); if (lit == null) return;
     footBroken = WarrantyContent.GetBroken(lit.Text);
     if (_addExchange) SetAvtiveView(vwAddExchangeIndex); else SetAvtiveView(vwMainIndex);
     if (_addExchange) AddExchange1.AddBrokenTofoot(footBroken);
 }
    protected void btnFindBroken_Click(object sender, EventArgs e)
    {
        string brokenNum;
        if (_addExchange)
        {
            brokenNum = AddExchange1.GetLookingBrokenNumber();
        }
        else { brokenNum = ""; }

        odsSelectBroken.SelectParameters["fromCode"] = new Parameter("fromCode", TypeCode.String, brokenNum);
        gvSelectBroken.PageIndex = 0;
        gvSelectBroken.DataBind();

        if (gvSelectBroken.Rows.Count == 1)
        {
            GridViewRow gvr = gvSelectBroken.Rows[0]; if (gvr == null) return;
            Literal lit = (Literal)WebTools.FindControlById("litSelectedBrokenCode", gvr);
            if (lit != null) footBroken = WarrantyContent.GetBroken(lit.Text);
            if (_addExchange) AddExchange1.AddBrokenTofoot(footBroken);
        }
        else if (gvSelectBroken.Rows.Count > 1) SetAvtiveView(vwAddBrokenIndex);
        else
        {
            if (_addExchange) SetAvtiveView(vwAddExchangeIndex); else SetAvtiveView(vwMainIndex);
            AddError(WarrantyContentErrorCode.BrokenCodeNotFound);
        }
    }