private void btnSil_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (XtraMessageBox.Show("Kayıdı silmek istediğinizden eminmisiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { int id = Convert.ToInt32(gvBaglanti.GetFocusedRowCellValue("ID")); data.IUD_Baglanti(true, id, "", "", "", false, false, "", 1, "", null, "", "", 1, "", 1, false, 1, 1, "", 1, "", 1, 1, "", "", "", false, false, false, false, null, "", 1, "", 1); DataGetir(-1); MesajVer("Kayıt silinmiştir.", MesajTipi.Uyari, this); } }
private void btnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { //if(DuzenlemeModu) //{ DateTime?Tarih1 = new DateTime?(); if (cmbDogumTarihi.EditValue != null && cmbDogumTarihi.DateTime.Year != 1) { Tarih1 = Convert.ToDateTime(cmbDogumTarihi.EditValue); } else { Tarih1 = null; } var list = data.IUD_Baglanti(false, kayitid, txtAdi.Text, txtAdi.Text + " " + txtSoyadi.Text, txtAdres.Text, toggAktif.Checked, true,//rgBireyselKurumsal.SelectedIndex == 0 ? true : false, txtCepTel.Text, -1, "",//txtDahili.Text, Tarih1, txtEPosta.Text, txtEvTel.Text, null, //Convert.ToInt32(cmbFirma.EditValue), "", //txtIsTel.Text, 1, //kullanici id true, //rgBireyselKurumsal.SelectedIndex == 1 ? true : false, Convert.ToInt32(cmbMedeniHali.EditValue), Convert.ToInt32(cmbMeslek.EditValue), "",//memoNotlar.Text, Convert.ToInt32(cmbOnek.EditValue), txtPostaKodu.Text, Convert.ToInt32(tbcPuan.EditValue), Convert.ToInt32(rcReyting.EditValue), txtSehir.Text, txtSemt.Text, txtSoyadi.Text, Convert.ToBoolean(toggCepTel.EditValue), Convert.ToBoolean(toggEPosta.EditValue), Convert.ToBoolean(toggEvTel.EditValue), null, //Convert.ToBoolean(toggIsTel.EditValue), DateTime.Now.Date, "", //ülke string Convert.ToInt32(cmbUlke.EditValue), "", //txtUnvan.Text, Convert.ToInt32(cmbUyrugu.EditValue)).ToList(); //genel tercihler string text = string.Empty; foreach (object item in checkedListBoxControl1.CheckedItems) { DataRowView row = item as DataRowView; text += string.Format("{0},", row.Row.ItemArray[0].ToString()); } text = text.TrimEnd(','); Data.EsnekKayitlarKaydet_checkedList(text, kayitid, 2); //özel tercihler text = ""; string deger = ""; for (int i = 0; i < gvOTT.DataRowCount; i++) { if (gvOTT.GetRowCellValue(i, "SecilenKayitDegeriNvarchar").ToString().Trim() != "") { text += string.Format("{0},", gvOTT.GetRowCellValue(i, "ID").ToString()); deger += string.Format("{0},", gvOTT.GetRowCellValue(i, "SecilenKayitDegeriNvarchar").ToString()); } } text = text.TrimEnd(','); deger = deger.TrimEnd(','); Data.EsnekKayitlarKaydet_grid(text, kayitid, 1, -1, deger, 0, DateTime.Now); MesajVer("Bağlantı başarılı şekilde kayıt edilmiştir.", MesajTipi.Bilgi, this); barLblKayitID.Caption = list.FirstOrDefault().ID.ToString(); barLblKayitTarihi.Caption = list.FirstOrDefault().Tarih.ToString(); if (Convert.ToBoolean(list.FirstOrDefault().Aktif)) { barLblKayitAktifPasif.Caption = "Aktif Kayıt"; barLblKayitAktifPasif.Glyph = BarduckCRM.Properties.Resources.Apply_16x161; } else { barLblKayitAktifPasif.Caption = "Pasif Kayıt"; barLblKayitAktifPasif.Glyph = BarduckCRM.Properties.Resources.Apply_16x16; } //} //else // MesajVer("Sadece düzenleme modunda işlem yapabilirsiniz.", MesajTipi.Uyari, this); } catch (Exception hata) { } }