Ejemplo n.º 1
0
        /// <summary>
        /// Retrieve a data table containing the application specified.
        /// </summary>
        /// <param name="appcode">string: Application code.</param>
        /// <returns>iCampaign.TACS.Data.ApplicationsDs.ApplicationsDataTable</returns>
        internal iCampaign.TACS.Data.ApplicationsDs.ApplicationsDataTable GetApplication(string appcode)
        {
            //  Instantiate the database objects
            ApplicationsDs.ApplicationsDataTable dataTable = new ApplicationsDs.ApplicationsDataTable();
            iCampaign.TACS.Data.ApplicationsDsTableAdapters.ApplicationsTableAdapter tableAdapter =
                new iCampaign.TACS.Data.ApplicationsDsTableAdapters.ApplicationsTableAdapter();
            tableAdapter.Connection = new SqlConnection(TacsSession.ConnectionString);

            //  Try and get the data from the TACS.NET database
            try
            {
                tableAdapter.Connection.Open();
                tableAdapter.FillByAppCode(dataTable, appcode);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                tableAdapter.Connection.Close();
            }

            return dataTable;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialize instance of application tabbed document.
        /// </summary>
        /// <param name="parent">MainForm: object.</param>
        public Application(MainForm parent)
        {
            //  Initialize properties
            _ParentForm = parent;
            dataTable = new iCampaign.TACS.Data.ApplicationsDs.ApplicationsDataTable();
            tableAdapter = new iCampaign.TACS.Data.ApplicationsDsTableAdapters.ApplicationsTableAdapter();
            tableAdapter.Connection = new System.Data.SqlClient.SqlConnection(TacsSession.ConnectionString);

            //  Initialize the tabbed document
            InitializeComponent();
            InitializeDocument();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initialize instance of application tabbed document.
        /// </summary>
        /// <param name="parent">MainForm: object.</param>
        /// <param name="appcode">string: Application code.</param>
        public Application(MainForm parent, string appcode)
        {
            //  Check the arguments
            if (appcode.Length == 0)
                throw new System.ArgumentException("You must provide an application code value.");
            else
                applicationCode = appcode;

            //  Initialize properties
            _ParentForm = parent;
            dataTable = new iCampaign.TACS.Data.ApplicationsDs.ApplicationsDataTable();
            tableAdapter = new iCampaign.TACS.Data.ApplicationsDsTableAdapters.ApplicationsTableAdapter();
            tableAdapter.Connection = new System.Data.SqlClient.SqlConnection(TacsSession.ConnectionString);

            //  Initialize the tabbed document
            InitializeComponent();
            InitializeDocument();
            GetRecord();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initialize instance of the project tabbed document.
        /// </summary>
        /// <param name="parent">MainForm: object.</param>
        /// <param name="aid">long: Account id.</param>
        public Project(MainForm parent, long aid)
        {
            //  Initialize properties
            acctId = aid;
            _ParentForm = parent;
            dataTable = new iCampaign.TACS.Data.ProjectsDs.ProjectsDataTable();
            tableAdapter = new iCampaign.TACS.Data.ProjectsDsTableAdapters.ProjectsTableAdapter();
            tableAdapter.Connection = new System.Data.SqlClient.SqlConnection(TacsSession.ConnectionString);
            appTable = new iCampaign.TACS.Data.ApplicationsDs.ApplicationsDataTable();
            appTableAdapter = new iCampaign.TACS.Data.ApplicationsDsTableAdapters.ApplicationsTableAdapter();
            appTableAdapter.Connection = new System.Data.SqlClient.SqlConnection(TacsSession.ConnectionString);
            roleTable = new iCampaign.TACS.Data.RolesDs.RolesDataTable();
            roleAdapter = new iCampaign.TACS.Data.RolesDsTableAdapters.RolesTableAdapter();
            roleAdapter.Connection = new System.Data.SqlClient.SqlConnection(TacsSession.ConnectionString);

            //  Initialize tabbed document controls
            InitializeComponent();
            InitializeDocument();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initialize instance of the project tabbed document.
        /// </summary>
        /// <param name="parent">MainForm: object.</param>
        /// <param name="proj">string: Project name.</param>
        public Project(MainForm parent, long aid, string proj)
        {
            //  Check the arguments
            if (proj.Length == 0)
            {
                throw new System.ArgumentException("You must provide an project name value.");
            }
            else
            {
                project = proj;
                acctId = aid;
            }

            //  Initialize properties
            _ParentForm = parent;
            dataTable = new iCampaign.TACS.Data.ProjectsDs.ProjectsDataTable();
            tableAdapter = new iCampaign.TACS.Data.ProjectsDsTableAdapters.ProjectsTableAdapter();
            tableAdapter.Connection = new System.Data.SqlClient.SqlConnection(TacsSession.ConnectionString);
            appTable = new iCampaign.TACS.Data.ApplicationsDs.ApplicationsDataTable();
            appTableAdapter = new iCampaign.TACS.Data.ApplicationsDsTableAdapters.ApplicationsTableAdapter();
            appTableAdapter.Connection = new System.Data.SqlClient.SqlConnection(TacsSession.ConnectionString);
            roleTable = new iCampaign.TACS.Data.RolesDs.RolesDataTable();
            roleAdapter = new iCampaign.TACS.Data.RolesDsTableAdapters.RolesTableAdapter();
            roleAdapter.Connection = new System.Data.SqlClient.SqlConnection(TacsSession.ConnectionString);

            //  Initialize tabbed document controls
            InitializeComponent();
            InitializeDocument();
            GetRecord();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Get the request application row from the database.
        /// </summary>
        /// <param name="appcode">string: Application code.</param>
        /// <returns>iCampaign.TACS.Data.ApplicationsDs.ApplicationsRow: object.</returns>
        private Data.ApplicationsDs.ApplicationsRow GetApplicationRow(string appcode)
        {
            //  Initialize ADO.NET objects
            Data.ApplicationsDs.ApplicationsDataTable appTable = new ApplicationsDs.ApplicationsDataTable();
            Data.ApplicationsDsTableAdapters.ApplicationsTableAdapter tableAdapter =
                new iCampaign.TACS.Data.ApplicationsDsTableAdapters.ApplicationsTableAdapter();
            Data.ApplicationsDs.ApplicationsRow appRow = null;
            tableAdapter.Connection = new SqlConnection(TacsSession.ConnectionString);

            //  Fetch the application information
            try
            {
                tableAdapter.Connection.Open();
                tableAdapter.FillByAppCode(appTable, appcode);
                if (appTable.Count != 0)
                    appRow = appTable[0];
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                tableAdapter.Connection.Close();
            }
            return appRow;
        }