Beispiel #1
0
        public static bool InsertFuncionTipo(FuncionTipoDTO theFuncionTipoDTO)
        {
            bool retorno = false;

            YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper();

            wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 20, theFuncionTipoDTO.UsuarioIngreso);
            wobjSQLHelper.SetParametro("@NombreTipoFuncion", SqlDbType.VarChar, 20, theFuncionTipoDTO.FuncionTipoNombre);


            try
            {
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("INS_TipoFuncion", "YouCom"))
                {
                case 0:
                    throw new Exception("No se pudo grabar.");

                case -1:
                    throw new Exception("Hubo un error.");

                case -2:
                    throw new Exception("Hubo un error.");
                }
                //====================================================================================
                retorno = true;
            }
            catch (Exception eobjException)
            {
                throw eobjException;
            }
            return(retorno);
        }
Beispiel #2
0
        public static List <FuncionTipoDTO> ListadoFuncionTipo()
        {
            DataTable pobjDataTable = new DataTable();

            YouCom.DTO.Seguridad.FuncionTipoDTO        theFuncionTipoDTO;
            List <YouCom.DTO.Seguridad.FuncionTipoDTO> collFuncionesTipo = new List <FuncionTipoDTO>();

            if (YouCom.Seguridad.DAL.FuncionTipoDAL.ListadoFuncionTipo(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    theFuncionTipoDTO = new FuncionTipoDTO();
                    theFuncionTipoDTO.FuncionTipoCod      = wobjDataRow["FuncionTipoCod"] != null ? wobjDataRow["FuncionTipoCod"].ToString() : string.Empty;
                    theFuncionTipoDTO.FuncionTipoNombre   = wobjDataRow["FuncionTipoDes"] != null ? wobjDataRow["FuncionTipoDes"].ToString() : string.Empty;
                    theFuncionTipoDTO.UsuarioIngreso      = wobjDataRow["usuarioingreso"] != null ? wobjDataRow["usuarioingreso"].ToString() : string.Empty;
                    theFuncionTipoDTO.FechaIngreso        = wobjDataRow["fechaingreso"] != null ? wobjDataRow["fechaingreso"].ToString() : string.Empty;
                    theFuncionTipoDTO.UsuarioModificacion = wobjDataRow["usuariomodificacion"] != null ? wobjDataRow["usuariomodificacion"].ToString() : string.Empty;
                    theFuncionTipoDTO.FechaModificacion   = wobjDataRow["fechamodificacion"] != null ? wobjDataRow["fechamodificacion"].ToString() : string.Empty;

                    YouCom.DTO.Seguridad.CondominioDTO myCondominio = new YouCom.DTO.Seguridad.CondominioDTO();
                    myCondominio.IdCondominio          = decimal.Parse(wobjDataRow["empresa"].ToString());
                    theFuncionTipoDTO.TheCondominioDTO = myCondominio;

                    theFuncionTipoDTO.Estado = wobjDataRow["estado"] != null ? wobjDataRow["estado"].ToString() : string.Empty;

                    collFuncionesTipo.Add(theFuncionTipoDTO);
                }
            }
            return(collFuncionesTipo);
        }
        public static bool ValidaEliminacionFuncionTipo(FuncionTipoDTO theFuncionTipoDTO, ref DataTable pobjDatable)
        {
            bool retorno = false;

            YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper();

            wobjSQLHelper.SetParametro("@FuncionTipoCod", SqlDbType.VarChar, 20, theFuncionTipoDTO.FuncionTipoCod);

            try
            {
                //====================================================================================
                if (wobjSQLHelper.Ejecutar("validaEliminacionFuncionTipo", "YouCom", pobjDatable) <= 0)
                {
                    retorno = true;
                }
                else
                {
                    retorno = false;
                }
                //====================================================================================
            }
            catch (Exception eobjException)
            {
                throw eobjException;
            }
            return(retorno);
        }
Beispiel #4
0
        public static bool ValidaEliminacionFuncionTipo(FuncionTipoDTO theFuncionTipoDTO)
        {
            DataTable pobjDataTable = new DataTable();
            bool      retorno       = false;

            if (YouCom.Seguridad.DAL.FuncionTipoDAL.ValidaEliminacionFuncionTipo(theFuncionTipoDTO, ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    retorno = true;
                }
            }
            return(retorno);
        }
Beispiel #5
0
        public static bool ValidaEliminacionFuncionTipo(FuncionTipoDTO theFuncionTipoDTO)
        {
            bool respuesta = facade.Seguridad.FuncionTipo.ValidaEliminacionFuncionTipo(theFuncionTipoDTO);

            return(respuesta);
        }
Beispiel #6
0
        public static bool ActivaFuncionTipo(FuncionTipoDTO theFuncionTipoDTO)
        {
            bool respuesta = YouCom.Seguridad.DAL.FuncionTipoDAL.ActivaFuncionTipo(theFuncionTipoDTO);

            return(respuesta);
        }
Beispiel #7
0
        public static bool ActivaFuncionTipo(FuncionTipoDTO theFuncionTipoDTO)
        {
            bool respuesta = YouCom.mantenedores.DAL.MantenedoresDAL.ActivaFuncionTipo(theFuncionTipoDTO);

            return(respuesta);
        }
Beispiel #8
0
        public static FuncionTipoDTO LoadRow(SqlDataReader myDataReader)
        {
            FuncionTipoDTO theFuncionTipoDTO = new FuncionTipoDTO();

            try
            {
                if (myDataReader != null)
                {
                    // categoria_id
                    try
                    {
                        if (!myDataReader.IsDBNull(0))
                        {
                            theFuncionTipoDTO.FuncionTipoCod = myDataReader.GetInt32(0).ToString();
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    // cate_descripcion
                    try
                    {
                        if (!myDataReader.IsDBNull(1))
                        {
                            theFuncionTipoDTO.FuncionTipoNombre = myDataReader.GetString(1);
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }

                    try
                    {
                        if (!myDataReader.IsDBNull(2))
                        {
                            theFuncionTipoDTO.UsuarioIngreso = myDataReader.GetString(2);
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    try
                    {
                        if (!myDataReader.IsDBNull(3))
                        {
                            theFuncionTipoDTO.FechaIngreso = myDataReader.GetDateTime(3).ToString();
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    try
                    {
                        if (!myDataReader.IsDBNull(4))
                        {
                            theFuncionTipoDTO.UsuarioModificacion = myDataReader.GetString(4);
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    try
                    {
                        if (!myDataReader.IsDBNull(5))
                        {
                            theFuncionTipoDTO.FechaModificacion = myDataReader.GetDateTime(5).ToString();
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    try
                    {
                        if (!myDataReader.IsDBNull(6))
                        {
                            theFuncionTipoDTO.IdCondominio = myDataReader.GetDecimal(6);
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    try
                    {
                        if (!myDataReader.IsDBNull(7))
                        {
                            theFuncionTipoDTO.Estado = myDataReader.GetInt32(7).ToString();
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                }
            }
            catch (SqlException ex)
            {
                throw new Exception(ex.Message);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            finally
            {
            }
            return(theFuncionTipoDTO);
        }