Ejemplo n.º 1
0
        public void show_group_ads(string sads)
        {
            //this.selected_ads = new Dataset(second.dirName + "\\" + best_group_ads);
            this.selected_ads = new Dataset(second.dirName + "\\" + sads);
            AHP ahp = new AHP(this.selected_ads, this.fahp);

            if (keyword_detail == false)
            {
                this.dgv_rating_keyword.Rows.Clear();
                for (int i = 0; i < 5; i++)
                {
                    dgv_rating_keyword.Rows.Add(ahp.keyword[i], ahp.fitur[i, 0], ahp.fitur[i, 1], ahp.fitur[i, 2],
                                                ahp.fitur[i, 3], ahp.fitur[i, 4], Math.Round(ahp.fitur[i, 5], 2, MidpointRounding.AwayFromZero).ToString(), Math.Round(ahp.rating_keyword[i], 2, MidpointRounding.AwayFromZero).ToString());
                    dgv_rating_keyword.Update();
                }
            }
            else
            {
                this.dgv_rating_keyword.Rows.Clear();
                for (int i = 0; i < ahp.data_iklan.keyword.GetLength(0); i++)
                {
                    dgv_rating_keyword.Rows.Add(ahp.keyword[i], ahp.fitur[i, 0], ahp.fitur[i, 1], ahp.fitur[i, 2],
                                                ahp.fitur[i, 3], ahp.fitur[i, 4], Math.Round(ahp.fitur[i, 5], 2, MidpointRounding.AwayFromZero).ToString(), Math.Round(ahp.rating_keyword[i], 2, MidpointRounding.AwayFromZero).ToString());
                    dgv_rating_keyword.Update();
                }
            }
        }
Ejemplo n.º 2
0
        private void dgv_jenis_iklan_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int rowindex = this.dgv_jenis_iklan.CurrentCell.RowIndex;
            //int columnindex = this.dgv_jenis_iklan.CurrentCell.ColumnIndex;
            int columnindex = 0;

            selected_file = dgv_jenis_iklan.Rows[rowindex].Cells[columnindex].Value.ToString();
            string filename = dirName + "\\" + dgv_jenis_iklan.Rows[rowindex].Cells[columnindex].Value.ToString();

            this.selected_ads = new Dataset(filename);
            AHP ahp = new AHP(this.selected_ads, this.fahp);

            keyword_detail = false;
            if (keyword_detail == false)
            {
                this.dgv_rating_keyword.Rows.Clear();
                for (int i = 0; i < 5; i++)
                {
                    dgv_rating_keyword.Rows.Add(ahp.keyword[i], ahp.fitur[i, 0], ahp.fitur[i, 1], ahp.fitur[i, 2],
                                                ahp.fitur[i, 3], ahp.fitur[i, 4], ahp.fitur[i, 5], ahp.rating_keyword[i]);
                    dgv_rating_keyword.Update();
                }
            }
            else
            {
                this.dgv_rating_keyword.Rows.Clear();
                for (int i = 0; i < ahp.data_iklan.keyword.GetLength(0); i++)
                {
                    dgv_rating_keyword.Rows.Add(ahp.keyword[i], ahp.fitur[i, 0], ahp.fitur[i, 1], ahp.fitur[i, 2],
                                                ahp.fitur[i, 3], ahp.fitur[i, 4], ahp.fitur[i, 5], ahp.rating_keyword[i]);
                    dgv_rating_keyword.Update();
                }
            }
        }
Ejemplo n.º 3
0
        private void bt_loadkeywordFile_Click(object sender, EventArgs e)
        {
            OpenFileDialog chooseTrainfile = new OpenFileDialog
            {
                InitialDirectory = @"D:\",
                Title            = "Browse Text Files",
                CheckFileExists  = true,
                CheckPathExists  = true,
                DefaultExt       = "csv",
                Filter           = "csv files (*.csv)|*.csv",
                FilterIndex      = 2,
                RestoreDirectory = true,
                ReadOnlyChecked  = true,
                ShowReadOnly     = true,
                Multiselect      = false
            };
            DialogResult all_csv_file = chooseTrainfile.ShowDialog();

            if (all_csv_file == DialogResult.OK)
            {
                this.dgv_keyword_analysis.Rows.Clear();
                this.csv_fname = chooseTrainfile.FileName;
                this.dirName   = (Path.GetDirectoryName(chooseTrainfile.FileName));
                this.csv       = new Dataset(csv_fname, true);
                AHP run_AHP = new AHP(this.csv);
                //this.fahp.run_FAHP(this.all_csv);
                for (int i = 0; i < run_AHP.data_keyword.keyword.GetLength(0); i++)
                {
                    dgv_keyword_analysis.Rows.Add(run_AHP.data_keyword.keyword[i], run_AHP.data_keyword.status_keyword[i], run_AHP.data_keyword.fitur[i, 0], "$" + run_AHP.data_keyword.fitur[i, 1], run_AHP.data_keyword.fitur[i, 2], run_AHP.rating_keyword[i]);
                    dgv_keyword_analysis.Update();
                }
            }
        }