//fix para tratamientos a la hora de consultar una factura public Struct_DetalleFactura(DataRow p_DR, int p_IdUser) { DETALLEINT = int.Parse(p_DR["CantidadINT"].ToString()); DETALLEDEC = Statics.Conversion.GetDecimal(p_DR["CantidadDEC"].ToString()); InitAccessKey(); bool istreat = false; DataRow _DR; if (p_DR["IdArticulo"].ToString() != "0") { _DR = Connection.D_Articles.SelectSingleArticle(p_IdUser, int.Parse(p_DR["IdArticulo"].ToString())); } else { _DR = new Connection.D_Treatment().Select_TreatmentById(int.Parse(p_DR["IdTratamiento"].ToString())); istreat = true; } if (_DR != null) { if (istreat == false) { PRODUCTO = Data2.Class.Struct_Producto.GetById(int.Parse(_DR["Id"].ToString())); if (PRODUCTO != null) { PRODUCTO.PrecioCompra = Statics.Conversion.GetDecimal(p_DR["PrecioCompra"].ToString()); PRODUCTO.PorcentajeGanancia = Statics.Conversion.GetDecimal(p_DR["PorcentajeGanancia"].ToString()); PRODUCTO.PrecioFinal = Statics.Conversion.GetDecimal(p_DR["PrecioFinal"].ToString()); PRODUCTO.IVA = Statics.Conversion.GetDecimal(p_DR["IVA"].ToString()); PRODUCTO.PrecioNeto = Statics.Conversion.GetDecimal(p_DR["PrecioNeto"].ToString()); isdec = new Struct_Unidades(PRODUCTO.IdUnidad).Decimal; } else { PRODUCTO = new Struct_Producto(p_IdUser, 0, "0", "0", "Producto huerfano", 0, 0, 0, 0, 0, 0, false, 0); } } else { TRATAMIENTO = new Struct_Treatment(); TRATAMIENTO.Nombre = _DR["Nombre"].ToString(); TRATAMIENTO.Descripcion = _DR["Descripcion"].ToString(); TRATAMIENTO.Id = int.Parse(_DR["Id"].ToString()); TRATAMIENTO.Precio = Statics.Conversion.GetDecimal(p_DR["PrecioFinal"].ToString()); //pendiente de finalizar la carga del tratamiento desde el detalle de factura y el tratamiento en si... Cargar precios coneglados (Deivit) } } else { PRODUCTO = new Struct_Producto(p_IdUser, 0, "0", "0", "Producto huerfano", 0, 0, 0, 0, 0, 0, false, 0); } }
public static Struct_Treatment GetTreatmentById(int p_id) { Connection.D_Treatment ST = new Connection.D_Treatment(); DataRow DR = ST.Select_TreatmentById(p_id); if (DR != null) { return(new Struct_Treatment(DR)); } else { return(null); } }
public static List <Struct_Treatment> SearchTreatment(int LocalId, string parametro) { Connection.D_Treatment DT = new Connection.D_Treatment(); DataTable D = DT.Search_Tratamiento(LocalId, parametro); if (D != null) { List <Struct_Treatment> ListaTemporal = new List <Struct_Treatment>(); for (int a = 0; a < D.Rows.Count; a++) { ListaTemporal.Add(new Struct_Treatment(D.Rows[a])); } return(ListaTemporal); } else { return(null); } }
public static List <Struct_Treatment> GetTreatmentsBySucursal(int LocalId) { Connection.D_Treatment ST = new Connection.D_Treatment(); DataTable DT = ST.GetTreatmentsBySucursales(LocalId); List <Struct_Treatment> Aux = new List <Struct_Treatment>(); if (DT != null) { foreach (DataRow fila in DT.Rows) { Struct_Treatment TreatmentActual = new Struct_Treatment(fila); Aux.Add(TreatmentActual); } return(Aux); } else { return(null); } }