public List <CSolution_interm> GetLstSolution(int?idtemplate_method, short?idelement, Comun.TypePatternMr type_pattern) { char type_mr = type_pattern == Comun.TypePatternMr.MrCertificado ? 'C' : 'S'; List <CSolution_interm> lstPattern = (from m in new CMr_detailFactory().GetAll().Where(x => x.Analyte == idelement) from n in new CMrFactory().GetAll().Where(x => x.Type_mr == type_mr).Where(x => x.Idmr == m.Idmr) select new CSolution_interm { Idsolution_interm = -1, Cod_solution = n.Cod_mr, Id = m.Idmr, Parentid = 0, Type_sol = 0, Concentration = m.Nominal_value, Root_idmr_detail = m.Idmr_detail, Root_type_pattern = Convert.ToInt32(type_pattern) }).ToList(); List <CSolution_interm> lstSolution = (from m in new CSolution_intermFactory().GetAll().Where(x => x.Idelement == idelement && x.Root_type_pattern == Convert.ToInt32(type_pattern)) join n in new CSolution_interm_methodsFactory().GetAll().Where(x => x.Idtemplate_method == idtemplate_method) on m.Idsolution_interm equals n.Idsolution_interm into mn from p in mn.DefaultIfEmpty() select new CSolution_interm { Cod_solution = m.Cod_solution, Concentration = m.Concentration, Date_begin = m.Date_begin, Date_end = m.Date_end, Dateedit = m.Dateedit, Datenew = m.Datenew, Flag_current_method = p == null ? false : true, Id = m.Id, Idelement = m.Idelement, Idreactive_medium = m.Idreactive_medium, Idreactive_modif = m.Idreactive_modif, Idsolution_interm = m.Idsolution_interm, Image_index = m.Image_index, Lote = m.Lote, Num_months = m.Num_months, Observation = m.Observation, Parentid = m.Parentid, Prepared_by = m.Prepared_by, Purity = m.Purity, Reactive_medium_value = m.Reactive_medium_value, Reactive_modif_value = m.Reactive_modif_value, Root_idmr_detail = m.Root_idmr_detail, Root_type_pattern = m.Root_type_pattern, Solution_name = m.Solution_name, Solution_status = m.Solution_status, Status = m.Status, Type_sol = m.Type_sol, Useredit = m.Useredit, Usernew = m.Usernew, Volumen = m.Volumen, Aliquot = m.Aliquot }).ToList(); List <CSolution_interm> lstTotal = lstSolution.Union(lstPattern).ToList(); return(lstTotal); }
private void treeSolInterm_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e) { // mostrar detalle del nodo padre TreeListNode node = treeSolInterm.FocusedNode; if (node != null) { //apariencia TreeListNode parentNode = treeSolInterm.FocusedNode.ParentNode; if (parentNode == null) { // solo mostrar panel de padre, mostrar los datos del padre en las cajas gcSolutionParent.Visible = true; gcSolutionChild.Visible = false; paHeader.Height = 85; paSeparator.Visible = false; tbParentConcentration.Text = node["Concentration"].ToString(); gcSolutionParent.Text = node["Cod_solution"].ToString() + " - Solución Padre"; } else if (parentNode != null) { // mostrar paneles padre e hijo gcSolutionParent.Visible = true; gcSolutionChild.Visible = true; paHeader.Height = 252; paSeparator.Visible = true; //tbConcentration.Text = node["Concentration"].ToString(); //tbVolumen.Value = Convert.ToDecimal(node["Volumen"]); //tbAliquot.Value = Convert.ToDecimal(node["Aliquot"]); deDateIni.DateTime = Convert.ToDateTime(node["Date_begin"]); deDateEnd.DateTime = Convert.ToDateTime(node["Date_end"]); cbUser1.EditValue = Convert.ToInt16(node["Prepared_by"]); //ckDisabledSolution.Checked = !Convert.ToBoolean(node["Solution_status"]); //exPanel.Expanded = Convert.ToBoolean(node["Solution_status"]) ? false : true; DateTime currentDate = Comun.GetDate(); //laVigencia.Visible = currentDate >= deDateIni.DateTime.RankIni() && currentDate <= deDateEnd.DateTime.RankEnd() ? false : true; tbParentConcentration.Text = parentNode["Concentration"].ToString(); gcSolutionParent.Text = parentNode["Cod_solution"].ToString() + " - Solución Padre"; gcSolutionChild.Text = node["Cod_solution"].ToString() + " - Solución Hijo"; } // mostrar métodos int idsolution_interm = Convert.ToInt32(node["Idsolution_interm"]); Comun.TypePatternMr typePatterMr = Convert.ToInt32(node["Root_type_pattern"]) == 1 ? Comun.TypePatternMr.MrCertificado : Comun.TypePatternMr.SolucionPatron; gcMethods.DataSource = new ModSolInterm().GetLstTemplate_methodBySolution(idsolution_interm); ///si es nueva solución seleccionada, no mostrar chekbox y habilitar firma una vez modificado el volumen. ///si es solución existente, y el método seleccionado no está linkeado mostrar el chekbox. if (idsolution_interm == 0) { ckAssignMethod.Visible = false; ckAssignMethod.Checked = false; } else { CSolution_interm_methods solFound = new CSolution_interm_methodsFactory() .GetAll() .Where(x => x.Idsolution_interm == idsolution_interm && x.Idtemplate_method == Convert.ToInt32(cbMethod1.EditValue)).FirstOrDefault(); if (solFound == null) { ckAssignMethod.Visible = true; ckAssignMethod.Checked = false; } else { ckAssignMethod.Visible = false; ckAssignMethod.Checked = false; } } } }