コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            retirointeres retirointeres = db.retirointeres.Find(id);

            db.retirointeres.Remove(retirointeres);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "RetiroInteresId,RetiroInteresNro,Valor,Fecha,EmpresaId,Observacion,CreadoPor,FechaCreacion,ModificadoPor,FechaModificacion,Estado")] retirointeres retirointeres)
 {
     if (ModelState.IsValid)
     {
         db.Entry(retirointeres).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     //ViewBag.EmpresaId = new SelectList(db.empresa.Where(c=>c.Estado==true).OrderBy(e=>e.Nit), "EmpresaId", "Nit", retirointeres.EmpresaId);
     ViewBag.EmpresaId = retirointeres.EmpresaId;
     return(View(retirointeres));
 }
コード例 #3
0
        // GET: RetiroInteres/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            retirointeres retirointeres = db.retirointeres.Find(id);

            if (retirointeres == null)
            {
                return(HttpNotFound());
            }
            return(View(retirointeres));
        }
コード例 #4
0
        // GET: RetiroInteres/Create
        public ActionResult Create()
        {
            int empresaId = 0;

            if (Session["EmpresaId"] != null)
            {
                Int32.TryParse(Session["EmpresaId"].ToString(), out empresaId);
            }
            retirointeres r = new retirointeres();

            r.EmpresaId = empresaId;
            //ViewBag.EmpresaId = empresaId;
            r.Fecha = DateTime.Now;
            //new SelectList(db.empresa.Where(c=>c.Estado==true).OrderBy(e=>e.Nit), "EmpresaId", "Nit");
            return(View(r));
        }
コード例 #5
0
        // GET: RetiroInteres/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            string idDecrypted = MiUtil.desEncriptar(HttpUtility.UrlDecode(id));
            int    intId       = Convert.ToInt32(idDecrypted);

            retirointeres retirointeres = db.retirointeres.Find(intId);

            if (retirointeres == null)
            {
                return(HttpNotFound());
            }
            return(View(retirointeres));
        }
コード例 #6
0
        // GET: RetiroInteres/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            string        idDecrypted   = MiUtil.desEncriptar(HttpUtility.UrlDecode(id));
            int           intId         = Convert.ToInt32(idDecrypted);
            retirointeres retirointeres = db.retirointeres.Find(intId);

            if (retirointeres == null)
            {
                return(HttpNotFound());
            }
            //ViewBag.EmpresaId = new SelectList(db.empresa.Where(c=>c.Estado==true).OrderBy(e=>e.Nit), "EmpresaId", "Nit", retirointeres.EmpresaId);
            ViewBag.EmpresaId = retirointeres.EmpresaId;
            return(View(retirointeres));
        }
コード例 #7
0
        public ActionResult Create([Bind(Include = "RetiroInteresId,Valor,Fecha,EmpresaId,Observacion,CreadoPor,FechaCreacion,ModificadoPor,FechaModificacion,Estado")] retirointeres retirointeres)
        {
            if (ModelState.IsValid)
            {
                //int empresaId = 0;
                //if (Session["EmpresaId"] != null)
                //    Int32.TryParse(Session["EmpresaId"].ToString(), out empresaId);
                consecutivo c = db.consecutivo.Find(retirointeres.EmpresaId);
                c.RetiroInteresNro             = c.RetiroInteresNro + 1;
                retirointeres.RetiroInteresNro = c.RetiroInteresNro;

                db.retirointeres.Add(retirointeres);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.EmpresaId = retirointeres.EmpresaId;
            //ViewBag.EmpresaId = new SelectList(db.empresa.Where(c=>c.Estado==true).OrderBy(e=>e.Nit), "EmpresaId", "Nit", retirointeres.EmpresaId);
            return(View(retirointeres));
        }