public UbicacionesBE() { Id = 0; Almacen = new AlmacenPTBE(); Producto = new ProductoEnsambleBE(); Carcasa = new ColoresBE(); Reflejante = new ReflejantesBE(); Rack = string.Empty; Fila = 0; Columna = 0; Minimo = 0; Maximo = 0; DatosUsuario = new GeneralBE(); }
public OrdenCompraDetalleBE() { Sel = false; Id = 0; Producto = new ProductoEnsambleBE(); Carcasa = new ColoresBE(); Sugerido = 0; Solicitado = 0; Precio = 0; Fecha = DateTime.Today; Comentarios = string.Empty; Cancelada = false; Reflejante = new List <OrdenCompraComponentesBE>(); DatosUsuario = new GeneralBE(); }
public List <ProductoEnsambleBE> ENS_ProductosFicha_Obtener(ProductoEnsambleBE obj) { try { List <ProductoEnsambleBE> oList = new ProductosDA().ENS_ProductosFicha_Obtener(obj); oList.ForEach(item => { if (item.Dimensiones.RutaImagen.Trim().Length > 0) { item.Foto = ObtenerImagen(item.Id); } }); return(oList); } catch (Exception ex) { throw ex; } }
public List <ProductoEnsambleBE> ENS_ProductosCotizacion_Combo(bool Nacional, string Moneda) { List <ProductoEnsambleBE> oList = new List <ProductoEnsambleBE>(); try { using (SqlConnection conn = new SqlConnection(RecuperarCadenaDeConexion("coneccionSQL"))) { conn.Open(); using (SqlCommand cmd = new SqlCommand(CONS_ENS_PRODUCTOSCOTIZACION_COMBO, conn)) { cmd.Parameters.AddWithValue("@Nacional", Nacional); cmd.Parameters.AddWithValue("@Moneda", Moneda); cmd.CommandType = CommandType.StoredProcedure; using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { ProductoEnsambleBE obj = new ProductoEnsambleBE(); obj.Id = int.Parse(reader["PFI_Id"].ToString()); obj.Producto.Id = int.Parse(reader["TPR_ID"].ToString()); obj.Entidad.Nombre = reader["ENT_Nombre"].ToString(); obj.Familia.Nombre = reader["FAM_Nombre"].ToString(); obj.Producto.Clave = reader["Codigo"].ToString(); obj.Producto.Nombre = reader["TPR_Nombre"].ToString(); obj.Reflejantes = int.Parse(reader["PFI_Reflejantes"].ToString()); obj.Precio.Precio = decimal.Parse(reader["Precio"].ToString()); obj.Precio.CantidadVol = int.Parse(reader["PRE_CantVolumen"].ToString()); obj.Precio.Volumen = decimal.Parse(reader["PRE_Volumen"].ToString()); obj.Precio.CantidadMay = int.Parse(reader["PRE_CantMayoreo"].ToString()); obj.Precio.Mayoreo = decimal.Parse(reader["PRE_Mayoreo"].ToString()); obj.Precio.AAA = decimal.Parse(reader["PRE_AAA"].ToString()); oList.Add(obj); } } } } return(oList); } catch (Exception ex) { throw ex; } }
public List <ProductoEnsambleBE> ENS_ProductosFicha_Obtener(ProductoEnsambleBE producto) { List <ProductoEnsambleBE> oList = new List <ProductoEnsambleBE>(); try { using (SqlConnection conn = new SqlConnection(RecuperarCadenaDeConexion("coneccionSQL"))) { conn.Open(); using (SqlCommand cmd = new SqlCommand(CONS_ENS_PRODUCTOSFICHA_OBTENER, conn)) { cmd.Parameters.AddWithValue("@Id", producto.Id); cmd.Parameters.AddWithValue("@IdEntidad", producto.Entidad.Id); cmd.Parameters.AddWithValue("@IdFamilia", producto.Familia.Id); cmd.Parameters.AddWithValue("@IdProducto", producto.Producto.Id); cmd.CommandType = CommandType.StoredProcedure; using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { ProductoEnsambleBE obj = new ProductoEnsambleBE(); #region ENCABEZADO FICHA TECNICA obj.Id = int.Parse(reader["PFI_Id"].ToString()); obj.Entidad.Id = int.Parse(reader["ENT_Id"].ToString()); obj.Familia.Id = int.Parse(reader["FAM_Id"].ToString()); obj.Producto.Id = int.Parse(reader["TPR_ID"].ToString()); obj.Reflejantes = int.Parse(reader["PFI_Reflejantes"].ToString()); obj.CantAccesorios = int.Parse(reader["PFI_Accesorios"].ToString()); obj.Dimensiones.Alto = decimal.Parse(reader["PFD_Alto"].ToString()); obj.Dimensiones.Largo = decimal.Parse(reader["PFD_Largo"].ToString()); obj.Dimensiones.Ancho = decimal.Parse(reader["PFD_Ancho"].ToString()); obj.Dimensiones.Cirunferencia = decimal.Parse(reader["PFD_Circunferencia"].ToString()); obj.Dimensiones.Diametro = decimal.Parse(reader["PFD_Diametro"].ToString()); obj.Dimensiones.Peso = decimal.Parse(reader["PFD_Peso"].ToString()); obj.Dimensiones.Empaque = int.Parse(reader["PFD_Empaque"].ToString()); obj.Dimensiones.RutaImagen = reader["PFD_RutaImagen"].ToString(); obj.DatosUsuario.Estatus = bool.Parse(reader["PFI_Estatus"].ToString()); #endregion oList.Add(obj); } if (oList.Count > 0) { /* CARCASAS, REFLEJANTES Y ACCESORIOS */ if (reader.NextResult()) { while (reader.Read()) { ProductosCombinacion oDetalle = new ProductosCombinacion(); oDetalle.Tipo = reader["TIPO"].ToString(); oDetalle.Id = int.Parse(reader["Id"].ToString()); oList[0].Detalle.Add(oDetalle); } } } } } } return(oList); } catch (Exception ex) { throw ex; } }
public List <ProductoEnsambleBE> ENS_ProductosFicha_Obtener(ProductoEnsambleBE obj) { return(new ProductosBP().ENS_ProductosFicha_Obtener(obj)); }
private void CargarFicha() { oEnsamble = new WCF_Ensamble.Hersan_EnsambleClient(); try { ProductoEnsambleBE obj = new ProductoEnsambleBE(); obj.Id = int.Parse(txtId.Text); obj.Entidad.Id = int.Parse(cboEntidad.SelectedValue.ToString()); obj.Familia.Id = int.Parse(cboFamilia.SelectedValue.ToString()); obj.Producto.Id = int.Parse(cboTipo.SelectedValue.ToString()); oProducto = oEnsamble.ENS_ProductosFicha_Obtener(obj); if (oProducto.Count > 0) { /*SE LIMPIAN LOS ITEMS SELECCIONADOS */ lstCarcasa.CheckedItems.Clear(); lstAccesorios.CheckedItems.Clear(); lstReflejantes.CheckedItems.Clear(); txtId.Text = oProducto[0].Id.ToString(); txtCantidad.Value = oProducto[0].Reflejantes; txtCantAcce.Value = oProducto[0].CantAccesorios; txtAlto.Text = oProducto[0].Dimensiones.Alto.ToString(); txtAncho.Text = oProducto[0].Dimensiones.Ancho.ToString(); txtCircun.Text = oProducto[0].Dimensiones.Cirunferencia.ToString(); txtDiam.Text = oProducto[0].Dimensiones.Diametro.ToString(); txtLargo.Text = oProducto[0].Dimensiones.Largo.ToString(); txtPeso.Text = oProducto[0].Dimensiones.Peso.ToString(); txtPiezas.Text = oProducto[0].Dimensiones.Empaque.ToString(); txtRuta.Text = oProducto[0].Dimensiones.RutaImagen; chkEstatus.Checked = oProducto[0].DatosUsuario.Estatus; oProducto[0].Detalle.ForEach(aux => { if (aux.Tipo == "CARCASA") { foreach (var x in lstCarcasa.Items) { if (x.Value.ToString() == aux.Id.ToString()) { x.CheckState = Telerik.WinControls.Enumerations.ToggleState.On; } } } else { if (aux.Tipo == "REFLEJANTE") { foreach (var x in lstReflejantes.Items) { if (x.Value.ToString() == aux.Id.ToString()) { x.CheckState = Telerik.WinControls.Enumerations.ToggleState.On; } } } else { foreach (var x in lstAccesorios.Items) { if (x.Value.ToString() == aux.Id.ToString()) { x.CheckState = Telerik.WinControls.Enumerations.ToggleState.On; } } } } }); if (oProducto[0].Foto != null) { Imagen = oProducto[0].Foto; picFoto.Image = ConvertImage.ByteToImage(Imagen); } else { picFoto.Image = null; } } else { oList.Clear(); txtId.Text = "0"; txtAlto.Text = "0"; txtAncho.Text = "0"; txtCantAcce.Value = 0; txtCantidad.Value = 0; txtCircun.Text = "0"; txtDiam.Text = "0"; txtLargo.Text = "0"; txtPeso.Text = "0"; txtPiezas.Text = "0"; txtRuta.Text = ""; lstAccesorios.CheckedItems.Clear(); lstCarcasa.CheckedItems.Clear(); lstReflejantes.CheckedItems.Clear(); gvResult.DataSource = null; picFoto.Image = null; } } catch (Exception ex) { throw ex; } finally { oEnsamble = null; } }