protected internal override void Antes()
 {
     ep = new ASEGURADORAS();
     Mapper.Map(oDto, ep);
     ctx.ASEGURADORAS.Add(ep);
     byaRpt.id = ep.COD_ASE.ToString();
 }
 protected internal override bool esValido()
 {
     ep = ctx.ASEGURADORAS.Where(t => t.COD_ASE == oDto.COD_ASE).FirstOrDefault();
     if (ep == null) return true;
     else
     {
         byaRpt.Error = true;
         byaRpt.Mensaje = "Ya se encuentra una Vigencia registrada para este año";
         return false;
     }
 }
Beispiel #3
0
        public ActionResult InsCompany(AseguradorasViewModel model)
        {
            using (var db = new SegurosFalabellaEntities())
            {
                if (!ModelState.IsValid)
                {
                    return(View(model));
                }

                var aseguradora = new ASEGURADORAS
                {
                    NOMBRE = model.Nombre
                };

                db.ASEGURADORAS.Add(aseguradora);
                db.SaveChanges();

                return(RedirectToAction("InsCompany"));
            }
        }
 protected internal override bool esValido()
 {
     ep = ctx.ASEGURADORAS.Where(t => t.COD_ASE == oDto.COD_ASE).FirstOrDefault();
     if (ep == null) return false;
     else return true;
 }