private void BuscarInformacion(string location) { detalle = EntryListBusiness.GetDataGuiaDespacho(location); grdDetalle.AutoGenerateColumns = false; grdDetalle.DataSource = detalle; grdDetalle.ClearSelection(); }
private string ValidaDatos() { StringBuilder mensaje = new StringBuilder(); if (datos.Count == 0) { mensaje.Append("- No Existe Data Para Procesar" + Environment.NewLine); } else { if (!EntryListBusiness.ValidateEuids(datos)) { btnProcesar.Enabled = true; grpSplit.Enabled = true; } else { mensaje.Append("- Euid(s) Ya Existe(n)"); grdOpciones.Enabled = true; btnProcesar.Enabled = false; } } return(mensaje.ToString()); }
private void GrabaInformacion(int tipo) { DateTime fechafinal = new DateTime(dtpFechaNota.Value.Year, dtpFechaNota.Value.Month, dtpFechaNota.Value.Day, dtpFechaNota.Value.Hour, dtpFechaNota.Value.Minute, 0); var movFlora = new MovimientoNota { Fecha = fechafinal, id_nota = (int)cboNota.SelectedValue, Usuario = usuarioValido.nombre_usuario, Descripcion = txtDescripcion.Text }; if (txtValor.Text.IsNumeric()) { movFlora.Valor = decimal.Parse(txtValor.Text); } if (tipo == 1) { movFlora.Euid = txtEuid.Text; MovimientoFloracionBusiness.Insert(movFlora); txtEuid.Text = ""; txtEuid.Focus(); } else if (tipo == 2) { var euids = EntryListBusiness.GetEuidByJaula(txtJaula.Text, 1); MovimientoFloracionBusiness.Insert(euids, movFlora); txtJaula.Text = ""; txtJaula.Focus(); } LlenaGrilla(); }
private void LlenaComboTipoConversion(InfoLocDto locationSelected) { var data = new List <CropDto>(); data = EntryListBusiness.GetTipoConversion(usuarioValido.id_empresa, locationSelected.LocationCuartel); cboConversion.ValueMember = "Crop"; cboConversion.DisplayMember = "TipoConversion"; cboConversion.DataSource = data; cboConversion.Refresh(); }
private void bg_DoWork(object sender, DoWorkEventArgs e) { totalEmpleadosProcesar = datos.Count; //Se debe crear lista de InfoFieldBook para cargarlas foreach (var item in datos) { itemInfoField.BreedersInstructions1 = item.Bi1; itemInfoField.BreedersInstructions2 = item.Bi2; itemInfoField.BreedersInstructions3 = item.Bi3; itemInfoField.BreedersInstructions4 = item.Bi4; itemInfoField.cc = item.Cc; itemInfoField.client = item.Client; itemInfoField.codInternacion = item.CodInternacion; itemInfoField.CodPermanencia = item.CodPermanencia; itemInfoField.codReception = item.CodReception; itemInfoField.country = item.Country; itemInfoField.crop = item.Crop; itemInfoField.ent = item.Ent; itemInfoField.EntName = item.EntName; itemInfoField.EntRole = item.EntRole; itemInfoField.euid = item.Euid; itemInfoField.fechaCarga = DateTime.Now; itemInfoField.gmoEvent = item.GmoEvent; itemInfoField.GranosHilera = int.Parse(item.GranosHilera); itemInfoField.indEuid = ""; itemInfoField.instructions = ""; itemInfoField.location = item.Location; itemInfoField.LotId = item.LotId; itemInfoField.obs = item.Obs; itemInfoField.opExpName = item.ExpName; itemInfoField.Owner = item.Owner; itemInfoField.plt = item.Plt; itemInfoField.projecLead = item.ProjectLead; itemInfoField.projectCode = item.ProjectCode; itemInfoField.ResImportation = item.ResImportacion; itemInfoField.rng = item.Rng; itemInfoField.sag = item.Sag; itemInfoField.year = item.Year; listaSplit.Add(itemInfoField); itemInfoField = new InfoFieldBook(); progreso++; //Aumentando el progreso porciento = Convert.ToInt16((((double)progreso / (double)totalEmpleadosProcesar) * 100.00)); //Calculo del porcentaje bg.ReportProgress(porciento); } EntryListBusiness.InsertBulk(datos); InfoFieldBookBusiness.InsertBulk(listaSplit); }
private void ConfiguraFormulario() { idEmpresa = int.Parse(ConfigurationManager.AppSettings["IdEmpresa"].ToString()); LlenaComboLocation(); LlenaComboTipoAgro(); LlenaOwner(); LlenaComboEstado(); LlenaComboCrop(); LlenaComboSag(); cboTipo.Focus(); lblInicio.Text = EntryListBusiness.GetMaxEuid(); //ValidaTemplate(); }
private void CargaArchivo() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "xlsx files (*.xlsx)|*.xlsx"; if (openFileDialog.ShowDialog() == DialogResult.OK) { pathFile = openFileDialog.FileName; } if (pathFile != "") { datos = FuncionesExcel.GetSplitFile(pathFile); var resumen = (from splits in datos select splits).OrderBy(e => e.Euid).ToList(); grdResumen.AutoGenerateColumns = false; grdResumen.DataSource = resumen; grdResumen.ClearSelection(); var listaV = (from splits in datos select new EntryList { Euid = splits.Euid }).ToList(); var existe = EntryListBusiness.ValidateEuids(listaV); if (!existe) { btnProcesar.Enabled = false; MessageBox.Show("Euid No Existe ", "Módulo Split", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } else { btnProcesar.Enabled = true; } lblEuids.Text = resumen.Count.ToString(); } }
private void bg_DoWork(object sender, DoWorkEventArgs e) { totalEmpleadosProcesar = datos.Sum(s => s.EuidSplit); foreach (var item in datos) { var num = InfoFieldBookBusiness.GetSecuenciaIndEuid(item.Euid); if (num.IsNumeric()) { EntryListDto row = new EntryListDto(); int index = int.Parse(num); for (int i = 1; i <= item.EuidSplit; i++) { itemO = EntryListBusiness.GetEntryList(item.Euid, "Euid")[0]; if (itemO != null) { row.Index = i; row.Euid = item.Euid; row.IndEuid = item.Euid + "_" + index.ToString(); row.Year = itemO.Year; row.Country = itemO.Country; row.Location = itemO.Location; row.Rng = itemO.Rng; row.Plt = itemO.Plt; row.Ent = itemO.Ent; row.ExpName = itemO.ExpName; row.ProjectLead = itemO.ProjectLead; row.Cc = itemO.Cc; row.Crop = itemO.Crop; row.Obs = itemO.Obs; row.ProjectCode = itemO.ProjectCode; row.GmoEvent = itemO.GmoEvent; row.Sag = itemO.Sag; row.CodInternacion = itemO.CodInternacion; row.CodReception = itemO.CodReception; row.Client = itemO.Client; row.EntName = itemO.EntName; row.EntRole = itemO.EntRole; row.ResImportacion = itemO.ResImportacion; row.GranosHilera = itemO.GranosHilera; row.Bi1 = itemO.Bi1; row.Bi2 = itemO.Bi2; row.Bi3 = itemO.Bi3; row.Bi4 = itemO.Bi4; row.Owner = itemO.Owner; row.CodPermanencia = itemO.CodPermanencia; row.LotId = itemO.LotId; listData.Add(row); index++; row = new EntryListDto(); } progreso++; //Aumentando el progreso porciento = Convert.ToInt16((((double)progreso / (double)totalEmpleadosProcesar) * 100.00)); //Calculo del porcentaje bg.ReportProgress(porciento); } } } }
private void LlenaGrillaEntry(string valor) { entryList = EntryListBusiness.GetEntryList(valor, opcion); }