private void AbrirRLAB() { // Se monta el objeto pedido para enviarlo al RLAB PedidosDBDataContext ctx = new PedidosDBDataContext(); PEDIDOSV pv; var pedido = from este in ctx.PEDIDOSV where este.DOCU_ID == txtDOCU_ID.Text && este.PEDID_ID == txtPEDID_ID.Text select este; if (pedido.Count() > 0) pv = pedido.First(); else { MessageBox.Show("Error al intentar abrir la ventana de RLAB. El pedido aun no se ha guardado"); return; } // Validar matriz var articulo = from matriz in ctx.ARTICULOS where matriz.ARTI_ID == pv.ARTI_ID select matriz; if (articulo.Count() == 0) { MessageBox.Show("No se puede crear RLAB si no hay una matriz válida"); return; } RegistroLaboratorioPedidoV rlab = new RegistroLaboratorioPedidoV(); rlab._USUARIO = this._USU_ID; rlab._Pedido = pv; rlab.ShowDialog(); if (rlab.DialogResult == DialogResult.OK) { this.txtREGLAB_ID.Text = rlab._Reglab_ID; } }
private void lblRegLab_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { RegistroLaboratorioPedidoV reglab = new RegistroLaboratorioPedidoV(); reglab.ShowDialog(); // Variables a pasar a la ventana llamada //pd.Documento = _DOCU_ID; //pd.Numero = _PEDID_ID; //pd.PedidoIDorigen = _PEDID_ID_ORIGEN; //pd.ClienteId = toInt(this.txtCLIE_ID.Text); //pd.Cliente = this.txtDOCUD_NOMBRE.Text; //// Flecos: El tipo de analisis se calcula en la ventana de detalle por ahora //pd.Matriz = this.txtARTI_ID.Text; //pd.Descripcion = this.lblARTI_DESCRIPCION.Text; //bool aplicaPrecioMediador = false; //flecos: Revisar el funcionamiento del mediador. //if (aplicaPrecioMediador) //{ // pd.MediadorClieId = toInt(txtREPRE_ID.Text); //} //int maxLinea = 0; //DataTable lineas = Utilidades.UtilsLinq.LINQResultToDataTable(detalle); //if (lineas != null && lineas.Rows.Count > 0) //{ // maxLinea = Convert.ToInt32(lineas.Compute("MAX(PEDIDL_LINEA)", string.Empty)); //} //pd.MaxLinea = maxLinea; //pd.usuario = _USU_ID; //pd.plantilla = this.plantilla; //pd.ShowDialog(); //if (pd.DialogResult == DialogResult.OK) //{ // this.fdlv2.DataSource = this.ctx.PEDIDOSV_LI_SEL(_USU_ID, _DOCU_ID, _PEDID_ID); // ValidarDatosUPD(); // this.plantilla = pd.plantilla; // MessageBox.Show("Detalle guardado correctamente"); //} }