예제 #1
0
        public static bool DeleteData(CompaniasRecord pComp, ref string sMensaje)
        {
            bool bRetorno = true;

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

                oCom.LoadByPrimaryKey(pComp.COM_CODIGO);


                oCom.MarkAsDeleted();

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


            return(bRetorno);
        }
예제 #2
0
        public static bool SaveData(CompaniasRecord pComp, ref string sMensaje, bool bAdiciona)
        {
            bool bRetorno = true;

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

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


                oCom.COM_DESCRIPCION = pComp.COM_DESCRIPCION;
                oCom.COM_DESCORTA    = pComp.COM_DESCORTA;
                oCom.COM_DESCRIPCION = pComp.COM_DESCRIPCION;
                oCom.COM_RESPONSABLE = pComp.COM_RESPONSABLE;
                oCom.COM_DIRECCION   = pComp.COM_DIRECCION;
                oCom.COM_EMAIL       = pComp.COM_EMAIL;
                oCom.COM_TELEFONO    = pComp.COM_TELEFONO;
                oCom.COM_FAX         = pComp.COM_FAX;
                oCom.COM_RNC         = pComp.COM_RNC;

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


            return(bRetorno);
        }