Exemplo n.º 1
0
        private void kAYDETToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string[] cols =
            {
                "AD",
                "SOYAD",
                "EPOSTA_ADRESI",
                "PAROLA",
                "AKTIF"
            };

            string[] vals =
            {
                txtAd.Text,
                txtSoyad.Text,
                txtPosta.Text,
                txtParola.Text,
                comboBox1.SelectedValue.ToString()
            };

            try
            {
                helper.setSqlCommandForInsertWithParameters("KULLANICILAR", cols, vals);
                this.Close();
            }
            catch (Exception x)
            {
                MessageBox.Show(x.Message, "Kullanıcı");
            }
        }
        public void saveDataGridColWidth(string TARGET_GRID, string COL, int WIDTH)
        {
            DataTable dt = helper.getDataTable("SELECT*FROM SETTING_COL_WIDTH WHERE COL='" + COL + "' AND TARGET_GRID='" + TARGET_GRID + "'");

            string[] cols = { "TARGET_GRID", "COL", "WIDTH" };
            string[] vals = { TARGET_GRID, COL, WIDTH.ToString() };

            if (dt.Rows.Count == 0)
            {
                helper.setSqlCommandForInsertWithParameters("SETTING_COL_WIDTH", cols, vals);
            }
            else
            {
                helper.setSqlCommandForUpdateWithParameters("SETTING_COL_WIDTH", cols, vals, "ID", dt.Rows[0][0].ToString());
            }
        }
Exemplo n.º 3
0
        public void newRecord()
        {
            string[] customerCol =
                {
                    "UNVANI",
                    "ADRES",
                    "TELEFON",
                    "CEP_TELEFON"
                };

            string[] customerVal =
            {
                    txtAdSoyad.Text,
                    txtAdres.Text,
                    txtTelefon.Text,
                    txtCepTelefon.Text
                };

            if (txtCariID.Text == "0")
            {
                helper.setSqlCommandForInsertWithParameters("CARI_KARTLAR_V2", customerCol, customerVal);

                int lastCustomerID = int.Parse(helper.getTableColumnData("SELECT TOP 1 ID FROM CARI_KARTLAR_V2 ORDER BY ID DESC", "ID"));

                txtCariID.Text = lastCustomerID.ToString();
            }
            else
            {
                helper.setSqlCommandForUpdateWithParameters("CARI_KARTLAR_V2", customerCol, customerVal, "ID", txtCariID.Text);

            }

            DateTime dtTime = Convert.ToDateTime(txtTarih.Text);
            string dateFormat = dtTime.Year + "-" + dtTime.Month + "-" + dtTime.Day;

            string[] COLS =
            {
                "MUSTERI_ID",
                "CIHAZ_MARKASI",
                "SERVIS_ACIKLAMASI",
                "CIHAZ_IMEI",
                "TESLIM_ALINAN_PARCALAR",
                "TUTAR",
                "ODENEN",
                "KALAN",
                "FIS_NUMARASI",
                "FIS_TARIHI",
                "KAYIT_TARIHI",
                "DUZENLENME_TARIHI",
                "TESLIM_ALAN",
                "TESLIM_EDEN",
                "DURUMU",
                "DEGISTIRILEN_PARCALAR"
            };

            string[] VALS =
            {
                txtCariID.Text,
                txtCihazMarkasi.Text,
                txtServisAciklamasi.Text,
                txtCihazImei.Text,
                txtTeslimAlinanParcalar.Text,
                txtTutar.Text,
                txtOdenen.Text,
                txtKalan.Text,
                txtFisNumarasi.Text,
                dateFormat,
                DateTime.Now.ToString(),
                DateTime.Now.ToString(),
                txtTeslimAlan.Text,
                txtTeslimEden.Text,
                txtDurum.Text,
                txtDegistirilenParcalar.Text
            };

            helper.setSqlCommandForInsertWithParameters("SERVIS_FISLERI", COLS, VALS);

            int lastID = int.Parse(helper.getTableColumnData("SELECT TOP 1 SERVIS_ID FROM SERVIS_FISLERI ORDER BY SERVIS_ID DESC", "SERVIS_ID"));

            ITEM_ID = lastID;

            //this.Close();
        }