示例#1
0
        //Metodo para modificar la politica
        public bool modificarPolitica(Politica pol)
        {
            String consulta = "exec editarPolitica '" + pol.getMision() +
                              "','" + pol.getVision() + "';";

            return(ejecutar(consulta));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Politica politica = db.Tb_politica.Find(id);

            db.Tb_politica.Remove(politica);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Poli_Id,Poli_Archivo,Empr_Nit,Poli_Registro")] Politica politica)
 {
     if (ModelState.IsValid)
     {
         db.Entry(politica).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Empr_Nit = new SelectList(db.Tb_Empresa, "Empr_Nit", "Empr_Nom", politica.Empr_Nit);
     return(View(politica));
 }
示例#4
0
        //Metodo para obtener la informacion de la politica
        public Politica obtenerPolitica()
        {
            Politica poli     = new Politica();
            String   consulta = "exec obtenerPolitica;";

            ejecutarRetorno(consulta);
            if (dataset.Tables[0].Rows.Count > 0)
            {
                poli.setMision(dataset.Tables[0].Rows[0]["mision"].ToString());
                poli.setVision(dataset.Tables[0].Rows[0]["vision"].ToString());
                dataset.Dispose();
            }
            return(poli);
        }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Politica politica = db.Tb_politica.Find(id);

            if (politica == null)
            {
                return(HttpNotFound());
            }
            return(View(politica));
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Politica politica = db.Tb_politica.Find(id);

            if (politica == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Empr_Nit = new SelectList(db.Tb_Empresa, "Empr_Nit", "Empr_Nom", politica.Empr_Nit);
            return(View(politica));
        }
示例#7
0
        public FormGestionBanco()
        {
            InitializeComponent();
            ctlBanco    = new BancoController();
            ctlPolitica = new PoliticaController();
            Banco    b = new Banco();
            Politica p = new Politica();

            p                   = ctlPolitica.solicitudObtenerPolitica();
            b                   = ctlBanco.solicitudObtenerBanco();
            txtNit.Text         = b.getNit();
            txtNombreBanco.Text = b.getNombre();
            txtDescrpcion.Text  = b.getDescripcion();
            txtMision.Text      = p.getMision();
            txtVision.Text      = p.getVision();
        }
示例#8
0
        public void AgregarBultos(Politica politicaServicio, Bulto bulto)
        {
            if (!IsInProgress)
            {
                return;
            }

            Peso pesoTotal = new Peso(UnidadPeso.Gramo, 0d);

            foreach (var item in _bultos)
            {
                pesoTotal = pesoTotal + item.Peso.CambiarAGramos();
            }

            pesoTotal = pesoTotal + bulto.Peso.CambiarAGramos();

            if (!politicaServicio.EsPesoValido(pesoTotal))
            {
                throw new ArgumentException("Invalid by policy");
            }

            _bultos.Add(bulto);
        }
        public ActionResult SaveRecord(PoliticasViewModel politicasViewModel)
        {
            try
            {
                ApplicationDbContext entity = new ApplicationDbContext();
                {
                    Politica pol = new Politica();
                    pol.Poli_Nom      = politicasViewModel.Poli_Nom;
                    pol.Poli_Archivo  = SaveToPhysicalLocation(politicasViewModel.Poli_Archivo);
                    pol.Poli_Registro = politicasViewModel.Poli_Registro;
                    pol.Empr_Nit      = politicasViewModel.Empr_Nit;

                    entity.Tb_politica.Add(pol);
                    entity.SaveChanges();

                    int latest = pol.Poli_Id;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(RedirectToAction("Create"));
        }
示例#10
0
 public async Task <IActionResult> Post(Politica politica)
 {
     return(Ok("Candidato criado com sucesso!!!"));
 }
示例#11
0
        public bool SolicitudModificarBanco(String mision, String vision)
        {
            Politica pol = new Politica(mision, vision);

            return(polDAO.modificarPolitica(pol));
        }
示例#12
0
        public Politica solicitudObtenerPolitica()
        {
            Politica p = polDAO.obtenerPolitica();

            return(p);
        }
示例#13
0
 public static PoliticaDto ToDto(this Politica entity)
 {
     return(AutoMapper.Mapper.Map <Politica, PoliticaDto>(entity));
 }