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); }
public static void Finalize_process(long idrecep_sample_detail_elem, string process, string sgtProcess) { CTrace_sample_elemFactory faTrace_sample_elem = new CTrace_sample_elemFactory(); // --- get a process existing CTrace_sample_elem oTrace_sample_elem = faTrace_sample_elem.GetAll() .Where(x => x.Idrecep_sample_detail_elem == idrecep_sample_detail_elem && x.Cod_process == process) .OrderBy(x => x.Idtrace_sample_elem).OrderByDescending(x => x.Date_in).FirstOrDefault(); if (oTrace_sample_elem == null) { oTrace_sample_elem = new CTrace_sample_elem(); oTrace_sample_elem.Date_in = Comun.GetDate(); oTrace_sample_elem.Usernew = Comun.User_system.Cod_user; oTrace_sample_elem.Idrecep_sample_detail_elem = idrecep_sample_detail_elem; //oTrace_sample_elem.Cod_module = module; oTrace_sample_elem.Cod_process = process; } oTrace_sample_elem.Date_out = Comun.GetDate(); oTrace_sample_elem.Status_process = Convert.ToChar(LimsProcess.Status_Process.Finished); oTrace_sample_elem.Useredit = Comun.GetUser(); if (!faTrace_sample_elem.Update(oTrace_sample_elem)) { faTrace_sample_elem.Insert(oTrace_sample_elem); } // --- create a new process Initialize_process(idrecep_sample_detail_elem, sgtProcess); }
public static void Advance_process(long idbatch, string process) { CTrace_batchFactory faTrace_batch = new CTrace_batchFactory(); // --- get a process existing CTrace_batch oTrace_batch = new LimsProject.BusinessLayer.Modules.ModProcessBatch().GetLastProcessBatch(process, idbatch); if (oTrace_batch == null) { oTrace_batch = new CTrace_batch(); oTrace_batch.Date_in = Comun.GetDate(); oTrace_batch.Usernew = Comun.GetUser(); oTrace_batch.Idbatch = idbatch; } oTrace_batch.Cod_process = process; //oTrace_batch.Cod_module = module; oTrace_batch.Usernew = Comun.GetUser(); oTrace_batch.Useredit = Comun.GetUser(); oTrace_batch.Status_process = Convert.ToChar(LimsProcess.Status_Process.InProcess); if (!faTrace_batch.Update(oTrace_batch)) { faTrace_batch.Insert(oTrace_batch); } }
public void RetestBatch() { try { CBatchFactory faBatch = new CBatchFactory(); CBatch oBatch = faBatch.GetByPrimaryKey(new CBatchKeys(Idbatch)); // --- check parity for (int i = 0; i < ListSamples.Count; i++) { CBatch_detail_aa_twofold row = ListSamples[i]; CBatch_detail_aa_twofoldFactory faBatch_detail_aa_twofold = new CBatch_detail_aa_twofoldFactory(); if (Convert.ToInt32(row.Flag_mri) == 0) { // --- approved samples with additional retest mark row.Qaqc_has_retest = 1; faBatch_detail_aa_twofold.Update(row); // --- save retest string cod_type_sample = new CTemplate_methodFactory().GetByPrimaryKey(new CTemplate_methodKeys(Convert.ToInt32(row.Idtemplate_method))).Cod_type_sample; CCorrelative oCorrelative = new CCorrelativeFactory().GetByPrimaryKey(new CCorrelativeKeys(cod_type_sample)); CBatchManager oBatchManager = new CBatchManager(); oBatchManager.CallSaveFromRetestFullBatch( Convert.ToInt32(row.Idtemplate_method), Convert.ToInt64(row.Idrecep_sample), Convert.ToInt64(row.Idrecep_sample_detail), Convert.ToInt64(row.Idrecep_sample_detail_elem), Convert.ToInt64(row.Cod_interno), row.Cod_sample, Comun.GetUser(), oCorrelative, row.Qaqc_par); // --- register as finished trace process CProcess_Sample_Manage.Finalize_process(Convert.ToInt64(row.Idrecep_sample_detail_elem), LimsProcess.PROCESS_IN_READING, LimsProcess.PROCESS_APPROVE_SAMPLES); } } // --- modify the batch status, put in other process CProcess oProcess = new CProcessFactory().GetByPrimaryKey(new CProcessKeys(LimsProcess.PROCESS_APPROVE_SAMPLES)); oBatch.Status_process = Convert.ToChar(LimsProcess.Status_Process.Waiting); oBatch.Cod_module = oProcess.Cod_module; oBatch.Cod_area = oProcess.Cod_area; oBatch.Cod_process = LimsProcess.PROCESS_APPROVE_SAMPLES; oBatch.User_approve_tray = Comun.GetUser(); oBatch.Date_approve_tray = Comun.GetDate(); faBatch.Update(oBatch); // --- register as finished trace batch Cprocess_Batch_Manage.Finalize_process(Idbatch, LimsProcess.PROCESS_IN_READING, LimsProcess.PROCESS_APPROVE_SAMPLES); } catch (Exception ex) { Comun.Save_log(ex.InnerException.ToString()); throw new Exception("pivot data::approve::Error occured.", ex); } }
private void repSelect_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e) { // --- edit if user row is equal to current user // --- guardar check bool sign_factor_authorized = SignFactorAuthorized(); CSolution_titration oSolution_titration = gvSolTitration.GetRow(gvSolTitration.FocusedRowHandle) as CSolution_titration; if (oSolution_titration.Prepared_by == Comun.User_system.Iduser || sign_factor_authorized) { oSolution_titration.Status_titration = Convert.ToBoolean(e.NewValue); oSolution_titration.Date_prepared = Comun.GetDate(); faSolution_titration.Update(oSolution_titration); gvSolTitration.UpdateCurrentRow(); // --- recalcular promedio Assign_average(); // --- habilitar para firmar EnabledSignData(); } else { e.Cancel = true; } }
public static void Advance_process(long idrecep_sample_detail_elem, string process) { CTrace_sample_elemFactory faTrace_sample_elem = new CTrace_sample_elemFactory(); // --- get a process existing CTrace_sample_elem oTrace_sample_elem = faTrace_sample_elem.GetAll() .Where(x => x.Idrecep_sample_detail_elem == idrecep_sample_detail_elem && x.Cod_process == process) .OrderBy(x => x.Idtrace_sample_elem).OrderByDescending(x => x.Date_in).FirstOrDefault(); if (oTrace_sample_elem == null) { oTrace_sample_elem = new CTrace_sample_elem(); oTrace_sample_elem.Usernew = Comun.GetUser(); oTrace_sample_elem.Date_in = Comun.GetDate(); } oTrace_sample_elem.Cod_process = process; oTrace_sample_elem.Idrecep_sample_detail_elem = idrecep_sample_detail_elem; oTrace_sample_elem.Status_process = Convert.ToChar(LimsProcess.ModuleStatus.InProcess); oTrace_sample_elem.Useredit = Comun.GetUser(); if (!faTrace_sample_elem.Update(oTrace_sample_elem)) { faTrace_sample_elem.Insert(oTrace_sample_elem); } }
protected override bool Grabar_Registro() { CUser_systemFactory faUser_name = new CUser_systemFactory(); if (tbPwd.Text.Trim().Length > 0 && tbRepPwd.Text.Trim().Length > 0) { oUser_system.Pwd = Comun.EncriptarMD5(tbPwd.Text); } oUser_system.Cod_user = tbUserName.Text; oUser_system.Idperson = Convert.ToInt16(cbPerson.EditValue); bool result = false; if (!(result = faUser_name.Update(oUser_system))) { result = faUser_name.Insert(oUser_system); } if (result) { InitCombos(); } return(result); }
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); } }
public static void Finalize_process(long idbatch, string process, string sgtProcess) { CTrace_batchFactory faTrace_batch = new CTrace_batchFactory(); // --- get a process existing CTrace_batch oTrace_batch = new LimsProject.BusinessLayer.Modules.ModProcessBatch().GetLastProcessBatch(process, idbatch); CProcess oProcess = new CProcessFactory().GetByPrimaryKey(new CProcessKeys(process)); if (oTrace_batch == null) { oTrace_batch = new CTrace_batch(); oTrace_batch.Date_in = Comun.GetDate(); oTrace_batch.Usernew = Comun.GetUser(); oTrace_batch.Idbatch = idbatch; } oTrace_batch.Date_out = Comun.GetDate(); oTrace_batch.Cod_process = process; //oTrace_batch.Cod_module = modulo; oTrace_batch.Useredit = Comun.GetUser(); oTrace_batch.Status_process = Convert.ToChar(LimsProcess.Status_Process.Finished); if (!faTrace_batch.Update(oTrace_batch)) { faTrace_batch.Insert(oTrace_batch); } // --- create a new process Initialize_process(idbatch, sgtProcess); }
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); } }
private void gvSolTitration_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (e.Column == gcCol_Practice_reading || e.Column == gcCol_Theorical_reading) { if (gvSolTitration.GetFocusedRowCellValue(gcCol_Theorical_reading) != null) { CSolution_titration oSolution_titration = gvSolTitration.GetRow(gvSolTitration.FocusedRowHandle) as CSolution_titration; oSolution_titration.Date_prepared = Comun.GetDate(); if (!faSolution_titration.Update(oSolution_titration)) { faSolution_titration.Insert(oSolution_titration); } } if (gvSolTitration.GetFocusedRowCellValue(gcCol_Practice_reading) != null) { CSolution_titration oSolution_titration = gvSolTitration.GetRow(gvSolTitration.FocusedRowHandle) as CSolution_titration; oSolution_titration.Date_prepared = Comun.GetDate(); if (!faSolution_titration.Update(oSolution_titration)) { faSolution_titration.Insert(oSolution_titration); } } if (gvSolTitration.GetFocusedRowCellValue(gcCol_Theorical_reading) != null && gvSolTitration.GetFocusedRowCellValue(gcCol_Practice_reading) != null) { decimal theorical_reading = Convert.ToDecimal(gvSolTitration.GetFocusedRowCellValue(gcCol_Theorical_reading)); decimal practice_reading = Convert.ToDecimal(gvSolTitration.GetFocusedRowCellValue(gcCol_Practice_reading)); decimal factor = 0; if (practice_reading > 0) { factor = Math.Round(theorical_reading / practice_reading, 4); } gvSolTitration.SetFocusedRowCellValue(gcCol_Factor, factor); CSolution_titration oSolution_titration = gvSolTitration.GetRow(gvSolTitration.FocusedRowHandle) as CSolution_titration; oSolution_titration.Date_prepared = Comun.GetDate(); if (!faSolution_titration.Update(oSolution_titration)) { faSolution_titration.Insert(oSolution_titration); } } // --- habilitar la firma del analista Flag_Date_Modified = true; EnabledSignData(); } if (e.Column == gcCol_Factor) { Assign_average(); } }
private void ckChangeMethod_CheckedChanged(object sender, EventArgs e) { paChooseMethod.Visible = ckChangeMethod.Checked; CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); object obj = gvMethods.GetFocusedRowCellValue(gcMet_Idtemplate_method); if (obj != null) { if (gvMethods.RowCount > 0) ShowColumnsByTypeAnalysis(Comun.GetTypeAnalysis(Convert.ToChar(gvMethods.GetFocusedRowCellValue(gcMet_Type_analisys)))); } }
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); } }
void AddParentNode() { // --- this method add a son node for one selected node CDocumentation_User_File oDocUserFile = new CDocumentation_User_File { Iddocumentation = -1, Idtemplate_method = null, Idconfiguration_folder = Convert.ToInt16(cbDocument.EditValue), Name_doc = "Certificado", Procedure_type = Convert.ToChar(cbProcedure.EditValue), Type_doc = 'C', Image_index = 0, Id = GetNewIdNode(), Parentid = 0, Date_ini = DateTime.Now, Date_end = DateTime.Now.AddMonths(12), Rank_valid_inmonth = 12, Prev_authorized = false }; lstDocumentation_user_file.Add(oDocUserFile); // --- save CDocumentationFactory faDocumentation = new CDocumentationFactory(); CDocumentation oDocumentation = new CDocumentation(); oDocumentation.Iddocumentation = oDocUserFile.Iddocumentation; oDocumentation.Idconfiguration_folder = oDocUserFile.Idconfiguration_folder; oDocumentation.Idtemplate_method = oDocUserFile.Idtemplate_method; oDocumentation.Image_index = oDocUserFile.Image_index; oDocumentation.Name_doc = oDocUserFile.Name_doc; oDocumentation.Procedure_type = oDocUserFile.Procedure_type; oDocumentation.Type_doc = oDocUserFile.Type_doc; oDocumentation.Flag_enabled = true; oDocumentation.Id = oDocUserFile.Id; oDocumentation.Parentid = oDocUserFile.Parentid; oDocumentation.Usernew = Comun.GetUser(); oDocumentation.Useredit = Comun.GetUser(); oDocumentation.Datenew = DateTime.Now; oDocumentation.Dateedit = DateTime.Now; oDocumentation.Status = true; treeAuthorization.DataSource = lstDocumentation_user_file; faDocumentation.Insert(oDocumentation); treeAuthorization.DataSource = lstDocumentation_user_file; }
void SaveData() { //guardar las filas cuyo valor de idelement_wavelength sea igual a 0 foreach (CElement_wavelength item in gcElemWavelength.DataSource as BindingList <CElement_wavelength> ) { if (item.Idelement_wavelength == 0) { item.Status = true; item.Dateedit = Comun.GetDate(); item.Useredit = Comun.GetUser(); new CElement_wavelengthFactory().Insert(item); } } }
bool AreUserAndPwdRight() { foreach (CUser_system oUsuario in LstUser) { if (tbUser.Text.Trim().ToUpper() == oUsuario.Cod_user.Trim().ToUpper()) { if (oUsuario.Pwd == Comun.EncriptarMD5(tbPwd.Text)) { Comun.User_system = oUsuario; return(true); } } } return(false); }
protected override bool Grabar_Registro() { CCompanyFactory faCompany = new CCompanyFactory(); CCompany oCompany; if ((oCompany = faCompany.GetByPrimaryKey(new CCompanyKeys(IDCompany))) == null) { oCompany = new CCompany(); } oCompany.Idcompany = IDCompany; oCompany.Business_name = tbBusinessName.Text; oCompany.Domicile = tbClientDomicile.Text; oCompany.Mail = tbClientEmail.Text; oCompany.Phone_client = tbClientPhone.Text; oCompany.Ruc = tbClientRuc.Text; oCompany.Type_company = Convert.ToChar(cbTypeCompany.EditValue); if (IDCompany == 0) { oCompany.Usernew = Comun.GetUser(); oCompany.Useredit = Comun.GetUser(); oCompany.Datenew = Comun.GetDate(); oCompany.Dateedit = Comun.GetDate(); } else { oCompany.Useredit = Comun.GetUser(); oCompany.Dateedit = Comun.GetDate(); } bool result = false; if (!(result = faCompany.Update(oCompany))) { if (!result) { result = faCompany.Insert(oCompany); } } if (result) { LoadDataMasterSearh(new CCompanyFactory().GetAllDataTable()); } return(result); }
public static bool AreUserAndPwdRight(string user, string pwd) { List <CUser_system> lstUser = new CUser_systemFactory().GetAll(); foreach (CUser_system oUsuario in lstUser) { if (user.Trim().ToUpper() == oUsuario.Cod_user.Trim().ToUpper()) { if (oUsuario.Pwd == Comun.EncriptarMD5(pwd)) { Comun.User_system = oUsuario; return(true); } } } return(false); }
public static void Initialize_process(long idrecep_sample_detail_elem, string process) { // --- register the finished process, CTrace_sample_elemFactory faTrace_sample_elem = new CTrace_sample_elemFactory(); CTrace_sample_elem oTrace_sample_elem = new CTrace_sample_elem(); // --- register the initiatied process oTrace_sample_elem = new CTrace_sample_elem(); oTrace_sample_elem.Date_in = Comun.GetDate(); //oTrace_sample_elem.Cod_module = module; oTrace_sample_elem.Cod_process = process; oTrace_sample_elem.Idrecep_sample_detail_elem = idrecep_sample_detail_elem; oTrace_sample_elem.Status_process = Convert.ToChar(LimsProcess.Status_Process.Waiting); oTrace_sample_elem.Usernew = Comun.GetUser(); oTrace_sample_elem.Useredit = Comun.GetUser(); faTrace_sample_elem.Insert(oTrace_sample_elem); }
public static void Initialize_process(long idbatch, string process) { // --- register the finished process, CTrace_batchFactory faTrace_batch = new CTrace_batchFactory(); CTrace_batch oTrace_batch = new CTrace_batch(); // --- register the initiatied process oTrace_batch = new CTrace_batch(); oTrace_batch.Date_in = Comun.GetDate(); oTrace_batch.Cod_process = process; //oTrace_batch.Cod_module = module; oTrace_batch.Idbatch = idbatch; oTrace_batch.Status_process = Convert.ToChar(LimsProcess.Status_Process.Waiting); oTrace_batch.Usernew = Comun.GetUser(); oTrace_batch.Datenew = Comun.GetDate(); faTrace_batch.Insert(oTrace_batch); }
protected override void Limpiar_Campos() { oPrice = null; oPrice_version = null; LstPrice_version_detail = null; totalAmount = 0; cbTypeSample.EditValue = null; cbCompany.EditValue = null; deDateCreation.DateTime = Comun.GetDate(); tbNumDaysValid.Value = new CSettings().GetNumDaysPriceDefault(); tbClientDomicile.Text = ""; tbClientPhone.Text = ""; tbClientRuc.Text = ""; tabHead.Text = "Datos"; tbCodPrice.Text = ""; tbNumVersion.Text = ""; ckDispatchCurier.Checked = false; ckDispatchFax.Checked = false; ckDispatchPerson.Checked = false; ckDispatchTransport.Checked = false; ckSaveHistoryEnd.Checked = false; ckSaveHistoryIni.Checked = false; tbObservation.Text = ""; tbSubTotalAmount.Value = 0; tbTotalAmount.Value = 0; tbTotalIgv.Value = 0; gcPrice.DataSource = new BindingList <PriceMethod>(new ModPrice().GetPriceMethod(null)); gcContact.DataSource = null; richTextIni.RichTextBox.Clear(); richTextEnd.RichTextBox.Clear(); gcAnexos.DataSource = new BindingList <Anexos>(new ModPrice().GetLstAnexos(null)); previewControl1.Clear(); loadData = LoadData.Nothing; ShowStatusControl(); }
protected override bool Son_Datos_Correctos() { if (cbTypeCompany.EditValue == null) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: falta especificar el tipo de empresa."); return(false); } if (tbClientRuc.Text.Trim().Length > 0 && tbClientRuc.Text.Length != 11) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: No se especificó el ruc del cliente correctamente."); return(false); } if (tbClientEmail.Text.Trim().Length > 0 && !Comun.ValidateMail(tbClientEmail.Text)) { ComunForm.Send_message(this.Text, TypeMsg.error, "Error: Al ingresar el correo electrónico."); return(false); } return(true); }
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"])); } } 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; } } catch (Exception ex) { Comun.Send_message("Soluciones", TypeMsg.error, ex.Message); } }
private void ucSignFactor_OnSign(bool login) { // --- firmar jefe de guardia if (login) { // --- guardar trazabilidad y aceptar el factor. Titration_main.Analyst4 = Comun.User_system.Iduser; Titration_main.Date_analyst4 = Comun.GetDate(); Titration_main.Factor = tbFactorEnd.Value; Titration_main.Idunit_measure_factor = Convert.ToInt16(cbFactorUnitMeasure.EditValue); //if (faTitration_main.Update(Titration_main)) // this.DialogResult = System.Windows.Forms.DialogResult.OK; //else //{ // ComunForm.Send_message(this.Text, TypeMsg.error, "Error de conexión."); // this.DialogResult = System.Windows.Forms.DialogResult.Cancel; //} } }
public void Save(int position) { try { CBatch_detail_aa_twofold oBatch_detail_aa_twofold = ((BindingList <CBatch_detail_aa_twofold>)ListSamples)[position]; CBatch_detail_aa_twofoldFactory faBatch_detail_aa_twofold = new CBatch_detail_aa_twofoldFactory(); faBatch_detail_aa_twofold.Update(oBatch_detail_aa_twofold); long Idrecep_sample_detail_elem = Convert.ToInt64(oBatch_detail_aa_twofold.Idrecep_sample_detail_elem); // --- register in process, LimsProcess.Advance_process(Idbatch, Idrecep_sample_detail_elem, LimsProcess.PROCESS_IN_READING); } catch (Exception ex) { Comun.Save_log(ex.InnerException.ToString()); //throw new Exception("pivot data row::update::Error occured.", ex); } }
void InitData() { CReactiveFactory faReactive = new CReactiveFactory(); List <CReactive> lstReactive = faReactive.GetAll(); lstReactive.Add(new CReactive() { Idreactive = 0, Reactive_name = "---", Chemical_formula = "---" }); cbMedium.Properties.DataSource = lstReactive; cbMedium.Properties.ValueMember = "Idreactive"; cbMedium.Properties.DisplayMember = "Reactive_name"; cbModif.Properties.DataSource = lstReactive; cbModif.Properties.ValueMember = "Idreactive"; cbModif.Properties.DisplayMember = "Reactive_name"; CTemplate_method_aa oTemplate_method_aa = new CTemplate_method_aa(); CTemplate_method_aaFactory faTemplate_method_aa = new CTemplate_method_aaFactory(); oTemplate_method_aa = faTemplate_method_aa.GetByPrimaryKey(new CTemplate_method_aaKeys(idtemplate_method)); idreactive_medium = oTemplate_method_aa.Medium; idreactive_modif = oTemplate_method_aa.Modif; LstAllCalibs = oModCalibStd.GetCustomCalibStd(idelement, idmr_detail, idreactive_medium, idreactive_modif); gcCalibStd.DataSource = LstAllCalibs; gvCalibStd.ExpandAllGroups(); //oGroup_solution = oModCalibStd.GetMethodCalib(idelement, idmr_detail, idreactive_medium, idreactive_modif); CElement oElement = new CElementFactory() .GetByPrimaryKey(new CElementKeys(Convert.ToInt16(idelement))); ucTraceUser1.UserSign = Comun.GetUser(); ucTraceUser1.DateSign = Comun.GetDate(); }
void InitDataControls() { deDateCreation.DateTime = Comun.GetDate(); tbNumDaysValid.Value = new CSettings().GetNumDaysPriceDefault(); // --- init company cbCompany.Properties.DataSource = new CCompanyFactory().GetAll(); cbCompany.Properties.DisplayMember = "Business_name"; cbCompany.Properties.ValueMember = "Idcompany"; // --- init type sample combo CType_sampleFactory faType_Sample = new CType_sampleFactory(); cbTypeSample.Properties.DataSource = faType_Sample.GetAll(); cbTypeSample.Properties.ValueMember = "Cod_type_sample"; cbTypeSample.Properties.DisplayMember = "Name_type_sample"; Reception oReception = new Reception(); // --- init type person repPerson_type.DataSource = oReception.GetLstPersonType(); repPerson_type.DisplayMember = "Name"; repPerson_type.ValueMember = "Id"; // --- init methods gcPrice.DataSource = new BindingList <PriceMethod>(new ModPrice().GetPriceMethod(null)); // --- init plantillas CMemo_templateFactory faMemo_template = new CMemo_templateFactory(); gcParagraphHistoryIni.DataSource = faMemo_template.GetAll().Where(c => c.Memo_type == 1).ToList(); gcParagraphHistoryEnd.DataSource = faMemo_template.GetAll().Where(c => c.Memo_type == 2).ToList(); // --- init adjuntos List <Anexos> list = new ModPrice().GetLstAnexos(null); gcAnexos.DataSource = new BindingList <Anexos>(list); }
private void tbPwd_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (tbPwd.Text.Length == 0) { btLock.ImageIndex = 0; } else { if (Comun.AreUserAndPwdRight(Comun.GetUser(), tbPwd.Text)) { btLock.ImageIndex = 1; OnSignPwd(true); } else { btLock.ImageIndex = 2; OnSignPwd(false); } } } }
void Init() { List <CCriterio> lstCriterio = Comun.GetLstCriterio(); repCriterio.DataSource = lstCriterio; repCriterio.ValueMember = "Idcriterio"; repCriterio.DisplayMember = "Nombre_criterio"; repMetodo.DataSource = new Reception().GetMethodsForDecree(); repMetodo.ValueMember = "Code"; repMetodo.DisplayMember = "Name"; repUnidadMedida.DataSource = new CMeasurement_unitFactory().GetAll(); repUnidadMedida.DisplayMember = "Name_unit"; repUnidadMedida.ValueMember = "Idunit"; gcDecree.DataSource = new BindingList <CDecree_detail>(new Reception().GetLstDecree_detail(0)); ucGenerar1.InitItems(new List <string>() { "A Nuevo decreto" }); }
private void btAdd_Click(object sender, EventArgs e) { if (cbCompany.EditValue != null && cbMethodAdd.EditValue != null) { BindingList <PriceMethod> lst = gcPrice.DataSource as BindingList <PriceMethod>; List <PriceMethod> myLstPriceMethod = lst.ToList(); // agregar un método a la lista int idtemplate_method = Convert.ToInt32(cbMethodAdd.EditValue); CTemplate_method oTemplate_method = new CTemplate_methodFactory().GetByPrimaryKey(new CTemplate_methodKeys(idtemplate_method)); CPrice_version price_version = new CPrice_version(); price_version.Idprice_version = 0; price_version.Idcompany = Convert.ToInt16(cbCompany.EditValue); price_version.Date_creation = Comun.GetDate(); CPrice_version_detail price_version_detail = new CPrice_version_detail(); price_version_detail.Num_item = myLstPriceMethod.Count + 1; price_version_detail.Amount_item = 1; price_version_detail.Idtemplate_method = idtemplate_method; price_version_detail.Unit_price = oTemplate_method.Cost_method; price_version_detail.Sale_price = oTemplate_method.Cost_method * price_version_detail.Amount_item; myLstPriceMethod.Add( new PriceMethod(price_version_detail, new ModPrice().GetPriceMethodHistory(price_version, price_version_detail.Idtemplate_method))); gcPrice.DataSource = new BindingList <PriceMethod>(myLstPriceMethod); gvPrice.LayoutChanged(); cbMethodAdd.EditValue = null; SumTotals(); ShowPreviewReport(); } }