Esempio n. 1
0
        public override void SetData(object i_Data)
        {
            //base.SetData (i_Data);
            DBSourceConfig m_config = i_Data as DBSourceConfig;

            //set members
            this._ConnType   = m_config.DBConnType;
            this._WebbDBType = m_config.WebbDBType;
            //set data base type
            this.C_SQLType.Checked  = this._ConnType == DBConnTypes.SQLDB;
            this.C_TypeOLE.Checked  = this._ConnType == DBConnTypes.OleDB;
            this.C_XMLType.Checked  = this._ConnType == DBConnTypes.XMLFile;
            this.C_FileType.Checked = this._ConnType == DBConnTypes.File;
            //set data source type
            this.C_WebbFootball.Checked = this._WebbDBType == WebbDBTypes.WebbAdvantageFootball;



            this.C_WebbVictory.Checked = (int)this._WebbDBType >= 100 && (int)this._WebbDBType <= 105;                  //football, basketball, volleyball, hockey
            if (this.C_WebbVictory.Checked)
            {
                this.C_CBVictoryType.Enabled       = true;
                this.C_CBVictoryType.SelectedIndex = (int)this._WebbDBType - 100;
            }

            this.C_WebbCoachCRM.Checked = this._WebbDBType == WebbDBTypes.CoachCRM;

            this.C_WebbPlayBook.Checked = this._WebbDBType == WebbDBTypes.WebbPlaybook;

            this.C_CommonDataSource.Checked = this._WebbDBType == WebbDBTypes.Others;
        }
Esempio n. 2
0
        public override void SetData(object i_Data)
        {
            //base.SetData (i_Data);
            DBSourceConfig config = i_Data as DBSourceConfig;

            this._ConnType   = config.DBConnType;
            this._WebbDBType = config.WebbDBType;

            //Scott@2007-11-30 12:48 modified some of the following code.
            //this.C_SelectedFile.Clear();
            if (this._ConnType == Webb.Data.DBConnTypes.OleDB)
            {
                this.WizardTitle                       = "Step 2: Select an Access file.";
                this.C_AccessGroup.Text                = "Select Access data source  file";
                this.C_TitleMsg.Text                   = "Please select a Database to open.";
                this.C_OpenFileDialog.DefaultExt       = "mdb";
                this.C_OpenFileDialog.DereferenceLinks = false;
                this.C_OpenFileDialog.FileName         = ".mdb";
                this.C_OpenFileDialog.Filter           = "Access database file(*.mdb)|*.mdb";
                this.C_OpenFileDialog.RestoreDirectory = true;
                this.C_OpenFileDialog.Title            = "Choose Database file to open";
            }
            else if (this._ConnType == Webb.Data.DBConnTypes.XMLFile)
            {
                this.WizardTitle                       = "Step 2: Select an XML file.";
                this.C_AccessGroup.Text                = "Select Xml data source  file";
                this.C_TitleMsg.Text                   = "Please select a XML file to open.";
                this.C_OpenFileDialog.DefaultExt       = "xml";
                this.C_OpenFileDialog.DereferenceLinks = false;
                this.C_OpenFileDialog.FileName         = ".xml";
                this.C_OpenFileDialog.Filter           = "XML file(*.xml)|*.xml";
                this.C_OpenFileDialog.RestoreDirectory = true;
                this.C_OpenFileDialog.Title            = "Choose Xml file to open";
            }
            else /*never*/ } {
Esempio n. 3
0
        public static bool CheckedUserRight(UserLevel level, WebbDBTypes webbDBtype)
        {
            if ((int)level.Rights == 31)
            {
                return(true);
            }

            if (level.Rights == ProductRight.None)
            {
                return(false);
            }

            string[] rights = level.Rights.ToString().ToLower().Split(',');

            string dbtype = webbDBtype.ToString().ToLower().Trim();

            foreach (string right in rights)
            {
                if (dbtype.IndexOf(right.Trim()) >= 0)
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 4
0
        public static string[] ReadDataConfig(WebbDBTypes webbType, string sourceFile)
        {
            if (!File.Exists(sourceFile))
            {
                return(null);
            }

            DataSet ds = new DataSet();

            try
            {
                ds.ReadXml(sourceFile);

                DataTable dt = ds.Tables[0];

                DataRow[] dataRows = dt.Select("Product='Product:" + webbType.ToString() + "'");

                if (dataRows.Length == 0)
                {
                    return(null);
                }

                DataRow dr = dataRows[0];

                if (dr == null || dt.Columns.Count != 10)
                {
                    return(null);
                }

                string [] strConfigs = new string[dt.Columns.Count];

                strConfigs[0] = "Path:" + string.Empty;

                for (int i = 1; i < dt.Columns.Count; i++)
                {
                    strConfigs[i] = dr[i].ToString();
                }

                ds.Dispose();

                return(strConfigs);
            }
            catch (Exception ex)
            {
                ds.Dispose();

                MessageBox.Show(ex.Message);

                return(null);
            }
        }
Esempio n. 5
0
        public CustomSectionFiltersForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            this.Load += new EventHandler(CustomSectionFiltersForm_Load);

            this._SaveFileDialog = new NameForm();

            _WebbDBTypes = WebbDBTypes.WebbAdvantageFootball;

            //this._PropertyForm = new PropertyForm();
        }
        public EditSecFilterForm(WebbDBTypes webbDBTypes)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this._WebbDBTypes = webbDBTypes;

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            //Create table style
            DataGridTableStyle style = new DataGridTableStyle();

            style.MappingName = strTableName;

            this.C_DataGrid.TableStyles.Add(style);
            //
            this.Value = new SectionFilter();


            this.CreateConditionTable();

            this.C_CheckPlayAfter.Checked = false;

            this.txtFilterName.Text = string.Empty;   //2009-5-19 10:15:19@Simon Add this Code

            //
            selector = new Webb.Reports.DataProvider.UI.AdvReportFilterSelector();

            selector.Visible = false;

            selector.Dock = DockStyle.Fill;

            this.Controls.Add(selector);

            selector.BringToFront();

            selector.VisibleChanged += new EventHandler(selector_VisibleChanged);

            _NoEdit = false;
        }
Esempio n. 7
0
        public CustomSectionFiltersForm(SectionFilterCollection sections, WebbDBTypes webbDBTypes)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            _InitSectionFilters = sections;

            _WebbDBTypes = webbDBTypes;

            this.Load += new EventHandler(CustomSectionFiltersForm_Load);

            this._SaveFileDialog = new NameForm();

            //this._PropertyForm = new PropertyForm();
        }
Esempio n. 8
0
        private void C_DBTypeCheckedChanged(object sender, System.EventArgs e)
        {
            if (this.C_WebbVictory.Checked)
            {
                this.C_CBVictoryType.Enabled = true;

                this._WebbDBType = (WebbDBTypes)(this.C_CBVictoryType.SelectedIndex + 100);

                this.C_TypeOLE.Checked = true;
            }
            else
            {
                this.C_CBVictoryType.Enabled = false;

                if (this.C_CommonDataSource.Checked)
                {
                    this._WebbDBType = WebbDBTypes.Others;
                }
                else if (this.C_WebbFootball.Checked)
                {
                    this._WebbDBType = WebbDBTypes.WebbAdvantageFootball;

                    this.C_FileType.Checked = true;
                }
                else if (this.C_WebbCoachCRM.Checked)
                {
                    this._WebbDBType = WebbDBTypes.CoachCRM;

                    this.C_SQLType.Checked = true;
                }
                else if (this.C_WebbPlayBook.Checked)
                {
                    this._WebbDBType = WebbDBTypes.WebbPlaybook;

                    this.C_FileType.Checked = true;
                }
            }
        }
Esempio n. 9
0
 public void ApplyConfig(DBSourceConfig oldDBSourceConfig)
 {
     this._DefaultSQLCmd = oldDBSourceConfig._DefaultSQLCmd;
     this._ConnString    = oldDBSourceConfig._ConnString;
     this._DBSourceName  = oldDBSourceConfig._DBSourceName;
     this._DBCatalogName = oldDBSourceConfig._DBCatalogName;
     this._FilePath      = oldDBSourceConfig._FilePath;
     this._DBConnType    = oldDBSourceConfig._DBConnType;
     this._WebbDBType    = oldDBSourceConfig._WebbDBType;
     this.DBConnType     = oldDBSourceConfig.DBConnType;
     this.WebbDBType     = oldDBSourceConfig.WebbDBType;
     oldDBSourceConfig.GameIDs.CopyTo(this._GameIDs);
     oldDBSourceConfig.FilterIDs.CopyTo(this._FilterIDs);
     oldDBSourceConfig.SectionFilterIDs.CopyTo(this._SectionFilterIDs);
     this._Games               = oldDBSourceConfig.Games;
     this._Edls                = oldDBSourceConfig.Edls;
     this._UserFolder          = oldDBSourceConfig.UserFolder;
     this._HeaderName          = oldDBSourceConfig.HeaderName;
     this._WartermarkImagePath = oldDBSourceConfig.WartermarkImagePath;
     this._Templates           = oldDBSourceConfig._Templates;
     this._PrinterName         = oldDBSourceConfig._PrinterName;
     this._Filters             = oldDBSourceConfig.Filters;
 }
Esempio n. 10
0
        public static void WriteDataConfig(WebbDBTypes webbType, string TargetPath)
        {
            Webb.Reports.DataProvider.WebbDataProvider PublicDataProvider = Webb.Reports.DataProvider.VideoPlayBackManager.PublicDBProvider;

            string[] configs = PublicDataProvider.DBSourceConfig.CreateConfigStrings(string.Empty);

            DataSet ds = new DataSet("ConfigDataSet");

            DataTable configTable;

            DataRow productRow;

            bool isNewRow = true;

            #region Get the row which contains the product

            if (File.Exists(TargetPath))
            {
                try
                {
                    ds.ReadXml(TargetPath);

                    configTable = ds.Tables[0];

                    DataRow[] dataRows = configTable.Select("Product='Product:" + webbType.ToString() + "'");

                    if (dataRows.Length == 0)
                    {
                        productRow = configTable.NewRow();

                        isNewRow = true;
                    }
                    else
                    {
                        productRow = dataRows[0];

                        isNewRow = false;
                    }
                }
                catch
                {
                    ds = new DataSet();

                    configTable = AddColumn(null);

                    ds.Tables.Add(configTable);

                    productRow = configTable.NewRow();

                    isNewRow = true;
                }
            }
            else
            {
                configTable = AddColumn(null);

                ds.Tables.Add(configTable);

                productRow = configTable.NewRow();

                isNewRow = true;
            }

            #endregion

            try
            {
                for (int i = 0; i < configTable.Columns.Count; i++)
                {
                    productRow[i] = configs[i];
                }

                if (isNewRow)
                {
                    configTable.Rows.Add(productRow);
                }

                ds.AcceptChanges();

                ds.WriteXml(TargetPath);

                ds.Dispose();
            }
            catch (Exception ex)
            {
                ds.Dispose();

                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 11
0
 private void C_CBVictoryType_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     this._WebbDBType = (WebbDBTypes)(this.C_CBVictoryType.SelectedIndex + 100);
 }