public ActionResult CreateUsuario([Bind(Include = "nome, password, email, username, idTipo_Usuario")] tbl_usuario usuario) { if (ModelState.IsValid) { //Criptografa a senha //usuario.password = Repositorio.DiversosRepostorio.getMD5Hash(usuario.password).ToLower(); db.tbl_usuario.Add(usuario); db.SaveChanges(); //Repositorio.LogSistemasRepositorio.GravaLog((int)System.Web.HttpContext.Current.Session["idUsuario"], "Usuario", "Criando Registro : " + usuario.id); return(RedirectToAction("IndexUsuario")); } return(View()); }
public void WriteData(IList <Entity> data) { var cntr = 0; foreach (var person in data) { var dto = new BPO_Entity(); dto.company_country = person.company_country; dto.entity_id = person.entity_id.ToString(); dto.entity_name = person.entity_name; dto.sanctions_descr = person.sanctions_descr; dto.sanctions_references = person.sanctions_references; context.BPO_Entity.Add(dto); Console.WriteLine("Adding line to batch write " + cntr); cntr++; } context.SaveChanges(); }
public void WriteData(IList <Person> data) { var cntr = 0; foreach (var person in data) { var dto = new BPO_Person(); dto.country_code = person.country_code; dto.date_year = person.date_year.ToString(); dto.gender = person.gender; dto.person_id = person.person_id.ToString(); dto.person_namex = person.person_namex; dto.sanctions_descr = person.sanctions_descr; dto.sanctions_references = person.sanctions_references; Console.WriteLine("Adding line to batch write " + cntr); cntr++; context.BPO_Person.Add(dto); } Console.WriteLine("About to batch write.."); context.SaveChanges(); Console.WriteLine("Batch write complete!!.."); }