Exemple #1
0
        public static bool DeleteData(CodigosRecord pComp, ref string sMensaje)
        {
            bool bRetorno = true;

            try
            {
                CODIGOS oCom = new CODIGOS();
                oCom.ConnectionString = Parametros.CadenaConexion;

                oCom.LoadByPrimaryKey(pComp.CODIGO_ID);


                oCom.MarkAsDeleted();

                oCom.Save();
            }
            catch (Exception ex)
            {
                sMensaje = ex.Message.ToString();
                bRetorno = false;
            }


            return(bRetorno);
        }
Exemple #2
0
        public static DataView returnView(int piGrupoId, ref string sMensaje)
        {
            sMensaje = "";
            CODIGOS oCom = new CODIGOS();

            try
            {
                oCom.ConnectionString = Parametros.CadenaConexion;

                oCom.Query.AddResultColumn("CODIGO_ID");
                oCom.Query.AddResultColumn("CODIGO_COD");
                oCom.Query.AddResultColumn("CODIGO_NOMBRE");

                oCom.Where.GRUPO_COD_ID.Value    = piGrupoId;
                oCom.Where.GRUPO_COD_ID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;

                oCom.Query.Load();
            }
            catch (Exception ex)
            {
                sMensaje = ex.Message.ToString();
            }

            return(oCom.DefaultView);
        }
Exemple #3
0
        public static bool SaveData(CodigosRecord pComp, ref string sMensaje, bool bAdiciona)
        {
            bool bRetorno = true;

            try
            {
                CODIGOS oCom = new CODIGOS();
                oCom.ConnectionString = Parametros.CadenaConexion;

                if (!bAdiciona)
                {
                    oCom.LoadByPrimaryKey(pComp.CODIGO_ID);
                }
                else
                {
                    oCom.AddNew();
                    oCom.GRUPO_COD_ID = pComp.GRUPO_COD_ID;
                }

                oCom.CODIGO_COD    = pComp.CODIGO_COD;
                oCom.CODIGO_DESCR  = pComp.CODIGO_DESCR;
                oCom.CODIGO_NOMBRE = pComp.CODIGO_NOMBRE;


                oCom.Save();
            }
            catch (Exception ex)
            {
                sMensaje = ex.Message.ToString();
                bRetorno = false;
            }


            return(bRetorno);
        }
Exemple #4
0
        public static bool ReturnById(int Id, ref CODIGOS pComp, ref string sMensaje)
        {
            bool bRetorno = true;

            try
            {
                CODIGOS oCom = new CODIGOS();
                oCom.ConnectionString = Parametros.CadenaConexion;
                oCom.LoadByPrimaryKey(Id);

                pComp = oCom;
            }
            catch (Exception ex)
            {
                sMensaje = ex.Message.ToString();
                bRetorno = false;
            }

            return(bRetorno);
        }
Exemple #5
0
        public static DataView returnView(ref string sMensaje)
        {
            sMensaje = "";
            CODIGOS oCom = new CODIGOS();

            try
            {
                oCom.ConnectionString = Parametros.CadenaConexion;

                oCom.Query.AddResultColumn("CODIGO_ID");
                oCom.Query.AddResultColumn("CODIGO_COD");
                oCom.Query.AddResultColumn("CODIGO_NOMBRE");

                oCom.Query.Load();
            }
            catch (Exception ex)
            {
                sMensaje = ex.Message.ToString();
            }

            return(oCom.DefaultView);
        }