예제 #1
0
        private void araButton_Click(object sender, EventArgs e)
        {
            var query1 = from CUSTOMER c  in database.CUSTOMERs
                         where c.tcNo == Convert.ToInt64(tcNoTextBox.Text)
                         select c;

            foreach (CUSTOMER c in query1)
            {
                cust = c;
            }

            var query2 = from SERVICE s in database.SERVICEs
                         where s.custId == cust.id
                         select s;

            foreach (SERVICE s in query2)
            {
                serv = s;
            }

            if (query1 == null)
            {
                MessageBox.Show("Böyle bir müşteri bulunmamaktadır!");
            }
            else
            {
                groupBox5.Visible = true;
            }

            tcNoTextBox.Clear();
        }
예제 #2
0
        private void kaydetButton_Click(object sender, EventArgs e)
        {
            DataClasses1DataContext database = new DataClasses1DataContext();
            CUSTOMER cust = new CUSTOMER();
            SERVICE  serv = new SERVICE();

            int query = database.CUSTOMERs.Count();

            cust.id      = query + 1;
            cust.tcNo    = Convert.ToInt64(tcTextBox.Text);
            cust.name    = adTextBox.Text;
            cust.bDate   = dTarihiDateTimePicker.Value;
            cust.job     = meslekTextBox.Text;
            cust.phone   = Convert.ToInt64(telTextBox.Text);
            cust.sex     = sex;
            cust.regDate = kTarihiDateTimePicker.Value;

            int query1 = database.SERVICEs.Count();

            serv.num      = query1 + 1;
            serv.custId   = query + 1;
            serv.servName = sName;
            serv.empName  = comboBox1.GetItemText(comboBox1.SelectedItem);
            serv.price    = ucret;

            database.CUSTOMERs.InsertOnSubmit(cust);
            database.SERVICEs.InsertOnSubmit(serv);
            database.SubmitChanges();

            groupBox1.Visible = false;

            MessageBox.Show("Kayıt tamamlandı!");

            tcTextBox.Clear();
            adTextBox.Clear();
            meslekTextBox.Clear();
            telTextBox.Clear();
            textBox1.Clear();
            panel3.Visible       = false;
            radioButton1.Checked = false;
            radioButton2.Checked = false;
            checkBox1.Checked    = false;
            checkBox2.Checked    = false;
            checkBox3.Checked    = false;
            checkBox4.Checked    = false;
            numericUpDown1.Value = 0;
            aciklamaTextBox.Clear();
        }
예제 #3
0
        private void saveToolStripButton_Click(object sender, EventArgs e)
        {
            if (treeView1.SelectedNode.Index == 0)
            {
                if (isimSoyisimTextBox.Text != "")
                {
                    cust.name = isimSoyisimTextBox.Text;
                }
                if (meslekTextBox.Text != "")
                {
                    cust.job = meslekTextBox.Text;
                }
                if (cepTelTextBox.Text != "")
                {
                    cust.phone = Convert.ToInt64(cepTelTextBox.Text);
                }
            }
            else
            {
                int     query      = database.SERVICEs.Count();
                SERVICE newService = new SERVICE();

                newService.num      = query + 1;
                newService.custId   = cust.id;
                newService.servName = servName;
                newService.empName  = employeeName;
                database.SERVICEs.InsertOnSubmit(newService);
            }
            database.SubmitChanges();
            MessageBox.Show("Kayıt tamamlandı!");
            groupBox5.Visible = false;
            groupBox1.Visible = false;
            groupBox2.Visible = false;
            tcNoTextBox.Clear();
            isimSoyisimTextBox.Clear();
            meslekTextBox.Clear();
            cepTelTextBox.Clear();
            checkedListBox1.ClearSelected();
        }
 partial void DeleteSERVICE(SERVICE instance);
 partial void UpdateSERVICE(SERVICE instance);
 partial void InsertSERVICE(SERVICE instance);