public SSF_MENU Find(int id) { SSF_MENU menu = null; menu = CommonBC.ModeloSafe.SSF_MENU.Find(id); return(menu); }
public bool Add(SSF_MENU menu) { try { CommonBC.ModeloSafe.SSF_MENU.Add(menu); 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_MENU menu = CommonBC.ModeloSafe.SSF_MENU.Find(id); CommonBC.ModeloSafe.SSF_MENU.Remove(menu); CommonBC.ModeloSafe.SaveChanges(); return(true); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Error Remove: {0}", ex.Message); return(false); } }
public bool Update(SSF_MENU menu) { try { SSF_MENU menuUpdate = null; menuUpdate = CommonBC.ModeloSafe.SSF_MENU.Find(menu.ID); menuUpdate.NOMBRE = menu.NOMBRE; CommonBC.ModeloSafe.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool AddSP(SSF_MENU menu) { String sglosa = string.Empty; var param1 = new OracleParameter("p_nombre", OracleDbType.Varchar2, 150, obj: menu.NOMBRE, direction: ParameterDirection.Input); var param2 = new OracleParameter("o_glosa", OracleDbType.Varchar2, 100, obj: sglosa, direction: ParameterDirection.Output); var param3 = new OracleParameter("o_estado", OracleDbType.Int16, ParameterDirection.Output); var param4 = new OracleParameter("o_id", OracleDbType.Decimal, ParameterDirection.Output); CommonBC.ModeloSafe.Database.ExecuteSqlCommand( "BEGIN pkg_ssfMenu.sp_add(:p_nombre, :o_glosa, :o_estado, :o_id); end;", param1, param2, param3, param4); System.Diagnostics.Debug.WriteLine("o_glosa: {0}", param2.Value); System.Diagnostics.Debug.WriteLine("o_estado: {0}", param3.Value); System.Diagnostics.Debug.WriteLine("o_id: {0}", param4.Value); if (param2.Value.ToString().ToLower().Contains("xito")) { return(true); } else { return(false); } }