Exemple #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Colonias colonias = await db.Colonias.FindAsync(id);

            db.Colonias.Remove(colonias);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public async Task <ActionResult> Edit([Bind(Include = "IdColonia,Colonia")] Colonias colonias)
        {
            if (ModelState.IsValid)
            {
                colonias.Colonia         = Seguridad.Encrypt(colonias.Colonia);
                db.Entry(colonias).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(colonias));
        }
Exemple #3
0
        public async Task <ActionResult> Create([Bind(Include = "IdColonia,Colonia")] Colonias colonias)
        {
            if (ModelState.IsValid)
            {
                colonias.Colonia = Seguridad.Encrypt(colonias.Colonia);
                db.Colonias.Add(colonias);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(colonias));
        }
Exemple #4
0
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Colonias colonias = await db.Colonias.FindAsync(id);

            if (colonias == null)
            {
                return(HttpNotFound());
            }
            return(View(colonias));
        }
Exemple #5
0
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Colonias colonias = await db.Colonias.FindAsync(id);

            if (colonias == null)
            {
                return(HttpNotFound());
            }
            else
            {
                colonias.Colonia = Seguridad.Decrypt(colonias.Colonia);
            }
            return(View(colonias));
        }
Exemple #6
0
 public void ColoniasAdd(string value)
 {
     Colonias.Add(value);
 }
        public List<Colonias> CargaColonias(string Municipio)
        {
            int mun;
            mun = Convert.ToInt32(Municipio);
            List<Colonias> colonias = new List<Colonias>();
            sqlDataAdapter.SelectCommand = new SqlCommand();
            sqlDataAdapter.SelectCommand.Connection = sqlConnectionWeb;
            sqlDataAdapter.SelectCommand.CommandText = "ConsultaColonias";
            sqlDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;

            SqlParameter Param1 = new SqlParameter("@Id_Municipio", SqlDbType.Int);
            Param1.Direction = ParameterDirection.Input;
            Param1.Value = mun;
            sqlDataAdapter.SelectCommand.Parameters.Add(Param1);
            sqlDataAdapter.Fill(ds, "ConsultaColonias");

            foreach (DataRow dr in ds.Tables["ConsultaColonias"].Rows)
            {
                Colonias tmp = new Colonias();
                tmp.Id = Convert.ToString(dr["Id_Colonia"]);
                tmp.Name = Convert.ToString(dr["Colonia"]);

                colonias.Add(tmp);

            }

            return colonias;
        }
Exemple #8
0
        private void recolocarListaDosMovimentosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Colonias obj = new Colonias();

            obj.RecolonizarMovimentos();
        }
Exemple #9
0
        private void recolocarListaDeClientesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Colonias obj = new Colonias();

            obj.RecolonizarClientes();
        }