Пример #1
0
        public void returnToInputForm(SuccessfulDomainAdded SFDA, string S)
        {
            InputsForm mf = new InputsForm(this);

            mf.setLabel(S);
            SFDA.Hide();
            mf.Show();
        }
Пример #2
0
        public void returnToInputsForm(SuccessSearch SS, string s)
        {
            InputsForm fi = new InputsForm(this);

            fi.setLabel(s);
            SS.Hide();
            fi.Show();
        }
Пример #3
0
        public void returnToInputs(MySearchList MSL, string S)
        {
            InputsForm fm = new InputsForm(this);

            fm.setLabel(S);
            MSL.Hide();
            fm.Show();
        }
Пример #4
0
        public void returnToInputForm(DeleteExistDomain DED, string s)
        {
            InputsForm np = new InputsForm(this);

            np.setLabel(s);
            DED.Hide();
            np.Show();
        }
Пример #5
0
        public void updateUD(UpdateDomain UD, string s)
        {
            InputsForm ff = new InputsForm(this);

            ff.setLabel(s);
            UD.Hide();
            ff.Show();
        }
Пример #6
0
        public void returnToInputsForm(Domains D, String S)
        {
            InputsForm fi = new InputsForm(this);

            D.Hide();
            fi.setLabel(S);
            fi.Show();
        }
Пример #7
0
        public void DeleteDomain(long domainId, string s, DeleteExistDomain DED)
        {
            string dbprovider = m.getDBprovider();

            OleDbConnection conn = new OleDbConnection(dbprovider);

            if (ifCanDelete(domainId))
            {
                MessageBox.Show("can't delete domain have partners");
                InputsForm fef = new InputsForm(this);
                fef.setLabel(s);
                DED.Hide();
                fef.Show();
            }
            else
            {
                try
                {
                    string query = "select * from [domain] where [domain_id]=" + domainId;
                    conn.Open();
                    OleDbCommand cmd = new OleDbCommand(query, conn);
                    System.Data.OleDb.OleDbDataAdapter tableAdapter = new System.Data.OleDb.OleDbDataAdapter(cmd);
                    DataTable dt = new DataTable();
                    tableAdapter.Fill(dt);
                    conn.Close();
                    string query_2 = "delete from [domain] where [domain_id]=" + domainId;
                    conn.Open();
                    OleDbCommand cmd_2        = new OleDbCommand(query_2, conn);
                    DialogResult dialogResult = MessageBox.Show("if you Sure you want to delete this domain prees yes else press no", "Some Title", MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.Yes)
                    {
                        cmd_2.ExecuteNonQuery();
                        MessageBox.Show("successful deleting:)");
                        InputsForm fef = new InputsForm(this);
                        fef.setLabel(s);
                        DED.Hide();
                        fef.Show();
                    }
                    else
                    {
                        DED.Show();
                    }
                    conn.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("can't delete Or user didn't exist");
                }
            }
        }