コード例 #1
0
 public ExibirLivro()
 {
     InitializeComponent();
     livroServico  = new LivroServico(new SqlConnection(connectionString));
     vendaServico  = new VendaServico(new SqlConnection(connectionString));
     compraServico = new CompraServico(new SqlConnection(connectionString));
 }
コード例 #2
0
 public PaginaVenda()
 {
     InitializeComponent();
     vendaServico     = new VendaServico(new SqlConnection(connectionString));
     livroServico     = new LivroServico(new SqlConnection(connectionString));
     cadastroServico  = new CadastroServico(new SqlConnection(connectionString));
     dtCompra.Enabled = false;
 }
コード例 #3
0
        public ActionResult DeleteConfirmed(long id)
        {
            VendaServico vendaServico = db.VendaServico.Find(id);

            db.VendaServico.Remove(vendaServico);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "Id,ValorTotal,Descricao,IdFuncionario,IdCliente,DataServico")] VendaServico vendaServico)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vendaServico).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdCliente     = new SelectList(db.Cliente, "Id", "Nome", vendaServico.IdCliente);
     ViewBag.IdFuncionario = new SelectList(db.Funcionario, "Id", "Nome", vendaServico.IdFuncionario);
     return(View(vendaServico));
 }
コード例 #5
0
        // GET: VendaServico/Details/5
        public ActionResult Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VendaServico vendaServico = db.VendaServico.Find(id);

            if (vendaServico == null)
            {
                return(HttpNotFound());
            }
            return(View(vendaServico));
        }
コード例 #6
0
        // GET: VendaServico/Edit/5
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VendaServico vendaServico = db.VendaServico.Find(id);

            if (vendaServico == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IdCliente     = new SelectList(db.Cliente, "Id", "Nome", vendaServico.IdCliente);
            ViewBag.IdFuncionario = new SelectList(db.Funcionario, "Id", "Nome", vendaServico.IdFuncionario);
            return(View(vendaServico));
        }
コード例 #7
0
 public ExibirCadastros()
 {
     InitializeComponent();
     cadastroServico = new CadastroServico(new SqlConnection(connectionString));
     vendaServico    = new VendaServico(new SqlConnection(connectionString));
 }