Example #1
0
        public bool Update(Project Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Projects_Update");
                DataAccessEnterprise.AddParameter(_command, "@PROJ_ID", Item.PROJ_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@INVE_ID", Item.INVE_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_Name", Item.PROJ_Name, SqlDbType.VarChar, 50, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_OverallProfitability", Item.PROJ_OverallProfitability, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_ExecutionTime", Item.PROJ_ExecutionTime, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_InvestmentCapital", Item.PROJ_InvestmentCapital, SqlDbType.Decimal, 10, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_Modality", Item.PROJ_Modality, SqlDbType.VarChar, 50, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_PromotionDate", Item.PROJ_PromotionDate, SqlDbType.Date, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_ExpirationDate", Item.PROJ_ExpirationDate, SqlDbType.Date, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_Progress", Item.PROJ_Progress, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_Description", Item.PROJ_Description, SqlDbType.VarChar, 200, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_State", Item.PROJ_State, SqlDbType.Char, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserModi", Item.AUDI_UserModi, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechModi", Item.AUDI_FechModi, SqlDbType.DateTime, 8, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    return(true);
                }
                logError = new LogError()
                {
                    Message        = "Registro no encontrado",
                    ErrorValidado  = true,
                    MensajeUsuario = "Error en procesar petición, El registro no existe"
                };
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #2
0
        public bool Update(Person Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Persons_Update");
                DataAccessEnterprise.AddParameter(_command, "@PERS_ID", Item.PERS_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PERS_Names", Item.PERS_Names, SqlDbType.VarChar, 25, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PERS_LastName", Item.PERS_LastName, SqlDbType.VarChar, 25, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PERS_MotherLastName", Item.PERS_MotherLastName, SqlDbType.VarChar, 25, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PERS_BirthDate", Item.PERS_BirthDate, SqlDbType.DateTime, 8, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_TabGEN", Item.TYPE_TabGEN, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_CodGEN", Item.TYPE_CodGEN, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_TabDOC", Item.TYPE_TabDOC, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_CodDOC", Item.TYPE_CodDOC, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserModi", Item.AUDI_UserModi, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechModi", Item.AUDI_FechModi, SqlDbType.DateTime, 8, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    return(true);
                }
                logError = new LogError()
                {
                    Message        = "Registro no encontrado",
                    ErrorValidado  = true,
                    MensajeUsuario = "Error en procesar petición, El registro no existe"
                };
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #3
0
        public bool Update(Investment Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Investments_Update");
                DataAccessEnterprise.AddParameter(_command, "@INVE_ID", Item.INVE_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@USER_ID", Item.USER_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@INVE_Amount", Item.INVE_Amount, SqlDbType.Decimal, 10, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@INVE_Date", Item.INVE_Date, SqlDbType.DateTime, 8, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@INVE_Observation", Item.INVE_Observation, SqlDbType.VarChar, 200, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@INVE_CostEffectiveness", Item.INVE_CostEffectiveness, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@INVE_State", Item.INVE_State, SqlDbType.Char, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserModi", Item.AUDI_UserModi, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechModi", Item.AUDI_FechModi, SqlDbType.DateTime, 8, ParameterDirection.Input);
                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    //if (Int32.TryParse(_command.Parameters["@PERS_ID"].Value.ToString(), out Int32 _PERS_ID))
                    //{ Item.PERS_ID = _PERS_ID; }

                    return(true);
                }
                logError = new LogError()
                {
                    Message        = "Registro no encontrado",
                    ErrorValidado  = true,
                    MensajeUsuario = "Error en procesar petición, El registro no existe"
                };
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #4
0
        public bool Update(SessionKey Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("SessionKeys_Update");

                DataAccessEnterprise.AddParameter(_command, "@SESS_ID", Item.SESS_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@SESS_Date", Item.SESS_Date, SqlDbType.Date, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@SESS_PrivateKeyXML", Item.SESS_PrivateKeyXML, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@SESS_PublicKeyXML", Item.SESS_PublicKeyXML, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@SESS_PrivateKeyPEM", Item.SESS_PrivateKeyPEM, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@SESS_PublicKeyPEM", Item.SESS_PublicKeyPEM, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserModi", Item.AUDI_UserModi, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechModi", Item.AUDI_FechModi, SqlDbType.DateTime, 8, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    return(true);
                }
                logError = new LogError()
                {
                    Message        = "Registro no encontrado",
                    ErrorValidado  = true,
                    MensajeUsuario = "Error en procesar petición, El registro no existe"
                };
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }

            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #5
0
        public bool Update(Type Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Types_Update");

                DataAccessEnterprise.AddParameter(_command, "@TYPE_CodTable", Item.TYPE_CodTable, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_CodType", Item.TYPE_CodType, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_Desc1", Item.TYPE_Desc1, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_Desc2", Item.TYPE_Desc2, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_Num1", Item.TYPE_Num1, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_Num2", Item.TYPE_Num2, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_Status", Item.TYPE_Status, SqlDbType.Char, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserModi", Item.AUDI_UserModi, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechModi", Item.AUDI_FechModi, SqlDbType.DateTime, 8, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    return(true);
                }
                logError = new LogError()
                {
                    Message        = "Registro no encontrado",
                    ErrorValidado  = true,
                    MensajeUsuario = "Error en procesar petición, El registro no existe"
                };
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #6
0
 public bool Update(Media Item, out LogError logError)
 {
     logError = null;
     try
     {
         SqlCommand _command = DataAccessEnterprise.AsignProcedure("Media_Update");
         DataAccessEnterprise.AddParameter(_command, "@MEDI_ID         ", Item.MEDI_ID, SqlDbType.Int, 1, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@PROJ_ID         ", Item.PROJ_ID, SqlDbType.Int, 1, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@EVEN_ID         ", Item.EVEN_ID, SqlDbType.Int, 1, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@MEDI_Event      ", Item.MEDI_Event, SqlDbType.Bit, 2, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@MEDI_Title      ", Item.MEDI_Title, SqlDbType.VarChar, 50, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@MEDI_Description", Item.MEDI_Description, SqlDbType.VarChar, 250, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@MEDI_Url        ", Item.MEDI_Url, SqlDbType.VarChar, 100, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@TYPE_TabMED     ", Item.TYPE_TabMED, SqlDbType.VarChar, 3, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@TYPE_CodMED     ", Item.TYPE_CodMED, SqlDbType.VarChar, 3, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@AUDI_UserModi", Item.AUDI_UserModi, SqlDbType.VarChar, 20, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@AUDI_FechModi", Item.AUDI_FechModi, SqlDbType.DateTime, 8, ParameterDirection.Input);
         if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
         {
             return(true);
         }
         logError = new LogError()
         {
             Message        = "Registro no encontrado",
             ErrorValidado  = true,
             MensajeUsuario = "Error en procesar petición, El registro no existe"
         };
     }
     catch (SqlException e)
     {
         logError = new LogError()
         {
             Message     = e.Message,
             StackTracer = e.StackTrace,
             NumberError = e.Number
         };
     }
     catch (Exception e)
     {
         logError = new LogError()
         {
             Message     = e.Message,
             StackTracer = e.StackTrace,
             NumberError = null
         };
     }
     DataAccessEnterprise.EndConnection();
     return(false);
 }
Example #7
0
        public bool Insert(Project Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Projects_Insert");
                DataAccessEnterprise.AddParameter(_command, "@INVE_ID", Item.INVE_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_Name", Item.PROJ_Name, SqlDbType.VarChar, 50, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_OverallProfitability", Item.PROJ_OverallProfitability, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_ExecutionTime", Item.PROJ_ExecutionTime, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_InvestmentCapital", Item.PROJ_InvestmentCapital, SqlDbType.Decimal, 10, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_Modality", Item.PROJ_Modality, SqlDbType.VarChar, 50, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_PromotionDate", Item.PROJ_PromotionDate, SqlDbType.Date, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_ExpirationDate", Item.PROJ_ExpirationDate, SqlDbType.Date, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_Progress", Item.PROJ_Progress, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_Description", Item.PROJ_Description, SqlDbType.VarChar, 200, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PROJ_State", Item.PROJ_State, SqlDbType.Char, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserCrea", Item.AUDI_UserCrea, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechCrea", Item.AUDI_FechCrea, SqlDbType.Date, 8, ParameterDirection.Input);
                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    //if (Int32.TryParse(_command.Parameters["@PERS_ID"].Value.ToString(), out Int32 _PERS_ID))
                    //{ Item.PERS_ID = _PERS_ID; }

                    return(true);
                }
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #8
0
        public bool Insert(Person Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Persons_Insert");
                //  _command.Connection = DataAccessEnterprise.BeginConnection();
                //  {
                DataAccessEnterprise.AddParameter(_command, "@PERS_Names", Item.PERS_Names, SqlDbType.VarChar, 25, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PERS_LastName", Item.PERS_LastName, SqlDbType.VarChar, 25, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PERS_MotherLastName", Item.PERS_MotherLastName, SqlDbType.VarChar, 25, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PERS_BirthDate", Item.PERS_BirthDate, SqlDbType.DateTime, 8, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_TabGEN", Item.TYPE_TabGEN, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_CodGEN", Item.TYPE_CodGEN, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_TabDOC", Item.TYPE_TabDOC, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_CodDOC", Item.TYPE_CodDOC, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserCrea", Item.AUDI_UserCrea, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechCrea", Item.AUDI_FechCrea, SqlDbType.Date, 8, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    return(true);
                }
                // }
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #9
0
        public bool Update(User Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Users_Update");
                DataAccessEnterprise.AddParameter(_command, "@USER_ID", Item.USER_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@PERS_ID", Item.PERS_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@USER_Email", Item.USER_Email, SqlDbType.VarChar, 25, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@USER_Password", Item.USER_Password, SqlDbType.VarChar, 200, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@USER_Admin", Item.USER_Admin, SqlDbType.Bit, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@USER_Status", Item.USER_Status, SqlDbType.Char, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserModi", Item.AUDI_UserModi, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechModi", Item.AUDI_FechModi, SqlDbType.DateTime, 8, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    return(true);
                }
                logError = new LogError()
                {
                    Message        = "Registro no encontrado",
                    ErrorValidado  = true,
                    MensajeUsuario = "Error en procesar petición, El registro no existe"
                };
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            return(false);
        }
Example #10
0
        public bool Insert(Type Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Types_Insert");
                DataAccessEnterprise.AddParameter(_command, "@TYPE_CodTable", Item.TYPE_CodTable, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_CodType", Item.TYPE_CodType, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_Desc1", Item.TYPE_Desc1, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_Desc2", Item.TYPE_Desc2, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_Num1", Item.TYPE_Num1, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_Num2", Item.TYPE_Num2, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_Status", Item.TYPE_Status, SqlDbType.Char, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserCrea", Item.AUDI_UserCrea, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechCrea", Item.AUDI_FechCrea, SqlDbType.Date, 8, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    //if (Int32.TryParse(_command.Parameters["@PERS_ID"].Value.ToString(), out Int32 _PERS_ID))
                    //{ Item.PERS_ID = _PERS_ID; }

                    return(true);
                }
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #11
0
        public bool Update(Log Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Logs_Update");
                DataAccessEnterprise.AddParameter(_command, "@LOG_ID", Item.LOG_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@LOG_Date", Item.LOG_Date, SqlDbType.DateTime, 8, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_TabAUD", Item.TYPE_TabAUD, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_CodAUD", Item.TYPE_CodAUD, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@LOG_Object", Item.LOG_Object, SqlDbType.VarChar, 30, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@LOG_Text", Item.LOG_Text, SqlDbType.Text, 250, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    return(true);
                }
                logError = new LogError()
                {
                    Message        = "Registro no encontrado",
                    ErrorValidado  = true,
                    MensajeUsuario = "Error en procesar petición, El registro no existe"
                };
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #12
0
        public bool Insert(User Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Users_Insert");

                DataAccessEnterprise.AddParameter(_command, "@PERS_ID", Item.PERS_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@USER_Email", Item.USER_Email, SqlDbType.VarChar, 25, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@USER_Password", Item.USER_Password, SqlDbType.VarChar, 200, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@USER_Admin", Item.USER_Admin, SqlDbType.Bit, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@USER_Status", Item.USER_Status, SqlDbType.Char, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserCrea", Item.AUDI_UserCrea, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechCrea", Item.AUDI_FechCrea, SqlDbType.Date, 8, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    //if (Int32.TryParse(_command.Parameters["@PERS_ID"].Value.ToString(), out Int32 _PERS_ID))
                    //{ Item.PERS_ID = _PERS_ID; }

                    return(true);
                }
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            return(false);
        }
Example #13
0
        public bool Insert(Media Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Media_Insert");
                DataAccessEnterprise.AddParameter(_command, "@PROJ_ID         ", Item.PROJ_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@EVEN_ID         ", Item.EVEN_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@MEDI_Event      ", Item.MEDI_Event, SqlDbType.Bit, 2, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@MEDI_Title      ", Item.MEDI_Title, SqlDbType.VarChar, 50, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@MEDI_Description", Item.MEDI_Description, SqlDbType.VarChar, 250, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@MEDI_Url        ", Item.MEDI_Url, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_TabMED     ", Item.TYPE_TabMED, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_CodMED     ", Item.TYPE_CodMED, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserCrea", Item.AUDI_UserCrea, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechCrea", Item.AUDI_FechCrea, SqlDbType.Date, 8, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    return(true);
                }
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #14
0
        public bool Insert(Event Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Events_Insert");
                DataAccessEnterprise.AddParameter(_command, "@PROJ_ID", Item.PROJ_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@EVEN_StartDate", Item.EVEN_StartDate, SqlDbType.DateTime, 8, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@EVEN_EndingDate", Item.EVEN_EndingDate, SqlDbType.DateTime, 8, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@EVEN_State", Item.EVEN_State, SqlDbType.Char, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@EVEN_Title", Item.EVEN_Title, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@EVEN_Description", Item.EVEN_Description, SqlDbType.VarChar, 200, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserCrea", Item.AUDI_UserCrea, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechCrea", Item.AUDI_FechCrea, SqlDbType.Date, 8, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    //if (Int32.TryParse(_command.Parameters["@PERS_ID"].Value.ToString(), out Int32 _PERS_ID))
                    //{ Item.PERS_ID = _PERS_ID; }

                    return(true);
                }
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            return(false);
        }
Example #15
0
        public bool Insert(Investment Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Investments_Insert");
                DataAccessEnterprise.AddParameter(_command, "@USER_ID", Item.USER_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@INVE_Amount", Item.INVE_Amount, SqlDbType.Decimal, 10, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@INVE_Date", Item.INVE_Date, SqlDbType.DateTime, 8, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@INVE_Observation", Item.INVE_Observation, SqlDbType.VarChar, 200, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@INVE_CostEffectiveness", Item.INVE_CostEffectiveness, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@INVE_State", Item.INVE_State, SqlDbType.Char, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserCrea", Item.AUDI_UserCrea, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechCrea", Item.AUDI_FechCrea, SqlDbType.DateTime, 8, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    return(true);
                }
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #16
0
        public bool Insert(SessionKey Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("SessionKeys_Insert");

                DataAccessEnterprise.AddParameter(_command, "@SESS_ID", Item.SESS_ID, SqlDbType.Int, 1, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@SESS_Date", Item.SESS_Date, SqlDbType.Date, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@SESS_PrivateKeyXML", Item.SESS_PrivateKeyXML, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@SESS_PublicKeyXML", Item.SESS_PublicKeyXML, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@SESS_PrivateKeyPEM", Item.SESS_PrivateKeyPEM, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@SESS_PublicKeyPEM", Item.SESS_PublicKeyPEM, SqlDbType.VarChar, 100, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_UserCrea", Item.AUDI_UserCrea, SqlDbType.VarChar, 20, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@AUDI_FechCrea", Item.AUDI_FechCrea, SqlDbType.Date, 8, ParameterDirection.Input);
                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    return(true);
                }
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }
Example #17
0
 public bool Delete(int SESS_ID, DateTime SESS_Date, out LogError logError)
 {
     logError = null;
     try
     {
         SqlCommand _command = DataAccessEnterprise.AsignProcedure("SessionKeys_Delete");
         DataAccessEnterprise.AddParameter(_command, "@SESS_ID", SESS_ID, SqlDbType.Int, 1, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@SESS_Date", SESS_Date, SqlDbType.DateTime, 8, ParameterDirection.Input);
         if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
         {
             return(true);
         }
         logError = new LogError()
         {
             Message        = "Registro no encontrado",
             ErrorValidado  = true,
             MensajeUsuario = "Error en procesar petición, El registro no existe"
         };
     }
     catch (SqlException e)
     {
         logError = new LogError()
         {
             Message     = e.Message,
             StackTracer = e.StackTrace,
             NumberError = e.Number
         };
     }
     catch (Exception e)
     {
         logError = new LogError()
         {
             Message     = e.Message,
             StackTracer = e.StackTrace,
             NumberError = null
         };
     }
     DataAccessEnterprise.EndConnection();
     return(false);
 }
Example #18
0
 public bool Delete(string codTable, string codType, out LogError logError)
 {
     logError = null;
     try
     {
         SqlCommand _command = DataAccessEnterprise.AsignProcedure("Types_Delete");
         DataAccessEnterprise.AddParameter(_command, "@TYPE_CodTable", codTable, SqlDbType.VarChar, 3, ParameterDirection.Input);
         DataAccessEnterprise.AddParameter(_command, "@TYPE_CodType", codType, SqlDbType.VarChar, 3, ParameterDirection.Input);
         if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
         {
             return(true);
         }
         logError = new LogError()
         {
             Message        = "Registro no encontrado",
             ErrorValidado  = true,
             MensajeUsuario = "Error en procesar petición, El registro no existe"
         };
     }
     catch (SqlException e)
     {
         logError = new LogError()
         {
             Message     = e.Message,
             StackTracer = e.StackTrace,
             NumberError = e.Number
         };
     }
     catch (Exception e)
     {
         logError = new LogError()
         {
             Message     = e.Message,
             StackTracer = e.StackTrace,
             NumberError = null
         };
     }
     DataAccessEnterprise.EndConnection();
     return(false);
 }
Example #19
0
        public bool Insert(Log Item, out LogError logError)
        {
            logError = null;
            try
            {
                SqlCommand _command = DataAccessEnterprise.AsignProcedure("Logs_Insert");
                DataAccessEnterprise.AddParameter(_command, "@LOG_Date", Item.LOG_Date, SqlDbType.DateTime, 0, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_TabAUD", Item.TYPE_TabAUD, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@TYPE_CodAUD", Item.TYPE_CodAUD, SqlDbType.VarChar, 3, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@LOG_Object", Item.LOG_Object, SqlDbType.VarChar, 30, ParameterDirection.Input);
                DataAccessEnterprise.AddParameter(_command, "@LOG_Text", Item.LOG_Text, SqlDbType.Text, 250, ParameterDirection.Input);

                if (DataAccessEnterprise.ExecuteNonQuery(_command, null) > 0)
                {
                    return(true);
                }
            }
            catch (SqlException e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = e.Number
                };
            }
            catch (Exception e)
            {
                logError = new LogError()
                {
                    Message     = e.Message,
                    StackTracer = e.StackTrace,
                    NumberError = null
                };
            }
            DataAccessEnterprise.EndConnection();
            return(false);
        }