Exemple #1
0
        public bool AddSP(SSF_EXAMENTIPO examentipo)
        {
            String sglosa = string.Empty;
            var    param1 = new OracleParameter("p_tipo", OracleDbType.Varchar2, 150, obj: examentipo.TIPO, direction: ParameterDirection.Input);
            var    param2 = new OracleParameter("p_descripcion", OracleDbType.Varchar2, 150, obj: examentipo.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_ssfExamentipo.sp_add(:p_tipo, :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_EXAMENTIPO Find(int id)
        {
            SSF_EXAMENTIPO examentipo = null;

            examentipo = CommonBC.ModeloSafe.SSF_EXAMENTIPO.Find(id);
            return(examentipo);
        }
Exemple #3
0
 public bool Add(SSF_EXAMENTIPO examentipo)
 {
     try
     {
         CommonBC.ModeloSafe.SSF_EXAMENTIPO.Add(examentipo);
         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_EXAMENTIPO examentipo = CommonBC.ModeloSafe.SSF_EXAMENTIPO.Find(id);
         CommonBC.ModeloSafe.SSF_EXAMENTIPO.Remove(examentipo);
         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_EXAMENTIPO examentipo)
 {
     try
     {
         SSF_EXAMENTIPO examentipoUpdate = null;
         examentipoUpdate             = CommonBC.ModeloSafe.SSF_EXAMENTIPO.Find(examentipo.ID);
         examentipoUpdate.TIPO        = examentipo.TIPO;
         examentipoUpdate.DESCRIPCION = examentipo.DESCRIPCION;
         CommonBC.ModeloSafe.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }