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

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

                oCom.LoadByPrimaryKey(pComp.ORI_ID);


                oCom.MarkAsDeleted();

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


            return(bRetorno);
        }
Exemple #2
0
        public static DataView returnCombo(ref string sMensaje)
        {
            sMensaje = "";
            ORIGEN oCom = new ORIGEN();

            try
            {
                oCom.ConnectionString = Parametros.CadenaConexion;

                oCom.Query.AddResultColumn("ORI_ID");
                oCom.Query.AddResultColumn("ORI_DESCRIPCION");

                oCom.Query.Load();
            }
            catch (Exception ex)
            {
                sMensaje = ex.Message.ToString();
            }
            return(oCom.DefaultView);
        }
Exemple #3
0
        public static bool ReturnById(int Id, ref ORIGEN pComp, ref string sMensaje)
        {
            bool bRetorno = true;

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

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

            return(bRetorno);
        }
Exemple #4
0
        public static bool SaveData(OrigenRecord pComp, ref string sMensaje, bool bAdiciona)
        {
            bool bRetorno = true;

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

                if (!bAdiciona)
                {
                    oCom.LoadByPrimaryKey(pComp.ORI_ID);
                }
                else
                {
                    oCom.AddNew();
                }

                oCom.ORI_ESTADO        = pComp.ORI_ESTADO;
                oCom.ORI_EQUIVALENTE   = pComp.ORI_EQUIVALENTE;
                oCom.ORI_EMS_GROUP     = pComp.ORI_EMS_GROUP;
                oCom.ORI_DESCRIPCION   = pComp.ORI_DESCRIPCION;
                oCom.ORI_COURIER_GROUP = pComp.ORI_COURIER_GROUP;
                oCom.ORI_CORREO_INT    = pComp.ORI_CORREO_INT;
                oCom.ORI_CODIGO        = pComp.ORI_CODIGO;


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


            return(bRetorno);
        }