Esempio n. 1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            List<String> list = GetSelectedRows1();

            if (list.Count == 0)
            {
                MessageBox.Show("Select some rows or check to check box!");
                return;
            }

            if (new FuzzyProcess().DeleteList(list) == 1)
            {
                RefreshData();

                MessageBox.Show("Delete selected DONE!");
            }
            else
            {
                frmRunAsAdministrator frm = new frmRunAsAdministrator();
                frm.ShowDialog();
            }
        }
Esempio n. 2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (!CheckNull()) return;
            if (!CheckLogicValue()) return;
            //ContinuousFuzzySetBLL newFS = new ContinuousFuzzySetBLL();
            FuzzyProcess fz = new FuzzyProcess();
            ConFS newFS = new ConFS();
            //newFS.FuzzySetName = txtLinguistic.Text.Trim();
            newFS.Name = txtLinguistic.Text.Trim() + ".conFS";

            String content = txtBottomLeft.Text.Trim();

            string path = Directory.GetCurrentDirectory() + @"\lib\";

            if (txtTopLeft.Text.Trim() == "" && txtTopRight.Text.Trim() != "")
            {
                newFS.Bottom_Left = Convert.ToDouble(txtBottomLeft.Text);
                newFS.Top_Left = newFS.Top_Right = Convert.ToDouble(txtTopRight.Text);
                newFS.Bottom_Right = Convert.ToDouble(txtBottomRight.Text);
                content += "," + txtTopRight.Text.Trim() + "," + txtTopRight.Text.Trim() + "," + txtBottomRight.Text.Trim();
                //if (newFS.Update() == 1)
                if (fz.UpdateFS(path, content, newFS.Name) == 1)
                {
                    MessageBox.Show("Save Fuzzy Set DONE!");
                }
                else
                {
                    frmRunAsAdministrator frm = new frmRunAsAdministrator();
                    frm.ShowDialog();
                }
            }
            else if (txtTopLeft.Text.Trim() != "" && txtTopRight.Text.Trim() == "")
            {
                newFS.Bottom_Left = Convert.ToDouble(txtBottomLeft.Text);
                newFS.Top_Left = newFS.Top_Right = Convert.ToDouble(txtTopLeft.Text);
                newFS.Bottom_Right = Convert.ToDouble(txtBottomRight.Text);

                content += "," + txtTopLeft.Text.Trim() + "," + txtTopLeft.Text.Trim() + "," + txtBottomRight.Text.Trim();
                //if (newFS.Update() == 1)
                if (fz.UpdateFS(path, content, newFS.Name) == 1)
                {
                    MessageBox.Show("Save Fuzzy Set DONE!");
                }
                else
                {
                    frmRunAsAdministrator frm = new frmRunAsAdministrator();
                    frm.ShowDialog();
                }
            }
            else
            {
                newFS.Bottom_Left = Convert.ToDouble(txtBottomLeft.Text);
                newFS.Top_Left = Convert.ToDouble(txtTopLeft.Text);
                newFS.Top_Right = Convert.ToDouble(txtTopRight.Text);
                newFS.Bottom_Right = Convert.ToDouble(txtBottomRight.Text);

                content += "," + txtTopLeft.Text.Trim() + "," + txtTopRight.Text.Trim() + "," + txtBottomRight.Text.Trim();
                //if (newFS.Update() == 1)
                if (fz.UpdateFS(path, content, newFS.Name) == 1)
                {
                    MessageBox.Show("Save Fuzzy Set DONE!");
                }
                else
                {
                    frmRunAsAdministrator frm = new frmRunAsAdministrator();
                    frm.ShowDialog();
                }
            }
        }
Esempio n. 3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (!IsValuesNull() || !IsData())
            {
                return;
            }

            String path = Directory.GetCurrentDirectory() + @"\lib\";
            //DiscreteFuzzySetBLL newDisFs = GetDataRows();
            List<String> list = GetDataRows1();
            //if (newDisFs.Update() == 1)
            if (new FuzzyProcess().UpdateFS(path, list.GetRange(1,2), list[0]+".disFS") == 1)
            {
                MessageBox.Show("Save Fuzzy Set DONE!");
            }
            else
            {
                frmRunAsAdministrator frm = new frmRunAsAdministrator();
                frm.ShowDialog();
            }
        }
Esempio n. 4
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            //List<DiscreteFuzzySetBLL> list = GetSelectedRows();
            List<String> list = GetSelectedRows1();

            if (list.Count == 0)
            {
                MessageBox.Show("Select some rows or check to check box!");
                return;
            }

            //if (new DiscreteFuzzySetBLL().Delete(list) == 1)
            if (new FuzzyProcess().DeleteList(list) == 1)
            {
                //Update gridView1
                //for (int i = 0; i < gridView1.DataRowCount; i++)
                //{
                //    if (gridView1.GetRowCellValue(i, "check").ToString() == "True")
                //        gridView1.DeleteRow(i);
                //}
                RefreshData1();

                MessageBox.Show("Delete selected DONE!");
            }
            else
            {
                frmRunAsAdministrator frm = new frmRunAsAdministrator();
                frm.ShowDialog();
            }
        }