コード例 #1
0
ファイル: DealerList.cs プロジェクト: wee2tee/SN_Net
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     if (keyData == Keys.Escape)
     {
         this.btnCancel.PerformClick();
         return true;
     }
     if (keyData == Keys.Enter)
     {
         this.btnOK.PerformClick();
         return true;
     }
     if (keyData == Keys.Tab)
     {
         Dealer current_item = (Dealer)this.dgvDealer.Rows[this.dgvDealer.CurrentCell.RowIndex].Tag;
         if (this.sort_mode == SORT_MODE.DEALER)
         {
             this.sort_mode = SORT_MODE.COMPNAM;
             this.dgvDealer.Columns[1].HeaderCell.Style.BackColor = ColorResource.COLUMN_HEADER_NOT_SORTABLE_GREEN;
             this.dgvDealer.Columns[2].HeaderCell.Style.BackColor = Color.OliveDrab;
         }
         else
         {
             this.sort_mode = SORT_MODE.DEALER;
             this.dgvDealer.Columns[1].HeaderCell.Style.BackColor = Color.OliveDrab;
             this.dgvDealer.Columns[2].HeaderCell.Style.BackColor = ColorResource.COLUMN_HEADER_NOT_SORTABLE_GREEN;
         }
         this.FillInDatagrid();
         this.SetSelectedItem(current_item);
         return true;
     }
     return base.ProcessCmdKey(ref msg, keyData);
 }
コード例 #2
0
ファイル: DealerList.cs プロジェクト: wee2tee/SN_Net_V1.1
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     if (keyData == Keys.Escape)
     {
         this.btnCancel.PerformClick();
         return(true);
     }
     if (keyData == Keys.Enter)
     {
         this.btnOK.PerformClick();
         return(true);
     }
     if (keyData == Keys.Tab)
     {
         Dealer current_item = (Dealer)this.dgvDealer.Rows[this.dgvDealer.CurrentCell.RowIndex].Tag;
         if (this.sort_mode == SORT_MODE.DEALER)
         {
             this.sort_mode = SORT_MODE.COMPNAM;
             this.dgvDealer.Columns[1].HeaderCell.Style.BackColor = ColorResource.COLUMN_HEADER_NOT_SORTABLE_GREEN;
             this.dgvDealer.Columns[2].HeaderCell.Style.BackColor = Color.OliveDrab;
         }
         else
         {
             this.sort_mode = SORT_MODE.DEALER;
             this.dgvDealer.Columns[1].HeaderCell.Style.BackColor = Color.OliveDrab;
             this.dgvDealer.Columns[2].HeaderCell.Style.BackColor = ColorResource.COLUMN_HEADER_NOT_SORTABLE_GREEN;
         }
         this.FillInDatagrid();
         this.SetSelectedItem(current_item);
         return(true);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
コード例 #3
0
ファイル: DealerWindow.cs プロジェクト: wee2tee/SN_Net
 public DealerWindow(MainForm main_form)
 {
     Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("th-TH");
     InitializeComponent();
     this.main_form = main_form;
     this.G = main_form.G;
     this.sort_mode = SORT_MODE.DEALER;
 }
コード例 #4
0
 public void NextMode()
 {
     mode++;
     if ((int)mode > 2)
     {
         mode = SORT_MODE.STATISTIC;
     }
     HallOfFame.Instance().Sort();
 }
コード例 #5
0
 public HallOfFameSorter(GameScenes scene, DIRECTION direction = DIRECTION.ASCENDING, SORT_MODE mode = SORT_MODE.STATISTIC,
                         STATS_SORTING stats_sort = STATS_SORTING.NAME, SKILL_SORTING skill_sort     = SKILL_SORTING.SPECIALIST)
     :  base(scene)
 {
     this.direction     = direction;
     this.mode          = mode;
     this.stats_sorting = stats_sort;
     this.skill_sorting = skill_sort;
 }
コード例 #6
0
ファイル: DealerList.cs プロジェクト: wee2tee/SN_Net
 public DealerList(SnWindow parent_window, string dealer_code)
     : this()
 {
     this.parent_window = parent_window;
     this.selected_dealer_code = dealer_code;
     this.sort_mode = SORT_MODE.DEALER;
     this.FillInDatagrid();
     this.SetSelectedItem();
 }
コード例 #7
0
ファイル: DealerList.cs プロジェクト: wee2tee/SN_Net_V1.1
 public DealerList(SnWindow parent_window, string dealer_code)
     : this()
 {
     this.parent_window        = parent_window;
     this.selected_dealer_code = dealer_code;
     this.sort_mode            = SORT_MODE.DEALER;
     this.FillInDatagrid();
     this.SetSelectedItem();
 }
コード例 #8
0
ファイル: DealerList.cs プロジェクト: wee2tee/SN_Net_V1.1
        private void dgvDealer_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            foreach (DataGridViewColumn col in ((DataGridView)sender).Columns)
            {
                col.HeaderCell.Style.BackColor = ColorResource.COLUMN_HEADER_NOT_SORTABLE_GREEN;
            }
            ((DataGridView)sender).Columns[e.ColumnIndex].HeaderCell.Style.BackColor = Color.OliveDrab;

            Dealer current_item = (Dealer)this.dgvDealer.Rows[this.dgvDealer.CurrentCell.RowIndex].Tag;

            if (e.ColumnIndex == 1 && this.sort_mode == SORT_MODE.COMPNAM)
            {
                this.sort_mode = SORT_MODE.DEALER;
                this.FillInDatagrid();
                this.SetSelectedItem(current_item);
            }
            else if (e.ColumnIndex == 2 && this.sort_mode == SORT_MODE.DEALER)
            {
                this.sort_mode = SORT_MODE.COMPNAM;
                this.FillInDatagrid();
                this.SetSelectedItem(current_item);
            }
        }
コード例 #9
0
 public void SetMode(SORT_MODE mode)
 {
     this.mode = mode;
     HallOfFame.Instance().Sort();
 }
コード例 #10
0
ファイル: DealerList.cs プロジェクト: wee2tee/SN_Net
        private void dgvDealer_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            foreach (DataGridViewColumn col in ((DataGridView)sender).Columns)
            {
                col.HeaderCell.Style.BackColor = ColorResource.COLUMN_HEADER_NOT_SORTABLE_GREEN;
            }
            ((DataGridView)sender).Columns[e.ColumnIndex].HeaderCell.Style.BackColor = Color.OliveDrab;

            Dealer current_item = (Dealer)this.dgvDealer.Rows[this.dgvDealer.CurrentCell.RowIndex].Tag;

            if (e.ColumnIndex == 1 && this.sort_mode == SORT_MODE.COMPNAM)
            {
                this.sort_mode = SORT_MODE.DEALER;
                this.FillInDatagrid();
                this.SetSelectedItem(current_item);
            }
            else if (e.ColumnIndex == 2 && this.sort_mode == SORT_MODE.DEALER)
            {
                this.sort_mode = SORT_MODE.COMPNAM;
                this.FillInDatagrid();
                this.SetSelectedItem(current_item);
            }
        }
コード例 #11
0
ファイル: DealerWindow.cs プロジェクト: wee2tee/SN_Net
        private void toolStripSearchName_Click(object sender, EventArgs e)
        {
            SearchDealerBox wind = new SearchDealerBox(SearchDealerBox.SEARCH_TYPE.NAME);
            wind.txtKeyWord.Text = this.find_name;
            if (wind.ShowDialog() == DialogResult.OK)
            {
                this.sort_mode = SORT_MODE.COMPNAM;
                this.GetDealerIdList();
                this.find_name = wind.txtKeyWord.Text;

                this.FormProcessing();
                int target_id = this.dealer.id; // default to current id
                bool is_founded = false; // default search result to false
                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork += delegate
                {
                    if (this.find_name.Length > 0)
                    {
                        foreach (Dealer d in this.dealer_id_list)
                        {
                            if (d.compnam != null)
                            {
                                if (string.CompareOrdinal(d.compnam, this.find_name) >= 0)
                                {
                                    target_id = d.id;
                                    is_founded = true;
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        is_founded = true;
                    }
                };
                worker.RunWorkerCompleted += delegate
                {
                    if (is_founded)
                    {
                        if (target_id != this.dealer.id)
                        {
                            this.GetDealerByID(target_id);
                            this.FillForm();
                        }
                        this.FormRead();
                    }
                    else
                    {
                        this.FormRead();
                        MessageAlert.Show(StringResource.DATA_NOT_FOUND, "", MessageAlertButtons.OK, MessageAlertIcons.NONE);
                    }
                };
                worker.RunWorkerAsync();
            }
        }