private void repOpenFile_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (e.Button.Index == 0) { // --- copiar la ruta del archivo para luego ser guardado if (ofdPrice.ShowDialog() == System.Windows.Forms.DialogResult.OK) { gvAnexos.SetFocusedRowCellValue(gcolAt_Filename, ofdPrice.SafeFileName); gvAnexos.SetFocusedRowCellValue(gcolAt_Source_filename, ofdPrice.FileName); } } else if (e.Button.Index == 1) { if (gvAnexos.GetFocusedRowCellValue(gcolAt_Num_version) != null) { try { // --- abrir documento string path_filename = System.IO.Path.Combine( new CSettings().GetPathAttachPrice(), gvAnexos.GetFocusedRowCellValue(gcolAt_Filename).ToString()); Process.Start(path_filename); } catch { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: el archivo no existe"); } } } }
protected override bool Son_Datos_Correctos() { if (tbCodSerie.Text.Trim().Length == 0) { ComunForm.Send_message(this.Text, TypeMsg.error, "Falta ingresar el código de periodo."); return(false); } if (cbNomSerie.Text.Trim().Length == 0) { ComunForm.Send_message(this.Text, TypeMsg.error, "Falta ingresar el nombre del periodo."); return(false); } if (deDateIni.Text.Length == 0) { ComunForm.Send_message(this.Text, TypeMsg.error, "Falta ingresar la fecha inicial"); return(false); } if (deDateEnd.Text.Length == 0) { ComunForm.Send_message(this.Text, TypeMsg.error, "Falta ingresar la fecha final."); return(false); } if (new CSerieFactory().GetAll().Exists(c => c.Nom_serie == cbNomSerie.Text && c.Cod_serie != tbCodSerie.Text)) { ComunForm.Send_message(this.Text, TypeMsg.error, "Ya existe un periodo asignado a este código"); return(false); } return(true); }
protected override bool Grabar_Registro() { CElement oElement = new CElement(); oElement.Idelement = Idelement; oElement.Cod_element = tbCodElement.Text; oElement.Name_element = tbDenomination.Text; oElement.Description = tbDescription.Text; oElement.Native_element = tbGroup.Text; oElement.Type_element = 'C'; if (Idelement == 0) { oElement.Usernew = Comun.GetUser(); oElement.Useredit = Comun.GetUser(); oElement.Datenew = Comun.GetDate(); oElement.Dateedit = Comun.GetDate(); } else { oElement.Datenew = Comun.GetDate(); oElement.Dateedit = Comun.GetDate(); } CElementFactory faElement = new CElementFactory(); if (!faElement.Update(oElement)) { faElement.Insert(oElement); } ComunForm.Send_message(this.Text, TypeMsg.ok, ""); return(true); }
protected override bool Son_Datos_Correctos() { int i = 0; foreach (CFactor_estequiometrico item in gcFactorEstequ.DataSource as BindingList <CFactor_estequiometrico> ) { i++; if (item.Idelement == null) { ComunForm.Send_message("Factores estequiométricos", TypeMsg.error, "No se seleccionó el elemento en la fila " + i.ToString()); return(false); } if (item.Idcompound == null) { ComunForm.Send_message("Factores estequiométricos", TypeMsg.error, "No se seleccionó el compuesto en la fila " + i.ToString()); return(false); } if (item.Factor == 0) { ComunForm.Send_message("Factores estequiométricos", TypeMsg.error, "No se ingresó el factor en la fila " + i.ToString()); return(false); } } return(true); }
protected override bool Son_Datos_Correctos() { int typeSol = Convert.ToInt32(treeSolInterm.FocusedNode["Type_sol"]); if (typeSol == 1 || typeSol == 2 || typeSol == 3) { if (tbVolumen.Value == 0) { ComunForm.Send_message("Soluciones Intermedias", TypeMsg.error, "No se ingreso el volumen."); return(false); } if (ckAssignMethod.Visible && !ckAssignMethod.Checked) { ComunForm.Send_message("Soluciones Intermedias", TypeMsg.error, "No se asigno el método."); return(false); } } else if (typeSol == 4) { if (!ucCalibStd1.Son_datos_correctos()) { return(false); } } return(true); }
protected override bool Grabar_Registro() { try { // borrar datos foreach (CCompound item in new CCompoundFactory().GetAll()) { item.Status = false; new CCompoundFactory().Update(item); } // guardar grid foreach (CCompound item in gcCompound.DataSource as BindingList <CCompound> ) { item.Status = true; item.Useredit = Comun.GetUser(); item.Dateedit = Comun.GetDate(); if (!new CCompoundFactory().Update(item)) { item.Usernew = Comun.GetUser(); item.Datenew = Comun.GetDate(); new CCompoundFactory().Insert(item); } } return(true); } catch (Exception ex) { ComunForm.Send_message("Compuestos", TypeMsg.error, ex.Message); return(false); } }
private void repGetCopyFileName_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { if (cbDocument.EditValue != null && cbProcedure.EditValue != null && cbUser.EditValue != null) { if (e.Button.Index == 0) { if (ofdDocument.ShowDialog() == System.Windows.Forms.DialogResult.OK) { CopyAndSaveFile(ofdDocument.FileName); } } else if (e.Button.Index == 1) { // --- open document string path_filename = System.IO.Path.Combine(destiny_path, treeAuthorization.FocusedNode.GetValue("Name_file").ToString()); Process.Start(path_filename); } } else { MessageBox.Show("No se seleccionó un tipo de documento."); } } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } }
public void InitData() { #region init combos try { cbUnit_result.Bind(); cbUnit_calib.Bind(); cbMedium.Bind(); cbModif.Bind(); cbSolCalib.BindSolCalib(); cbMaterialRef.Bind(Convert.ToInt16(IDElement)); List <CCalib> lst = new CCalibFactory().GetAll(); gcCalibracion.DataSource = new BindingList <CCalib>( new CCalibFactory() .GetAll() .Where(x => x.Idtemplate_method == 0).ToList()); } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } #endregion }
public void InitData() { #region init combos try { cbUnit_result.Bind(); cbMaterialRef.Bind(Convert.ToInt16(IDElement)); paMaterialReference.Enabled = false; paSampleFortification.Enabled = false; paBlkFortification.Enabled = false; rbMR.Checked = true; rbBlkFortification.Checked = false; rbSamplesFortification.Checked = false; RefreshByElement(IDElement); } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } #endregion }
void CopyAndSaveFile(string source_file_name) { try { System.IO.FileInfo fInfo = new System.IO.FileInfo(source_file_name); string name_file = String.Format("{0}{1}", oAuthorization.Get_next_file_name( Convert.ToInt16(cbUser.EditValue), Convert.ToChar(treeAuthorization.FocusedNode["Type_doc"])), fInfo.Extension); string destiny_file = System.IO.Path.Combine(destiny_path, name_file); if (!System.IO.Directory.Exists(destiny_path)) { System.IO.Directory.CreateDirectory(destiny_path); } // To copy a file to another location and // overwrite the destination file if it already exists. System.IO.File.Copy(source_file_name, destiny_file, true); Modify_file_name(name_file); } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } }
public bool Is_law_right() { CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); CTemplate_method_aa oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(Idtemplate_method)); // --- recorring law columns for (int i = 0; i < ListSamples.Count; i++) { CBatch_detail_aa_twofold row = ListSamples[i]; decimal law1 = Convert.ToDecimal(row.Law1); decimal law2 = Convert.ToDecimal(row.Law2); if (law1 <= oTemplate_method_aa.Law_limit_bottom || law1 >= oTemplate_method_aa.Law_limit_top) { ComunForm.Send_message("Formulario de QaQc", TypeMsg.error, "Error: la ley esta fuera de los límites permitidos."); return(false); } if (law2 <= oTemplate_method_aa.Law_limit_bottom || law1 >= oTemplate_method_aa.Law_limit_top) { ComunForm.Send_message("Formulario de QaQc", TypeMsg.error, "Error: la ley esta fuera de los límites permitidos."); return(false); } } return(true); }
protected override bool Son_Datos_Correctos() { if (gluCod_method.EditValue == null) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: no se admite el código de método vacio."); return(false); } if (tbAbreviation.Text == "") { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: no se admite una abreviatura de método vacia."); return(false); } if (cbDigestion.EditValue == null) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: no se ha seleccionado el campo digestion."); return(false); } if (cbElement.EditValue == null) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: no se ha seleccionado el campo elemento."); return(false); } if (cbTypeSample.EditValue == null) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: no se ha seleccionado el campo tipo de muestra."); return(false); } if (!Son_Datos_Correctos_TypeAnalysis()) { return(false); } return(true); }
protected override bool Grabar_Registro() { try { // eliminar todo foreach (CFactor_estequiometrico item in new CFactor_estequiometricoFactory().GetAll()) { item.Status = false; new CFactor_estequiometricoFactory().Update(item); } // guardar foreach (CFactor_estequiometrico item in gcFactorEstequ.DataSource as BindingList <CFactor_estequiometrico> ) { item.Status = true; item.Dateedit = Comun.GetDate(); item.Useredit = Comun.GetUser(); if (!new CFactor_estequiometricoFactory().Update(item)) { item.Useredit = Comun.GetUser(); item.Datenew = Comun.GetDate(); new CFactor_estequiometricoFactory().Insert(item); } } return(true); } catch (Exception ex) { ComunForm.Send_message("Factores estequiométricos", TypeMsg.error, ex.Message); return(true); } }
protected override void Recuperar_Registro() { try { // --- recuperate head if (IDTemplate_Method > 0) { // --- recuperate head CTemplate_methodFactory faTemplate_Method = new CTemplate_methodFactory(); CTemplate_method oTemplate_Method = faTemplate_Method.GetByPrimaryKey(new CTemplate_methodKeys(IDTemplate_Method)); gluCod_method.EditValue = oTemplate_Method.Cod_template_method; Num_version = Convert.ToInt16(oTemplate_Method.Num_version); tbTitle.Text = oTemplate_Method.Title; laTitulo.Text = string.Format("Metodo ({0}-{1})", oTemplate_Method.Num_version, oTemplate_Method.Useredit); cbDigestion.EditValue = oTemplate_Method.Cod_digestion_method; tbCost_Method.Value = Convert.ToDecimal(oTemplate_Method.Cost_method); tbAbreviation.Text = oTemplate_Method.Abbreviation; ckRecognized.Checked = Convert.ToBoolean(oTemplate_Method.Recognized); cbTypeSample.EditValue = oTemplate_Method.Cod_type_sample; cbElement.EditValue = Convert.ToInt16(oTemplate_Method.Idelement); cbTypeAnalysis.EditValue = null; cbTypeAnalysis.EditValue = oTemplate_Method.Type_analisys; //recupera el tipo de analisis cbRepetition.EditValue = oTemplate_Method.Cod_repetition; } } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } }
public void RetrieveTypeAnalysis() { try { InitData(); // --- recuperate head if (IDTemplate_Method != null && IDTemplate_Method > 0) { CTemplate_method_ah oTemplate_method_ah = new CTemplate_method_ah(); CTemplate_method_ahFactory faTemplate_method_aa = new CTemplate_method_ahFactory(); oTemplate_method_ah = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_ahKeys(Convert.ToInt32(IDTemplate_Method))); if (oTemplate_method_ah != null) { oTemplate_method_ah.Idtemplate_method = oTemplate_Method.Idtemplate_method; cbUnit_result.EditValue = oTemplate_method_ah.Idunit_result; tbSymbol.Text = oTemplate_method_ah.Symbol; cbUnit_result.EditValue = oTemplate_method_ah.Idunit_result; } } else { } } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); } }
private void btOkObs_Click(object sender, EventArgs e) { if (ckEnableRetest.Checked || tbObservation.Text.Trim().Length > 0) evenCloseParent(System.Windows.Forms.DialogResult.OK); else ComunForm.Send_message(this.Text, TypeMsg.error, "Para continuar debe ingresar una observación o habilitar un reensayo."); }
protected override bool Son_Datos_Correctos() { if (cbCodMR.EditValue == null) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: no se admite el código del mr vacio."); return(false); } if (cbDescription.EditValue == null) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: no se admite la descripción vacia."); return(false); } if (cbTypeMr.EditValue == null) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: no se admite el tipo de material de referencia."); return(false); } if (cbStatus.EditValue == null) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: no se seleccionó el estado de vigencia."); return(false); } if (!isDetailRight()) { return(false); } return(true); }
public bool Son_Datos_Correctos() { if (ckAssignMethod.Visible && !ckAssignMethod.Checked) { ComunForm.Send_message("Soluciones Intermedias", TypeMsg.error, "No se asigno el método."); return(false); } return(true); }
protected override bool Son_Datos_Correctos() { if (!EsColumnPrefixRigth()) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error la columna prefijo no puede ser vacia"); return(false); } return(true); }
protected override bool Grabar_Registro() { try { return(SaveAA()); } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); return(false); } }
protected override bool Son_Datos_Correctos() { foreach (CCompound item in gcCompound.DataSource as BindingList <CCompound> ) { if (item.Name_compound.Trim().Length == 0) { ComunForm.Send_message("Compuestos", TypeMsg.error, "Error al ingresar compuesto en fila "); return(false); } } return(true); }
protected override bool Grabar_Registro() { CType_solutionFactory faType_solution = new CType_solutionFactory(); try { // --- remove all List <CType_solution> lstType_solution = new List <CType_solution>(new CType_solutionFactory().GetAll()); for (int i = 0; i < lstType_solution.Count; i++) { CType_solution current_row = lstType_solution[i]; if (current_row.Idtype_solution > 0) { current_row.Status = false; faType_solution.Update(current_row); } } // --- save all for (int i = 0; i < gvTypeSolution.RowCount; i++) { CType_solution current_row = gvTypeSolution.GetRow(i) as CType_solution; if (current_row.Idtype_solution == 0) { current_row.Usernew = Comun.GetUser(); current_row.Datenew = Comun.GetDate(); current_row.Status = true; } else { current_row.Useredit = Comun.GetUser(); current_row.Dateedit = Comun.GetDate(); current_row.Status = true; } if (!faType_solution.Update(current_row)) { faType_solution.Insert(current_row); } } return(true); } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); return(false); } }
protected override bool Son_Datos_Correctos() { if (tbName.Text.Trim().Length == 0) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: no ingreso una fórmula correctamente."); return(false); } if (tbWeightMolecular.Value == 0) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: no ingreso el valor molecular."); return(false); } return(true); }
protected override bool Son_Datos_Correctos() { if (tbNameDigestion.Text.Trim() == "") { ComunForm.Send_message(this.Text, TypeMsg.error, "Guardar: error no se admite el nombre de digestion vacio."); return(false); } if (tbCodDigestion.Text.Trim() == "") { ComunForm.Send_message(this.Text, TypeMsg.error, "Guardar: error no se admite el código de digestion vacio."); return(false); } return(true); }
public bool Son_Datos_Correctos() { if (tbSymbol.Text.Trim().Length == 0) { ComunForm.Send_message("Analisis de Humedad", TypeMsg.error, "No se ingreso el simbolo del análisis"); return(false); } if (cbUnit_result.EditValue == null) { ComunForm.Send_message("Analisis de Humedad", TypeMsg.error, "No se ingresó la unidad de medida."); return(false); } return(true); }
protected override bool Son_Datos_Correctos() { if (tbCode.Text.Trim() == "") { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: No se admite el campo código vacio."); return(false); } if (tbDescription.Text.Trim() == "") { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: No se admite el campo descripción vacio."); return(false); } return(true); }
protected override bool Grabar_Registro() { CCorrelativeFactory faCorrelative = new CCorrelativeFactory(); CCorrelative oCorrelative = new CCorrelative(); CCorr_modulesFactory faCorr_module = new CCorr_modulesFactory(); CCorr_modules oCorr_module = new CCorr_modules(); bool result = false; try { for (int i = 0; i < gvCorrelativos.RowCount; i++) { //oCorrelative = new CCorrelative(); //oCorrelative.Cod_type_sample = gvCorrelativos.GetRowCellValue(i, gcCorr_cod_type_sample).ToString(); //oCorrelative.Cod_serie = gvCorrelativos.GetRowCellValue(i, gcCorr_cod_serie).ToString(); //oCorrelative.Correlative = Convert.ToInt32(gvCorrelativos.GetRowCellValue(i, gcCorr_correlative)); //oCorrelative.Mreach15 = Convert.ToBoolean(gvCorrelativos.GetRowCellValue(i, gcCorr_mreach15)); //oCorrelative.Num_digits = Convert.ToInt16(gvCorrelativos.GetRowCellValue(i, gcCorr_num_digits)); //oCorrelative.Prefix = gvCorrelativos.GetRowCellValue(i, gcCorr_prefix).ToString(); //if (!(result = faCorrelative.Update(oCorrelative))) // result = faCorrelative.Insert(oCorrelative); //if (!result) // break; oCorrelative = (CCorrelative)gvCorrelativos.GetRow(i); if (!new CCorrelativeFactory().Update(oCorrelative)) { new CCorrelativeFactory().Insert(oCorrelative); } } for (int i = 0; i < gvVarios.RowCount; i++) { oCorr_module = (CCorr_modules)gvVarios.GetRow(i); new CCorr_modulesFactory().Update(oCorr_module); } } catch (Exception ex) { ComunForm.Send_message(this.Text, TypeMsg.error, ex.Message); result = false; } return(result); }
protected override bool Son_Datos_Correctos() { for (int i = 0; i < gvConvertionUM.RowCount; i++) { if (gvConvertionUM.GetRowCellValue(i, gcUmc_den_unit1) == null || gvConvertionUM.GetRowCellValue(i, gcUmc_den_unit2) == null || gvConvertionUM.GetRowCellValue(i, gcUmc_factor) == null) { string error = "Error: En la fila {0} se requiere llenar todos los campos."; ComunForm.Send_message(this.Text, TypeMsg.error, string.Format(error, i.ToString())); return(false); } } return(true); }
private void btOk_Click(object sender, EventArgs e) { if (AreUserAndPwdRight()) { this.DialogResult = DialogResult.OK; ComunForm.Send_user(); } else { tbPwd.Text = ""; tbUser.Focus(); laMessage.Text = "Nombre o contraseña no válidos"; this.DialogResult = DialogResult.None; } }
private void treeSolInterm_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e) { /* * Solidos * ------- * 1: Alicuota = volumen*concentracion/concentracion patron * * Líquidos * -------- * 1: Alicuota = volumen/(concentracion patron/concentracion) */ // Hacer el cálculo // Si es el patrón de solución es muestra terminal entonces verificar // antes si es sólido o líquido // try { if (e.Node.Level == 0) { // Muestra patron es terminal if (IsSolidSolutionPattern()) // sólido { e.Node["Aliquot"] = Convert.ToDecimal(e.Node["Volumen"]) * Convert.ToDecimal(e.Node["Concentration"]) / template_method_aa.Std_concentration; } else // líquido { e.Node["Aliquot"] = Convert.ToDecimal(e.Node["Volumen"]) / (template_method_aa.Std_concentration / Convert.ToDecimal(e.Node["Concentration"])); } tbAliquot.Value = Convert.ToInt32(e.Node["Aliquot"]); } else if (e.Node.Level >= 1) // solucion intermedia { // solución intermedia 1 o 2 es terminal // determinar la concentración decimal parentConcentration = Convert.ToDecimal(e.Node.ParentNode["Concentration"]); e.Node["Aliquot"] = Convert.ToDecimal(e.Node["Volumen"]) / Convert.ToDecimal(e.Node["Concentration"]) / parentConcentration; tbAliquot.Value = Convert.ToInt32(e.Node["Aliquot"]); } } catch (Exception ex) { ComunForm.Send_message("Soluciones", TypeMsg.error, ex.Message); } }
void FormPrincipal_delegado(ComunForm.Formulario form) { throw new NotImplementedException(); }