Esempio n. 1
0
        // [WebMethod]
        public int FinalizarPedido(int IdMovil, DateTime Fecha)
        {
            int result = 0;

            using (DAL.SinapsisEntities db = new DAL.SinapsisEntities())
            {
                DAL.tel_Pedidos pd = db.tel_Pedidos.Where(p => p.IdEmpresa == Global.IdEmpresa &&
                                                          p.IdMovil == IdMovil && p.Estado == "V").FirstOrDefault();

                if (pd != null)
                {
                    db.tel_AppAsignarMovil(pd.NroPedido, Global.IdEmpresa, IdMovil, "F");
                    result = pd.NroPedido.Value;
                }

                DAL.tel_MovilTracker mt = new DAL.tel_MovilTracker();
                mt.AuditFecha = DateTime.Now;
                mt.IdEmpresa  = Global.IdEmpresa;
                mt.IdMovil    = IdMovil;
                mt.Operacion  = "F";
                mt.Fecha      = Fecha;


                db.tel_MovilTracker.Add(mt);
                db.SaveChanges();
            }
            return(result);
        }
Esempio n. 2
0
        public int PedidoUpdate(int IdPedido)
        {
            int r = 0;

            using (DAL.SinapsisEntities db = new DAL.SinapsisEntities())
            {
                DAL.tel_Pedidos cl = db.tel_Pedidos.Find(IdPedido);
                if (cl != null)
                {
                    cl.EstadoLocal = "L";
                    db.SaveChanges();
                    r = cl.IdPedido;
                }
            }
            return(r);
        }