Exemple #1
0
        public bool AddSP(SSF_PERFIL perfil)
        {
            String sglosa = string.Empty;
            var    param1 = new OracleParameter("p_perfil", OracleDbType.Varchar2, 50, obj: perfil.PERFIL, direction: ParameterDirection.Input);
            var    param2 = new OracleParameter("p_descripcion", OracleDbType.Varchar2, 150, obj: perfil.DESCRIPCION, direction: ParameterDirection.Input);
            var    param3 = new OracleParameter("o_glosa", OracleDbType.Varchar2, 100, obj: sglosa, direction: ParameterDirection.Output);
            var    param4 = new OracleParameter("o_estado", OracleDbType.Int16, ParameterDirection.Output);
            var    param5 = new OracleParameter("o_id", OracleDbType.Decimal, ParameterDirection.Output);

            CommonBC.ModeloSafe.Database.ExecuteSqlCommand(
                "BEGIN pkg_ssfPerfil.sp_add(:p_perfil, :p_descripcion, :o_glosa, :o_estado, :o_id); end;",
                param1, param2, param3, param4, param5);
            System.Diagnostics.Debug.WriteLine("o_glosa: {0}", param3.Value);
            System.Diagnostics.Debug.WriteLine("o_estado: {0}", param4.Value);
            System.Diagnostics.Debug.WriteLine("o_id: {0}", param5.Value);

            if (param3.Value.ToString().ToLower().Contains("xito"))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #2
0
        public SSF_PERFIL Find(int id)
        {
            SSF_PERFIL perfil = null;

            perfil = CommonBC.ModeloSafe.SSF_PERFIL.Find(id);
            return(perfil);
        }
Exemple #3
0
 public bool Add(SSF_PERFIL perfil)
 {
     try
     {
         CommonBC.ModeloSafe.SSF_PERFIL.Add(perfil);
         CommonBC.ModeloSafe.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine("Error: {0}", ex.Message);
         return(false);
     }
 }
Exemple #4
0
 public bool Remove(int id)
 {
     try
     {
         SSF_PERFIL perfil = CommonBC.ModeloSafe.SSF_PERFIL.Find(id);
         CommonBC.ModeloSafe.SSF_PERFIL.Remove(perfil);
         CommonBC.ModeloSafe.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine("Error Remove: {0}", ex.Message);
         return(false);
     }
 }
Exemple #5
0
 public bool Update(SSF_PERFIL perfil)
 {
     try
     {
         SSF_PERFIL perfilUpdate = null;
         perfilUpdate             = CommonBC.ModeloSafe.SSF_PERFIL.Find(perfil.ID);
         perfilUpdate.PERFIL      = perfil.PERFIL;
         perfilUpdate.DESCRIPCION = perfil.DESCRIPCION;
         CommonBC.ModeloSafe.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }