Ejemplo n.º 1
0
        public List <OrdenTaller> listarOrdenesTaller()
        {
            OrdenTaller        ot   = null;
            List <OrdenTaller> list = new List <OrdenTaller>();

            using (ProyectoEntities db = new ProyectoEntities())
            {
                var query = (from p in db.OrdenTaller
                             select new
                {
                    IdOT = p.IdOT,
                    ProductoOT = p.ProductoOT,
                    FechaOT = p.FechaOT,
                    ClienteOT = p.ClienteOT,
                    DeclaracionCOT = p.DeclaracionCOT,
                    EstadoOT = p.EstadoOT,
                    PrecioOT = p.PrecioOT,
                    ComentarioOT = p.ComentarioOT,
                    TecnicoOT = p.TecnicoOT,
                }).ToList();


                if (query != null)
                {
                    foreach (var r in query)
                    {
                        ot = new OrdenTaller(r.IdOT, r.ProductoOT, r.FechaOT, r.ClienteOT, r.DeclaracionCOT, r.EstadoOT, r.PrecioOT, r.ComentarioOT, r.TecnicoOT);

                        list.Add(ot);
                    }
                }
            }

            return(list);
        }
Ejemplo n.º 2
0
        public void cambiarEstado(OrdenTaller ot)
        {
            using (ProyectoEntities db = new ProyectoEntities())
            {
                try
                {
                    var queryot =
                        from OrdenTaller in db.OrdenTaller
                        where
                        OrdenTaller.IdOT == ot.IdOT
                        select OrdenTaller;

                    foreach (var p in queryot)
                    {
                        p.EstadoOT     = ot.EstadoOT;
                        p.PrecioOT     = ot.PrecioOT;
                        p.ComentarioOT = ot.ComentarioOT;
                    }
                    db.SaveChanges();
                }
                catch (Exception exsql)
                {
                    throw new Exception("Ocurrio un error al modificar la Orden de Taller", exsql);
                }
            }
        }
Ejemplo n.º 3
0
 public void agregarOT(OrdenTaller cli)
 {
     using (ProyectoEntities db = new ProyectoEntities())
     {
         try
         {
             db.OrdenTaller.Add(new OrdenTaller()
             {
                 ProductoOT     = cli.ProductoOT,
                 FechaOT        = cli.FechaOT,
                 ClienteOT      = cli.ClienteOT,
                 DeclaracionCOT = cli.DeclaracionCOT,
                 EstadoOT       = cli.EstadoOT,
                 PrecioOT       = cli.PrecioOT,
                 ComentarioOT   = cli.ComentarioOT,
                 TecnicoOT      = cli.TecnicoOT
             });
             db.SaveChanges();
         }
         catch (Exception exsql)
         {
             throw new Exception("Ocurrio un error al agregar la Orden de Taller", exsql);
         }
     }
 }
Ejemplo n.º 4
0
        public OrdenTaller buscarOrdenTaller(int idot)
        {
            OrdenTaller ot = null;

            using (ProyectoEntities db = new ProyectoEntities())
            {
                var r = (from p in db.OrdenTaller
                         where p.IdOT == idot
                         select new
                {
                    IdOT = p.IdOT,
                    ProductoOT = p.ProductoOT,
                    FechaOT = p.FechaOT,
                    ClienteOT = p.ClienteOT,
                    DeclaracionCOT = p.DeclaracionCOT,
                    EstadoOT = p.EstadoOT,
                    PrecioOT = p.PrecioOT,
                    ComentarioOT = p.ComentarioOT,
                    TecnicoOT = p.TecnicoOT,
                }).FirstOrDefault();
                if (r != null)
                {
                    ot = new OrdenTaller(r.IdOT, r.ProductoOT, r.FechaOT, r.ClienteOT, r.DeclaracionCOT, r.EstadoOT, r.PrecioOT, r.ComentarioOT, r.TecnicoOT);
                }
            }

            return(ot);
        }
        public LOrdenTaller getLOrdTaller(OrdenTaller dtot)
        {
            LOrdenTaller logicaot = new LOrdenTaller();

            logicaot.IdOT1           = dtot.IdOT;
            logicaot.ProductoOT1     = dtot.ProductoOT;
            logicaot.FechaOT1        = dtot.FechaOT;
            logicaot.ClienteOT1      = dtot.ClienteOT;
            logicaot.DeclaracionCOT1 = dtot.DeclaracionCOT;
            logicaot.PrecioOT1       = dtot.PrecioOT;
            logicaot.ComentarioOT1   = dtot.ComentarioOT;
            logicaot.Estado          = dtot.EstadoOT;
            logicaot.TecnicoOT1      = dtot.TecnicoOT;
            return(logicaot);
        }
Ejemplo n.º 6
0
 public void cambiarEstado(OrdenTaller ordent)
 {
     FabricaDatos.GetOrdenTaller().cambiarEstado(ordent);
 }
Ejemplo n.º 7
0
 public void addot(OrdenTaller addp)
 {
     FabricaDatos.GetOrdenTaller().agregarOT(addp);
 }
 public OrdenTaller agregarOrdenTaller([FromBody] OrdenTaller ordenTaller)
 {
     return(FabricaLogica.GetControladorOT().agregarOrdenTaller(ordenTaller));
 }