public async Task <ActionResult> DeleteConfirmed(int id) { Colonias colonias = await db.Colonias.FindAsync(id); db.Colonias.Remove(colonias); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
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)); }
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)); }
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)); }
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)); }
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; }
private void recolocarListaDosMovimentosToolStripMenuItem_Click(object sender, EventArgs e) { Colonias obj = new Colonias(); obj.RecolonizarMovimentos(); }
private void recolocarListaDeClientesToolStripMenuItem_Click(object sender, EventArgs e) { Colonias obj = new Colonias(); obj.RecolonizarClientes(); }