public ActionResult DeleteConfirmed(int id)
        {
            MesAnoPago mesAnoPago = db.MesAnoPagos.Find(id);

            db.MesAnoPagos.Remove(mesAnoPago);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "mesanoId,mes,ano")] MesAnoPago mesAnoPago)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mesAnoPago).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mesAnoPago));
 }
        public ActionResult Create([Bind(Include = "mesanoId,mes,ano")] MesAnoPago mesAnoPago)
        {
            if (ModelState.IsValid)
            {
                db.MesAnoPagos.Add(mesAnoPago);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mesAnoPago));
        }
        public bool verificaMes(string mes)
        {
            int        ano    = Convert.ToInt16(mes.Substring(0, 4));
            int        mes1   = Convert.ToInt16(mes.Substring(5, 2));
            MesAnoPago mesano = new MesAnoPago();

            mesano = db.MesAnoPagos.FirstOrDefault(x => x.mes.Equals(mes1) && x.ano.Equals(ano));
            if (mesano == null)
            {
                return(true);
            }
            return(false);
        }
        // GET: MesAnoPagos/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MesAnoPago mesAnoPago = db.MesAnoPagos.Find(id);

            if (mesAnoPago == null)
            {
                return(HttpNotFound());
            }
            return(View(mesAnoPago));
        }
        public void salvar(string mes)
        {
            int        ano         = Convert.ToInt16(mes.Substring(0, 4));
            int        mes1        = Convert.ToInt16(mes.Substring(5, 2));
            MesAnoPago MesAnoPago1 = new MesAnoPago();

            MesAnoPago1.mes = mes1;
            MesAnoPago1.ano = ano;
            if (ModelState.IsValid)
            {
                db.MesAnoPagos.Add(MesAnoPago1);
                db.SaveChanges();
            }
        }