示例#1
0
        public void btnAyarlar_Click(object sender, EventArgs e)
        {
            if (Application.OpenForms["Ayarlar"] == null)
            {
                ayarlar.Show();
            }
            //else
            //{
            //    ayarlar.Show();
            //}
            if (!String.IsNullOrEmpty(tbxTCC.Text))
            {
                ayarlar.dgwRules.DataSource = _iManagerPanelInformationService.GetManagerPanelInformationByTC(Convert.ToInt64(tbxTCC.Text));
            }
            else
            {
                ayarlar.idGetir();
            }
            ayarlar.tbxTCCC.Text = tbxTCC.Text;
            if (Application.OpenForms["Ayarlar"] != null)
            {
                ayarlar.Show();
            }

            //if (!String.IsNullOrEmpty(ayarlar.tbxTC.Text))
            //{
            //    ayarlar.dgwRules.DataSource = _iManagerPanelInformationService.GetManagerPanelInformationByTC(Convert.ToInt64(ayarlar.tbxTC.Text));

            //}
            //else
            //{
            //    ayarlar.idGetir();
            //}
        }
示例#2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            //Sqlbaglan.NesneVer().thisConn = new SqlConnection(@"Data Source=(localdb)\mssqllocaldb;initial catalog = ManagerPanel;integrated security = true");
            //Sqlbaglan.NesneVer().thisConn.Open();
            //Sqlbaglan.NesneVer().thisQuery = new SqlCommand("INSERT INTO [Rules] (Kurallar, TC) VALUES (@Kurallar, @TC) ", Sqlbaglan.NesneVer().thisConn);
            //Sqlbaglan.NesneVer().thisQuery.Parameters.AddWithValue("Kurallar", tbxRules.Text);
            //Sqlbaglan.NesneVer().thisQuery.Parameters.AddWithValue("TC", tbxTC.Text);
            //Sqlbaglan.NesneVer().thisQuery.ExecuteNonQuery();
            //Sqlbaglan.NesneVer().thisConn.Close();
            try
            {
                _iManagerPanelInformationService.Add(new ManagerPanelInformation
                {
                    TC       = Convert.ToInt64(tbxTC.Text),
                    Kurallar = tbxRules.Text
                });
                MessageBox.Show("Kişi bilgisi eklendi!");
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }

            if (!String.IsNullOrEmpty(tbxTCCC.Text))
            {
                dgwRules.DataSource = _iManagerPanelInformationService.GetManagerPanelInformationByTC(Convert.ToInt64(tbxTCCC.Text));
            }

            //this.Controls.Clear();
            //this.InitializeComponent();

            //dgwRules.DataSource = _iManagerPanelInformationService.GetManagerPanelInformationByTC(Convert.ToInt64(tbxTCCC.Text));
            //αbetik αbetik = new αbetik();
            //btnClose_Click(new object(), EventArgs.Empty);
            //this.Hide();
            //this.Controls.Clear();
            //this.InitializeComponent();
            //αbetik.btnAyarlar_Click(new object(), EventArgs.Empty);
            //tbxTCCC.Text = αbetik.tbxTCC.Text;
            //this.Show();

            //idGetir();
        }