示例#1
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtWorkOrder.Text.Trim()))
            {
                minlenght.Enabled      = true;
                minlenght.ErrorMessage = "Work Order is required";
                minlenght.IsValid      = false;

                return;
            }

            InterfazDAL_tticol125 idal = new InterfazDAL_tticol125();
            Ent_tticol125         obj  = new Ent_tticol125();
            string strError            = string.Empty;

            txtWorkOrder.Text = txtWorkOrder.Text.ToUpperInvariant();
            obj.pdno          = txtWorkOrder.Text.ToUpperInvariant();
            resultado         = idal.listaRegistrosOrden_Param(ref obj, ref strError, true); //DataTable resultado = TABLA; //

            string findIn = string.Empty;

            // Validar si el numero de orden trae registros
            if (strError != string.Empty || resultado.Rows.Count < 1)
            {
                strError = string.Empty;
                // Si no encuentra registros en la principal busca en historico
                resultado = idal.listaRegistrosOrden_ParamHis(ref obj, ref strError);
                if (strError != string.Empty || resultado.Rows.Count < 1)
                {
                    OrderError.IsValid = false;
                    txtWorkOrder.Focus();
                    grdRecords.DataSource = "";
                    grdRecords.DataBind();
                    return;
                }
                findIn            = " [ Find in  History ]";
                Session["update"] = 1;
            }

            lblOrder.Text         = "Order: " + obj.pdno + findIn;
            grdRecords.DataSource = resultado;
            grdRecords.DataBind();

            if (Session["resultado"] == null)
            {
                Session["resultado"] = resultado;
            }
        }