Пример #1
0
        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);
            }
        }
Пример #2
0
        public ActionResult DeleteConfirmed(long id)
        {
            caja caja = db.caja.Find(id);

            db.caja.Remove(caja);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #3
0
 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));
 }
Пример #4
0
 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));
 }
Пример #5
0
        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));
        }
Пример #6
0
        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));
        }
Пример #7
0
        // 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));
        }
Пример #8
0
        //
        // 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"));
            }
        }
Пример #9
0
        //
        // 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"));
            }
        }