public static bool TraerListaLotes(string clot) { InterfazDAL_tticol127 idal = new InterfazDAL_tticol127(); DataTable dtListaLotes = idal.Lista_Lotes(clot); bool existencia = dtListaLotes.Rows.Count > 0; return(existencia); }
protected void btnSend_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtItem.Text.Trim())) { RequiredField.Enabled = true; RequiredField.IsValid = false; txtItem.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); return; } if (string.IsNullOrEmpty(txtLot.Text.Trim())) { RequiredFieldLot.Enabled = true; RequiredFieldLot.IsValid = false; txtLot.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); return; } // Validar si el usuario tiene almacen MRB asociado //Validar si el Item y Lote digitado son correctos InterfazDAL_tticol127 idal = new InterfazDAL_tticol127(); Ent_tticol127 obj = new Ent_tticol127(); string strError = string.Empty; obj.user = Session["user"].ToString().ToUpper(); obj.item = txtItem.Text.ToUpper(); obj.lote = txtLot.Text.ToUpper(); lblResult.Text = string.Empty; DataTable resultado = idal.listaRegistrosOrden_Param(ref obj, ref strError, ref strOrden); if (strError != string.Empty) { txtItem.Text = ""; txtLot.Text = ""; txtItem.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); lblResult.Text = strError; return; } else { grdRecords.DataSource = resultado; grdRecords.DataBind(); Session["Orden"] = strOrden; Session["Lote"] = txtLot.Text.ToUpperInvariant(); this.HeaderGrid.Visible = true; btnSave.Visible = true; lblResult.Text = ""; } }
protected void btnSend_Click(object sender, EventArgs e) { Session["txtItem"] = txtItem.Text.ToUpper(); Session["txtLot"] = string.IsNullOrEmpty(txtLot.Text.ToUpper()) || string.IsNullOrWhiteSpace(txtLot.Text.ToUpper()) ? " " : txtLot.Text.ToUpper(); if (string.IsNullOrEmpty(txtItem.Text.Trim())) { RequiredField.Enabled = true; RequiredField.IsValid = false; txtItem.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); return; } //if (string.IsNullOrEmpty(txtLot.Text.Trim())) //{ // RequiredFieldLot.Enabled = true; // RequiredFieldLot.IsValid = false; // txtLot.Focus(); // btnSave.Visible = false; // grdRecords.DataSource = ""; // grdRecords.DataBind(); // return; //} // Validar si el usuario tiene almacen MRB asociado //Validar si el Item y Lote digitado son correctos InterfazDAL_tticol127 idal = new InterfazDAL_tticol127(); Ent_tticol127 obj = new Ent_tticol127(); string strError = string.Empty; obj.user = Session["user"].ToString().ToUpper(); obj.item = Session["txtItem"].ToString(); obj.lote = Session["txtLot"].ToString(); lblResult.Text = string.Empty; DataTable resultado = idal.listaRegistrosOrden_Param(ref obj, ref strError, ref strOrden); if (strError != string.Empty) { txtItem.Text = ""; txtLot.Text = ""; txtItem.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); lblResult.Text = strError.StartsWith("User") ? mensajes("notwarehouseuser") : strError.StartsWith("Lot") ? mensajes("lotnotexists") : strError.StartsWith("Item") && strError.Contains("MRB") ? mensajes("notstockitem") : mensajes("itemnotexists"); return; } else { grdRecords.DataSource = resultado; grdRecords.DataBind(); grdRecords.DataSource = resultado; grdRecords.DataBind(); Session["Orden"] = strOrden; Session["Lote"] = txtLot.Text.ToUpperInvariant(); this.HeaderGrid.Visible = true; //btnSave.Visible = true; lblResult.Text = ""; } txtItem.Text = ""; txtLot.Text = ""; }