public void Alterar(AMIGO oAmigo, bool attach = true) { if (attach) { odb.Entry(oAmigo).State = System.Data.Entity.EntityState.Modified; } odb.SaveChanges(); }
private bool VerificaLogin(string Email, string Senha) { AMIGO oAmigo = repositoryAmigo.VerificaLogin(Email, Senha); if (oAmigo != null) { return(true); } return(false); }
private void BtnExcluir_Click(object sender, EventArgs e) { AMIGO oAmigo; oAmigo = _Control.SelecionarID(Convert.ToInt32(TxtIDAmigo.Text)); if (Mensagens.MsgPerguntaExclusao() == DialogResult.Yes) { _Control.Excluir(oAmigo); LimpaDados(); Mensagens.MsgExcluido(); this.Close(); } }
private void GrdAmigos_CellClick(object sender, DataGridViewCellEventArgs e) { AMIGO oAmigo = ((AMIGO)GrdAmigos.Rows[e.RowIndex].DataBoundItem); if (GrdAmigos.Rows[e.RowIndex].DataBoundItem != null) { if (GrdAmigos.Columns[e.ColumnIndex].Name == "BtnEscolher") { TelaCadastroAmigo frmAmigo = new TelaCadastroAmigo(oAmigo); frmAmigo.MdiParent = this.MdiParent; frmAmigo.Show(); this.Close(); } } }
public ActionResult Create(AMIGO oAmigo, HttpPostedFileBase imagem) { if (ModelState.IsValid) { // Upload Imagem string path = String.Empty; string pic = String.Empty; if (imagem != null) { pic = Path.GetFileName(imagem.FileName); path = Path.Combine(Server.MapPath("~/Content/imagens"), pic); imagem.SaveAs(pic); } _repositoryAmigo.Incluir(oAmigo); return(RedirectToAction("Signin", "Login")); } return(View(oAmigo)); }
public TelaCadastroAmigo(AMIGO amigo) { InitializeComponent(); _amigo = amigo; PopulaCampos(); }
/// <summary> /// Metodo para eliminar una amistad :(. /// </summary> /// <param name="pAmigo"> Es un objeto tipo amigo, se debe de /// ingresar en el cuerpo del llamado a /// la pagina web.</param> public string Delete([FromBody] AMIGO pAmigo) { dbEntities.usp_DelAmigo(pAmigo.AA_userID, pAmigo.AA_amigoID); dbEntities.SaveChanges(); return(respond); }
public void Excluir(AMIGO oAmigo) { _Repository.Excluir(oAmigo); }
public void Alterar(AMIGO oAmigo, bool attach = true) { _Repository.Alterar(oAmigo, attach); }
public void Incluir(AMIGO oAmigo) { _Repository.Incluir(oAmigo); }
public void Excluir(AMIGO oAmigo) { odb.AMIGO.Attach(oAmigo); odb.AMIGO.Remove(oAmigo); odb.SaveChanges(); }
public void Incluir(AMIGO oAmigo) { odb.AMIGO.Add(oAmigo); odb.SaveChanges(); }