public DataTable listaRegistrosOrden_Param(ref Ent_tticol125 parametros) { //System.Collections.Generic.List<EntidadRecuperaClientes> lista = new System.Collections.Generic.List<EntidadRecuperaClientes>(); DataTable lista; //= new System.Collections.Generic.List<EntidadRecuperaClientes>(); InterfazDAL_tticol125 interfazDAL = new InterfazDAL_tticol125(); string strError = string.Empty; try { lista = interfazDAL.listaRegistrosOrden_Param(ref parametros, ref strError); // int i = list.get_Count(); } catch (System.TimeoutException e1) { throw new System.Exception(e1.StackTrace); } catch (System.ServiceModel.FaultException e2) { throw new System.Exception(e2.Reason.ToString()); } catch (System.Exception e3) { throw new System.Exception(strError); } return(lista); }
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; } }
protected void btnSend_Click(object sender, EventArgs e) { btnSave.Visible = false; if (string.IsNullOrEmpty(txtWorkOrder.Text.Trim())) { RequiredField.Enabled = true; RequiredField.IsValid = false; txtWorkOrder.Focus(); grdRecords.DataSource = ""; grdRecords.DataBind(); return; } lblOrder.Visible = true; 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(); lblResult.Text = string.Empty; DataTable resultado = idal.listaRegistrosOrden_Param(ref obj, ref strError); // Validar si el numero de orden trae registros if (strError != string.Empty) { OrderError.IsValid = false; txtWorkOrder.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); return; } lblOrder.Text = "Order: " + obj.pdno; grdRecords.DataSource = resultado; grdRecords.DataBind(); this.HeaderGrid.Visible = true; btnSave.Visible = true; lblResult.Text = ""; }
protected void printLabel_Click(object sender, EventArgs e) { InterfazDAL_tticol125 idal = new InterfazDAL_tticol125(); Ent_tticol125 obj = new Ent_tticol125(); string strError = string.Empty; obj.pdno = txtWorkOrder.Text; lblResult.Text = string.Empty; DataTable resultado = idal.listaRegistrosOrden_Param(ref obj, ref strError, true); // Validar si el numero de orden trae registros if (strError != string.Empty) { string MsgError = OrderError.ErrorMessage; OrderError.ErrorMessage = mensajes("worktag"); OrderError.ForeColor = System.Drawing.Color.Red; OrderError.IsValid = false; OrderError.ErrorMessage = MsgError; return; } //lblOrder.Text = _idioma == "INGLES" ? "Order: " : "Orden: " + obj.pdno; Session["resultado"] = resultado; Session["RemotePrint"] = "yes"; StringBuilder paramurl = new StringBuilder(); paramurl.Append("?"); paramurl.Append("valor1=" + Request.QueryString[0].ToString() + "&"); paramurl.Append("valor2=" + Request.QueryString[1].ToString() + "&"); paramurl.Append("valor3=" + Request.QueryString[2].ToString()); Session["IsPreviousPage"] = ""; //Server.Transfer("whInvMaterialDevolReprintLabel.aspx", true); Response.Redirect("whInvMaterialDevolReprintLabel.aspx" + paramurl.ToString()); // //grdRecords.DataSource = resultado; // //grdRecords.DataBind(); // printResult.Visible = false; // string printerHtml = printerDiv.InnerHtml; // printerDiv.Style.Add(HtmlTextWriterStyle.BackgroundColor, "White"); // printerDiv.Style.Add(HtmlTextWriterStyle.Height, "400px"); // printerDiv.Style.Add(HtmlTextWriterStyle.Width, "500px"); //// printerDiv.Style.Add(HtmlTextWriterStyle., BorderStyle.Solid.ToString()); // foreach (DataRow reg in resultado.Rows) // { // if (scriptBlock.IsClientScriptBlockRegistered("printTag")) // { // scriptBlock.RegisterClientScriptBlock(csType, "printTag", string.Empty, false); // } // DataRow drv = reg; // Session["FilaImprimir"] = reg; // printerDiv.InnerHtml = printerHtml; // // // Validar que la division exista en el documento // Control div = FindControl("printer"); // if (div == null) // { // // this.Controls.Add(createDiv); // } // printerDiv.InnerHtml = "<iframe src='../Labels/whInvPrintLabel.aspx' width='100%'; height='100%'; onload='this.contentWindow.print()></iframe>"; // // printerDiv.Focus(); // //csType = this.GetType(); // //scriptBlock = Page.ClientScript; // //scriptBlock.RegisterClientScriptBlock(csType, "printTag", this.crearScriptImp(pagina), false); // //String cstext1 = "printTag();"; // //scriptBlock.RegisterStartupScript(csType, "ButtonClickScript", cstext1, true); // } }
protected void btnSend_Click(object sender, EventArgs e) { Session["save"] = null; btnSave.Visible = false; if (string.IsNullOrEmpty(txtWorkOrder.Text.Trim())) { RequiredField.Enabled = true; RequiredField.IsValid = false; txtWorkOrder.Focus(); grdRecords.DataSource = ""; grdRecords.DataBind(); return; } //lblOrder.Visible = true; 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(); lblResult.Text = string.Empty; DataTable resultado = idal.listaRegistrosOrden_Param(ref obj, ref strError); if (resultado.Rows.Count > 0) { foreach (DataRow item in resultado.Rows) { Ent_tticol125 MyObj = new Ent_tticol125(); MyObj.pdno = item["Orden"].ToString(); //JC 061221 MyObj.pono = Convert.ToInt32(item["Pos"].ToString()); MyObj.item = item["Articulo"].ToString(); DataTable ResQtdl = idal.ConsultarQtdl(ref MyObj, ref strError); decimal Qtdl = 0; if (ResQtdl.Rows.Count > 0) { Qtdl = Convert.ToDecimal(ResQtdl.Rows[0]["REQT"].ToString()); } item["CANT"] = Convert.ToString(Convert.ToDecimal(item["CANT"].ToString()) - Qtdl); } } // Validar si el numero de orden trae registros if (strError != string.Empty) { OrderError.IsValid = false; txtWorkOrder.Focus(); btnSave.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); return; } //lblOrder.Text = _idioma == "INGLES" ? "Order: " : "Orden: " + obj.pdno; grdRecords.DataSource = resultado; grdRecords.DataBind(); printLabel.Visible = false; this.HeaderGrid.Visible = true; btnSave.Visible = true; lblResult.Text = ""; }