private void toolStripButton1_Click(object sender, EventArgs e) { string tabName = "Venta"; Boolean encontrado = false; foreach (TabPage page in Home.TabPages) { string name = page.Name; if (name == tabName) { encontrado = true; Home.SelectTab(tabName); } } if (encontrado == false) { TabPage tpage = new TabPage(tabName); tpage.Name = tabName; caja fc = new caja(); fc.TopLevel = false; fc.Visible = true; fc.MdiParent = this; fc.FormBorderStyle = FormBorderStyle.None; fc.Dock = DockStyle.Fill; Home.TabPages.Add(tpage); int ultimo = (Home.TabPages.Count - 1); Home.TabPages[ultimo].Controls.Add(fc); Home.SelectTab(tabName); } }
public ActionResult DeleteConfirmed(long id) { caja caja = db.caja.Find(id); db.caja.Remove(caja); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id_caja,descripcion,id_usuario")] caja caja) { if (ModelState.IsValid) { db.Entry(caja).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(caja)); }
public ActionResult Edit(caja caja) { if (ModelState.IsValid) { db.Entry(caja).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SUCURSAL_id = new SelectList(db.sucursal, "id", "nombre", caja.SUCURSAL_id); return(View(caja)); }
public ActionResult Create([Bind(Include = "id_caja,descripcion,id_usuario")] caja caja) { if (ModelState.IsValid) { db.caja.Add(caja); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(caja)); }
public ActionResult Create(caja caja) { if (ModelState.IsValid) { db.caja.Add(caja); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SUCURSAL_id = new SelectList(db.sucursal, "id", "nombre", caja.SUCURSAL_id); return(View(caja)); }
// GET: Cajas/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } caja caja = db.caja.Find(id); if (caja == null) { return(HttpNotFound()); } return(View(caja)); }
// // GET: /Caja/Details/5 public ActionResult Details(long id = 0) { int rol = Convert.ToInt16(Session["Rol_id"]); bool Validacion = SEG.ValidarAcceso(rol, "Caja", "Details"); if (Validacion) { caja caja = db.caja.Find(id); if (caja == null) { return(HttpNotFound()); } return(View(caja)); } else { return(RedirectToAction("Error")); } }
// // GET: /Caja/Edit/5 public ActionResult Edit(long id = 0) { int rol = Convert.ToInt16(Session["Rol_id"]); bool Validacion = SEG.ValidarAcceso(rol, "Caja", "Edit"); if (Validacion) { caja caja = db.caja.Find(id); if (caja == null) { return(HttpNotFound()); } ViewBag.SUCURSAL_id = new SelectList(db.sucursal, "id", "nombre", caja.SUCURSAL_id); return(View(caja)); } else { return(RedirectToAction("Error")); } }