public bool AddSP(SSF_VISTA vista) { String sglosa = string.Empty; var param1 = new OracleParameter("p_nombre", OracleDbType.Varchar2, 150, obj: vista.NOMBRE, direction: ParameterDirection.Input); var param2 = new OracleParameter("p_url", OracleDbType.Varchar2, 200, obj: vista.URL, direction: ParameterDirection.Input); var param3 = new OracleParameter("p_menu", OracleDbType.Decimal, vista.ID_MENU, ParameterDirection.Input); var param4 = new OracleParameter("o_glosa", OracleDbType.Varchar2, 100, obj: sglosa, direction: ParameterDirection.Output); var param5 = new OracleParameter("o_estado", OracleDbType.Int16, ParameterDirection.Output); var param6 = new OracleParameter("o_id", OracleDbType.Decimal, ParameterDirection.Output); CommonBC.ModeloSafe.Database.ExecuteSqlCommand( "BEGIN pkg_ssfVista.sp_add(:p_nombre, :p_url, :p_menu, :o_glosa, :o_estado, :o_id); end;", param1, param2, param3, param4, param5, param6); System.Diagnostics.Debug.WriteLine("o_glosa: {0}", param4.Value); System.Diagnostics.Debug.WriteLine("o_estado: {0}", param5.Value); System.Diagnostics.Debug.WriteLine("o_id: {0}", param6.Value); if (param4.Value.ToString().ToLower().Contains("xito")) { return(true); } else { return(false); } }
public SSF_VISTA Find(int id) { SSF_VISTA vista = null; vista = CommonBC.ModeloSafe.SSF_VISTA.Find(id); return(vista); }
public bool Add(SSF_VISTA vista) { try { CommonBC.ModeloSafe.SSF_VISTA.Add(vista); CommonBC.ModeloSafe.SaveChanges(); return(true); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Error: {0}", ex.Message); return(false); } }
public bool Remove(int id) { try { SSF_VISTA vista = CommonBC.ModeloSafe.SSF_VISTA.Find(id); CommonBC.ModeloSafe.SSF_VISTA.Remove(vista); CommonBC.ModeloSafe.SaveChanges(); return(true); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Error Remove: {0}", ex.Message); return(false); } }
public bool Update(SSF_VISTA vista) { try { SSF_VISTA vistaUpdate = null; vistaUpdate = CommonBC.ModeloSafe.SSF_VISTA.Find(vista.ID); vistaUpdate.NOMBRE = vista.NOMBRE; vistaUpdate.URL = vista.URL; vistaUpdate.ID_MENU = vista.ID_MENU; CommonBC.ModeloSafe.SaveChanges(); return(true); } catch (Exception) { return(false); } }