private void btn_kaydet_Click(object sender, EventArgs e) { CallCenterEntities veri2 = new CallCenterEntities();//çalışmalar tablosuna seç durumlarını kaydetmesin diye... veri2.Database.Connection.ConnectionString = AnaForm.cstr; try { foreach (var item in calismalist) { var kayit = (from p in veri2.KULLANICICALISMALAR_TBL where p.KC_KUL_ID == sayfakul_id && p.KC_CAL_ID == item.CAL_ID select p).SingleOrDefault(); if (item.CAL_SEC == false && kayit != null) { veri2.KULLANICICALISMALAR_TBL.Remove(kayit); veri2.SaveChanges(); } if (item.CAL_SEC == true && kayit == null) { var ekle = new KULLANICICALISMALAR_TBL(); ekle.KC_KUL_ID = sayfakul_id; ekle.KC_CAL_ID = item.CAL_ID; veri2.KULLANICICALISMALAR_TBL.Add(ekle); veri2.SaveChanges(); } } MessageBox.Show("Kaydedildi", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); AnaForm.logkaydet("Kullanıcı Çalışmaları", "Liste Düzenleme (" + lbl_kullanici.Text + ")"); } catch (Exception ex) { MessageBox.Show("Kaydedilemedi, Hata:" + ex.Message, "Hata!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_kaydet_Click(object sender, EventArgs e) // SSS_TBL deki kaydı günceller ya da yeni kayıt ekler. { if (txt_soru.Text == "") { MessageBox.Show("Lütfen Soru belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); txt_soru.Focus(); return; } if (txt_cevap.Text == "") { MessageBox.Show("Lütfen Cevap belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); txt_cevap.Focus(); return; } try { SSS_TBL kayit; if (ssid == 0) { kayit = new SSS_TBL(); } else { kayit = (from p in veri.SSS_TBL where p.SS_ID == ssid select p).SingleOrDefault(); } kayit.SS_SORU = txt_soru.Text; kayit.SS_CEVAP = txt_cevap.Text; kayit.SS_CAL_ID = Convert.ToInt32(cmb_calismaid.EditValue); kayit.SS_AKTIF = chk_aktif.Checked; if (ssid == 0) { veri.SSS_TBL.Add(kayit); } MessageBox.Show(veri.SaveChanges() > 0 ? "Kaydedildi" : "Değişiklik yok!", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); int calid = Convert.ToInt32(cmb_calismaid.EditValue); var calisma = (from p in veri.CALISMALAR_TBL where p.CAL_ID == calid select p).SingleOrDefault(); if (ssid == 0) { AnaForm.logkaydet("Sık Sorulan Sorular", "Ekleme (" + calisma.CAL_CALISMAID + " " + calisma.CAL_ADI + ")(" + txt_soru.Text + ")"); } else { AnaForm.logkaydet("Sık Sorulan Sorular", "Güncelleme (" + calisma.CAL_CALISMAID + " " + calisma.CAL_ADI + ")(" + txt_soru.Text + ")"); } listele(); temizle(); } catch (Exception ex) { MessageBox.Show("Kaydedilemedi, Hata:" + ex.Message, "Hata!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_kaydet_Click(object sender, EventArgs e) // RENKLER_TBL ye kayıt atar ya da günceller. { //if (txt_kod.Text == "") //{ // MessageBox.Show("Lütfen Renk Kodu belirtiniz"); // txt_kod.Focus(); // return; //} if (txt_aciklama.Text == "") { MessageBox.Show("Lütfen Açıklama belirtiniz"); txt_aciklama.Focus(); return; } try { RENKLER_TBL kayit; if (renk_id == 0) { kayit = new RENKLER_TBL(); } else { kayit = (from p in veri.RENKLER_TBL where p.RENK_ID == renk_id select p).SingleOrDefault(); } //Renk.Color.ToArgb().ToString() kayit.RENK_KOD = Renk.Color.ToArgb().ToString(); // kayit.RENK_KOD = ColorTranslator.ToHtml(Renk.Color); // "#FF" + String.Format("{0:X2}{1:X2}{2:X2}", Renk.Color.B, Renk.Color.G, Renk.Color.R); kayit.RENK_HEX = string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", Renk.Color.A, Renk.Color.R, Renk.Color.G, Renk.Color.B); kayit.RENK_BASLIK = txt_aciklama.Text; kayit.RENK_AKTIF = chk_aktif.Checked; if (renk_id == 0) { veri.RENKLER_TBL.Add(kayit); } MessageBox.Show(veri.SaveChanges() > 0 ? "Kaydedildi" : "Değişiklik yok!", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); AnaForm.logkaydet("Randevu Durumları", "Liste Düzenleme"); listele(); temizle(); } catch (Exception ex) { MessageBox.Show("Kaydedilemedi, Hata:" + ex.Message, "Hata!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void SpkVolume_Scroll(object sender, EventArgs e) { //anaformda bu ayarları userlogged'a sadece initialize de çekiyor, Bu yüzden userlogged u refresh etmeme gerek kalmıyor. cihazın ayarını değiştirip, vt ye de kaydedince sorunsuz çalışıyor. AnaForm.AbtoPhone.PlaybackVolume = spkVolume.Value; try { var kullanici = (from p in veri.KULLANICILAR_TBL where p.KUL_ID == AnaForm.userid select p).ToList(); kullanici[0].KUL_HOPARLORDUZEYI = spkVolume.Value; veri.SaveChanges(); } catch (Exception) { } }
private void btn_kaydet_Click(object sender, EventArgs e) // CIKISKODLARI_TBL a kayıt atar ya da kayıt günceller { if (txt_kod.Text == "") { MessageBox.Show("Lütfen Çıkış Kodu belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); txt_kod.Focus(); return; } try { CIKISKODLARI_TBL kayit; if (ck_id == 0) { kayit = new CIKISKODLARI_TBL(); } else { kayit = (from p in veri.CIKISKODLARI_TBL where p.CK_ID == ck_id select p).SingleOrDefault(); } kayit.CK_KOD = txt_kod.Text; kayit.CK_ACIKLAMA = txt_aciklama.Text; kayit.CK_AKTIF = chk_aktif.Checked; kayit.CK_SEC = false; if (ck_id == 0) { veri.CIKISKODLARI_TBL.Add(kayit); } MessageBox.Show(veri.SaveChanges() > 0 ? "Kaydedildi" : "Değişiklik yok!", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); if (ck_id == 0) { AnaForm.logkaydet("Çıkış Kodu", "Ekleme (" + txt_kod.Text + ")"); } else { AnaForm.logkaydet("Çıkış Kodu", "Güncelleme (" + txt_kod.Text + ")"); } listele(); temizle(); } catch (Exception ex) { MessageBox.Show("Kaydedilemedi, Hata:" + ex.Message, "Hata!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_kaydet_Click(object sender, EventArgs e) // FORUMKONULARI_TBL ye kayıt atar ya da kayıt günceller. { if (txt_konu.Text == "") { MessageBox.Show("Lütfen Konu belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); txt_konu.Focus(); return; } try { FORUMKONULARI_TBL kayit; if (frid == 0) { kayit = new FORUMKONULARI_TBL(); } else { kayit = (from p in veri.FORUMKONULARI_TBL where p.FR_ID == frid select p).SingleOrDefault(); } kayit.FR_ADI = txt_konu.Text; kayit.FR_ACIKLAMA = txt_aciklama.Text; kayit.FR_AKTIF = chk_aktif.Checked; if (frid == 0) { veri.FORUMKONULARI_TBL.Add(kayit); } MessageBox.Show(veri.SaveChanges() > 0 ? "Kaydedildi" : "Değişiklik yok!", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); if (frid == 0) { AnaForm.logkaydet("Forum Konusu", "Ekleme (" + txt_konu.Text + ")"); } else { AnaForm.logkaydet("Forum Konusu", "Güncelleme (" + txt_konu.Text + ")"); } listele(); temizle(); } catch (Exception ex) { MessageBox.Show("Kaydedilemedi, Hata:" + ex.Message, "Hata!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_kaydet_Click(object sender, EventArgs e) // GENELAYARLAR_TBL deki kaydı günceller. { if ((TimeSpan)tsp_gunbaslamasaati.EditValue >= (TimeSpan)tsp_gunbitissaati.EditValue) { MessageBox.Show("Gün bitiş saati, başlama saatinden küçük ya da eşit olamaz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); tsp_gunbitissaati.Focus(); return; } try { var sonuc = (from p in veri.GENELAYARLAR_TBL select p).ToList(); sonuc[0].GA_GUNBASLAMASAAT = (TimeSpan)tsp_gunbaslamasaati.EditValue; sonuc[0].GA_GUNBITISSAAT = (TimeSpan)tsp_gunbitissaati.EditValue; sonuc[0].GA_CUMARTESICALIS = chk_cumartesicalis.Checked; sonuc[0].GA_PAZARCALIS = chk_pazarcalis.Checked; sonuc[0].GA_ANASAYFA_BASLIK = txt_baslik.Text; sonuc[0].GA_CIHAZIP = txt_domainadi.Text; sonuc[0].GA_YAKLASANRANDEVUDK = (TimeSpan)tsp_yaklasanrandk.EditValue; sonuc[0].GA_FTP_IP = txt_sunucu.Text; sonuc[0].GA_FTP_KULLANICI = txt_ftpkul.Text; sonuc[0].GA_FTP_SIFRE = txt_ftpsifre.Text; sonuc[0].GA_FTP_DIZIN = txt_ftpdizin.Text; if (rd_ranlist.Checked == true) { sonuc[0].GA_RANDEVUISTEKSAYFA = "TAKVIM"; } else { sonuc[0].GA_RANDEVUISTEKSAYFA = "EKLE"; } MessageBox.Show(veri.SaveChanges() > 0 ? "Kaydedildi" : "Değişiklik yok!", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); Application.OpenForms["AnaForm"].Text = txt_baslik.Text; AnaForm.logkaydet("Genel Ayarlar", "Güncelleme"); } catch (Exception ex) { MessageBox.Show("Kaydedilemedi, Hata:" + ex.Message, "Hata!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button_sil_Click(object sender, EventArgs e) // CALISMATAKVIMI_TBL den kayıt siler. { if (grdview_list.GetFocusedRow() == null) { return; } DialogResult cikis = new DialogResult(); cikis = MessageBox.Show("Silmek istediğinizden emin misiniz?", "Uyarı!", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (cikis == DialogResult.No) { return; } try { ctid = Convert.ToInt32(grdview_list.GetFocusedRowCellValue("CT_ID")); var kayit = (from p in veri.CALISMATAKVIMI_TBL where p.CT_ID == ctid select p).SingleOrDefault(); if (kayit != null) { veri.CALISMATAKVIMI_TBL.Remove(kayit); veri.SaveChanges(); } MessageBox.Show("Silindi", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); if (sayfacal_id == 0) { AnaForm.logkaydet("Genel Tatil/Ek Mesai", "Silme (" + Convert.ToString(grdview_list.GetFocusedRowCellValue("CT_ADI")) + ")"); } else { AnaForm.logkaydet("Tatil/Ek Mesai", "Silme (" + Convert.ToString(grdview_list.GetFocusedRowCellValue("CT_ADI")) + ")" + "(" + lbl_calisma.Text + ")"); } listele(); temizle(); } catch (Exception ex) { MessageBox.Show("Silinemedi, Hata:" + ex.Message, "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void SchedulerDataStorage1_AppointmentsDeleted(object sender, PersistentObjectsEventArgs e) { AppointmentBaseCollection appts = (AppointmentBaseCollection)e.Objects; foreach (Appointment apt in appts) { int id = Convert.ToInt32(apt.Id); var kayıt = (from inc in veri.RANDEVULAR_TBL where inc.RAN_ID == id select inc).SingleOrDefault(); kayıt.RAN_KAPANMA = AnaForm.tarihsaatgetir(); //veri.RANDEVULAR_TBL.Remove(kayıt); veri.SaveChanges(); int calid = Convert.ToInt32(kayıt.RAN_CAL_ID); int istid = Convert.ToInt32(kayıt.RAN_IST_ID); var calisma = (from p in veri.CALISMALAR_TBL where p.CAL_ID == calid select p).SingleOrDefault(); var istek = (from p in veri.ISTEKLER_TBL where p.IST_ID == istid select p).SingleOrDefault(); AnaForm.logkaydet("Randevu", "Silme (" + calisma.CAL_CALISMAID + " " + calisma.CAL_ADI + ")(" + istek.IST_TELNO + ")"); } }
private void buttonOK_Click(object sender, EventArgs e) { var kayit = (from p in veri.MESAJLAR_TBL where p.MSJ_ID == sayfamsjid select p).SingleOrDefault(); if (kayit != null) { kayit.MSJ_MESAJ = txt_mesaj.Text; MessageBox.Show(veri.SaveChanges() > 0 ? "Kaydedildi" : "Değişiklik yok!", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); } this.DialogResult = DialogResult.OK; this.Close(); }
private void button_sil_Click(object sender, EventArgs e) // ISTEKLER_TBL den kayıt siler. { if (grdview_list.GetFocusedRow() == null) { return; } istid = Convert.ToInt32(grdview_list.GetFocusedRowCellValue("IST_ID")); int rankontrol = (from p in veri.RANDEVULAR_TBL where p.RAN_IST_ID == istid select p).ToList().Count(); if (rankontrol > 0) { MessageBox.Show("İstek için randevu oluşturulmuş silinemez...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } int cagkontrol = (from p in veri.CAGRILAR_TBL where p.CAG_IST_ID == istid select p).ToList().Count(); if (cagkontrol > 0) { MessageBox.Show("İstek için çağrı oluşturulmuş silinemez...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } DialogResult cikis = new DialogResult(); cikis = MessageBox.Show("Silmek istediğinizden emin misiniz?", "Uyarı!", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (cikis == DialogResult.No) { return; } try { var kayit = (from p in veri.ISTEKLER_TBL where p.IST_ID == istid select p).SingleOrDefault(); if (kayit != null) { veri.ISTEKLER_TBL.Remove(kayit); veri.SaveChanges(); } MessageBox.Show("Silindi", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); listele(); } catch (Exception ex) { MessageBox.Show("Silinemedi, Hata:" + ex.Message, "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_aktar_Click(object sender, EventArgs e) // seçilen kullanıcının seçilen mesajlarını seçilen başka bir kullanıcıya aktarır. { if (ranlist.Count() < 1) { MessageBox.Show("Lütfen aktarılacak randevuları listeleyiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (ranlist.Where(t => t.RAN_SEC == true).Count() < 1) { MessageBox.Show("Lütfen aktarılacak randevuları seçiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (cmb_aktarilacakkullanici.Text == "") { MessageBox.Show("Lütfen aktarılacak kullanıcıyı belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); cmb_aktarilacakkullanici.Focus(); return; } if (Convert.ToInt32(cmb_aktarilacakkullanici.EditValue) == Convert.ToInt32(ranlist[0].RAN_KUL_ID)) { MessageBox.Show("Seçtiğiniz kullanıcı, Aktarılacak kullanıcı ile aynı...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); cmb_aktarilacakkullanici.Focus(); return; } DialogResult cikis = new DialogResult(); cikis = MessageBox.Show("Seçili Randevular " + cmb_aktarilacakkullanici.Text + " kullanıcısına aktarılacaktır. Devam etmek istediğinizden emin misiniz?", "Uyarı!", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (cikis == DialogResult.No) { return; } foreach (var item in ranlist.Where(t => t.RAN_SEC == true)) { var kayit = (from p in veri.RANDEVULAR_TBL where p.RAN_ID == item.RAN_ID select p).SingleOrDefault(); kayit.RAN_KUL_ID = Convert.ToInt32(cmb_aktarilacakkullanici.EditValue); veri.SaveChanges(); } MessageBox.Show("Aktarım Tamamlandı...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); grd_list.DataSource = null; AnaForm.logkaydet("Randevu Aktarma ", "(" + cmb_kullanici.Text + "->" + cmb_aktarilacakkullanici.Text + ")"); }
private void btn_kaydet_Click(object sender, EventArgs e) // CALISMALAR_TBL ye kayıt ekler ya da günceller { string calismaid = ""; if (cmb_periyot.Text == "Manuel Aralık") { calismaid = txt_mancalismaid.Text; } else { calismaid = cmb_calismaid.Text; } if (calismaid == "") { MessageBox.Show("Lütfen Çalışma ID belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); if (cmb_periyot.Text == "Manuel Aralık") { txt_mancalismaid.Focus();; } else { cmb_calismaid.Focus(); } return; } var varmi = (from p in veri.CALISMALAR_TBL where p.CAL_CALISMAID == calismaid && p.CAL_ID != cal_id select p).SingleOrDefault(); if (varmi != null) { string msj = ""; if (varmi.CAL_SIL == true) { msj = "Bu Çalışma ID daha önce silinmiştir, tanımlanamaz"; } else { msj = "Aynı Çalışma ID birden fazla tanımlanamaz..."; } MessageBox.Show(msj, "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); if (cmb_periyot.Text == "Manuel Aralık") { txt_mancalismaid.Focus();; } else { cmb_calismaid.Focus(); } return; } if (txt_adi.Text == "") { MessageBox.Show("Lütfen Çalışma Adı belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); txt_adi.Focus(); return; } if (dt_yili.Text == "") { MessageBox.Show("Lütfen Çalışma Yılı belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); dt_yili.Focus(); return; } if (cmb_periyot.Text == "") { MessageBox.Show("Lütfen Çalışma Periyodu belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); cmb_periyot.Focus(); return; } if (dt_baslama.Text == "") { MessageBox.Show("Lütfen Başlama Tarihi belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); dt_baslama.Focus(); return; } if (dt_bitis.Text == "") { MessageBox.Show("Lütfen Bitiş Tarihi belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); dt_bitis.Focus(); return; } if (Convert.ToDateTime(dt_baslama.DateTime) >= Convert.ToDateTime(dt_bitis.DateTime)) { MessageBox.Show("Bitiş Tarihi, Başlama Tarihinden küçük ya da eşit olamaz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); dt_bitis.Focus(); return; } //if (tsp_gunbaslamasaati.EditValue == null ) //{ // MessageBox.Show("Lütfen Gün Başlama Saati belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); // tsp_gunbaslamasaati.Focus(); // return; //} //if (tsp_gunbitissaati.EditValue == null) //{ // MessageBox.Show("Lütfen Gün Bitiş Saati belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); // tsp_gunbitissaati.Focus(); // return; //} if (t_randevudk.EditValue == null) { MessageBox.Show("Lütfen Randevu Aralığı belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); t_randevudk.Focus(); return; } if (tsp_gunbaslamasaati.EditValue != null && tsp_gunbitissaati.EditValue != null) { if ((TimeSpan)tsp_gunbaslamasaati.EditValue >= (TimeSpan)tsp_gunbitissaati.EditValue) { MessageBox.Show("Gün Bitiş Saati, Başlama Saatinden küçük ya da eşit olamaz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); tsp_gunbitissaati.Focus(); return; } } try { CALISMALAR_TBL kayit; if (cal_id == 0) { kayit = new CALISMALAR_TBL(); } else { kayit = (from p in veri.CALISMALAR_TBL where p.CAL_ID == cal_id select p).SingleOrDefault(); } kayit.CAL_CALISMAID = calismaid; //cmb_calismaid.Text; kayit.CAL_ADI = txt_adi.Text; kayit.CAL_PERIYOT = cmb_periyot.Text; kayit.CAL_YIL = dt_yili.DateTime; kayit.CAL_BASLAMATARIH = dt_baslama.DateTime; kayit.CAL_BITISTARIH = dt_bitis.DateTime; if (tsp_gunbaslamasaati.EditValue != null) { kayit.CAL_GUNBASLAMASAAT = (TimeSpan)tsp_gunbaslamasaati.EditValue; } if (tsp_gunbitissaati.EditValue != null) { kayit.CAL_GUNBITISSAAT = (TimeSpan)tsp_gunbitissaati.EditValue; } kayit.CAL_RANDEVUARALIK = (TimeSpan)t_randevudk.EditValue; kayit.CAL_MANUELARAMA = chk_manuelara.Checked; kayit.CAL_SEC = false; kayit.CAL_SIL = false; if (cal_id == 0) { veri.CALISMALAR_TBL.Add(kayit); } MessageBox.Show(veri.SaveChanges() > 0 ? "Kaydedildi" : "Değişiklik yok!", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); if (cal_id == 0) { AnaForm.logkaydet("Çalışma", "Ekleme (" + calismaid + " " + txt_adi.Text + ")"); } else { AnaForm.logkaydet("Çalışma", "Güncelleme (" + calismaid + " " + txt_adi.Text + ")"); } listele(); temizle(); } catch (Exception ex) { MessageBox.Show("Kaydedilemedi, Hata:" + ex.Message, "Hata!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnOk_Click(object sender, EventArgs e) { dt_bitis.DateTime = edtStartDate.DateTime.Date.AddHours(edtStartTime.Time.Hour).AddMinutes(edtStartTime.Time.Minute).AddMinutes(AnaForm.randk); if (edtLabel.AppointmentLabel == null) { MessageBox.Show("Lütfen Durum belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (edtStartDate.DateTime.Date.AddHours(edtStartTime.Time.Hour).AddMinutes(edtStartTime.Time.Minute) < AnaForm.tarihsaatgetir()) { MessageBox.Show("Geçmiş tarihe randevu alınamaz", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //string sonuc = AnaForm.CalismaAktifPeriyotMu (dt_baslama.DateTime); //if (sonuc!= "") //{ // MessageBox.Show(sonuc, "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Error); // return; //} if (AnaForm.CalismaAktifPeriyotMu(edtStartDate.DateTime.Date.AddHours(edtStartTime.Time.Hour).AddMinutes(edtStartTime.Time.Minute), AnaForm.ist_id, AnaForm.cal_id, 0) == false) { return; } DateTime baslama = edtStartDate.DateTime.Date.AddHours(edtStartTime.Time.Hour).AddMinutes(edtStartTime.Time.Minute); DateTime bitis = edtEndDate.DateTime.Date.AddHours(edtEndTime.Time.Hour).AddMinutes(edtEndTime.Time.Minute); var dolumu = (from p in veri.RANDEVULAR_TBL where p.RAN_KUL_ID == AnaForm.userid && ((p.RAN_BASLAMATARIH >= baslama && p.RAN_BASLAMATARIH <= bitis) || (p.RAN_BITISTARIH >= baslama && p.RAN_BITISTARIH <= bitis) || (baslama >= p.RAN_BASLAMATARIH && baslama <= p.RAN_BITISTARIH) || (bitis >= p.RAN_BASLAMATARIH && bitis <= p.RAN_BITISTARIH) ) select p).ToList(); if (dolumu.Count() > 0) { MessageBox.Show(dolumu[0].RAN_BASLAMATARIH.ToString() + " - " + dolumu[0].RAN_BITISTARIH.ToString() + " aralığında randevunuz bulunmaktadır.", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { RANDEVULAR_TBL ekle = new RANDEVULAR_TBL(); ekle.RAN_IST_ID = AnaForm.ist_id; ekle.RAN_KUL_ID = AnaForm.userid; ekle.RAN_CAL_ID = AnaForm.cal_id; ekle.RAN_ACIKLAMA = tbDescription.Text; //ekle.RAN_BASLAMATARIH = edtStartDate.DateTime.AddHours(edtStartTime.Time.Hour).AddMinutes(edtStartTime.Time.Minute); //ekle.RAN_BITISTARIH = edtEndDate.DateTime.AddHours(edtEndTime.Time.Hour).AddMinutes(edtEndTime.Time.Minute); ekle.RAN_BASLAMATARIH = baslama; ekle.RAN_BITISTARIH = bitis; ekle.RAN_TELNO = tbSubject.Text; ekle.RAN_DURUMID = Convert.ToInt32(edtLabel.AppointmentLabel.Id); ekle.RAN_SEC = false; veri.RANDEVULAR_TBL.Add(ekle); veri.SaveChanges(); var calisma = (from p in veri.CALISMALAR_TBL where p.CAL_ID == AnaForm.cal_id select p).SingleOrDefault(); AnaForm.logkaydet("Randevu", "Ekleme (" + calisma.CAL_CALISMAID + " " + calisma.CAL_ADI + ")"); this.Close(); } catch (Exception ex) { MessageBox.Show("Kaydedilemedi, Hata:" + ex.Message, "Hata!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_mesajgonder_Click(object sender, EventArgs e) // MESAJLAR_TBL ye kayıt atar. { if (kullist == null) { return; } int secilen = kullist.Where(p => p.KUL_SEC == true).Count(); if (secilen == 0) { MessageBox.Show("Lütfen mesaj göndermek istediğiniz kullanıcı(ları) seçiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (txt_mesaj.Text == "") { MessageBox.Show("Lütfen mesajınızı belirtiniz"); txt_mesaj.Focus(); return; } DialogResult cikis = new DialogResult(); cikis = MessageBox.Show("Mesajınız " + secilen + " kişiye gönderilecektir. Devam etmek istiyor musunuz?", "Uyarı!", MessageBoxButtons.YesNo); if (cikis == DialogResult.No) { return; } CallCenterEntities veri2 = new CallCenterEntities(); //kullanıcılar tablosuna seç durumlarını kaydetmesin diye... veri2.Database.Connection.ConnectionString = AnaForm.cstr; try { MESAJLAR_TBL kayit; kayit = new MESAJLAR_TBL(); kayit.MSJ_KUL_ID = AnaForm.userid; //kayit.MSJ_FR_ID = 0; kayit.MSJ_TARIH = AnaForm.tarihsaatgetir(); //DateTime.Now; kayit.MSJ_MESAJ = txt_mesaj.Text; kayit.MSJ_OKUNDU = false; veri2.MESAJLAR_TBL.Add(kayit); veri2.SaveChanges(); //kul_sec field inden çalışıyordu: //foreach (var item in kullist.Where(p => p.KUL_SEC == true).ToList()) //{ // MESAJALICILARI_TBL alici= new MESAJALICILARI_TBL(); // alici.MA_ALICI_KUL_ID = item.KUL_ID; // alici.MA_MSJ_ID = kayit.MSJ_ID; // veri2.MESAJALICILARI_TBL.Add(alici); // veri2.SaveChanges(); //} //kul_sec field inden çalışıyordu. int[] selectedRowHandles = grdview_list.GetSelectedRows(); if (selectedRowHandles.Length > 0) { for (int i = 0; i < selectedRowHandles.Length; i++) {// MessageBox.Show(grdview_list.GetRowCellDisplayText(selectedRowHandles[i], KULADI).ToString()); MESAJALICILARI_TBL alici = new MESAJALICILARI_TBL(); alici.MA_ALICI_KUL_ID = Convert.ToInt32(grdview_list.GetRowCellDisplayText(selectedRowHandles[i], KUL_ID)); alici.MA_MSJ_ID = kayit.MSJ_ID; veri2.MESAJALICILARI_TBL.Add(alici); veri2.SaveChanges(); } } MessageBox.Show("Gönderildi", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); AnaForm.logkaydet("Mesaj", "Gönderme "); txt_mesaj.Text = ""; //foreach (var item in kullist.Where(p => p.KUL_SEC == true).ToList()) //{ // item.KUL_SEC = false; //} //mesajlaşma devam ediyor olabilir, seçimini kendisi kaldırsın. sayfaokunmayanlar = false; listelemesajlar(); } catch (Exception ex) { MessageBox.Show("Gönderme Tamamlanamadı, Hata:" + ex.Message, "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_ok_Click(object sender, EventArgs e) { if (cmb_calismaid.Text == "") { MessageBox.Show("Lütfen Çalışma ID belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); cmb_calismaid.Focus(); return; } //if (cmb_kulid.Text == "") //{ // MessageBox.Show("Lütfen Kullanıcı ID belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); // cmb_kulid.Focus(); // return; //} if (txt_brmno.Text == "") { MessageBox.Show("Lütfen Birim No belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); txt_brmno.Focus(); return; } if (txt_altbrmno.Text == "") { MessageBox.Show("Lütfen Alt Birim No belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); txt_altbrmno.Focus(); return; } //if (txt_yil.Text == "") //{ // MessageBox.Show("Lütfen Referans Yıl belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); // txt_yil.Focus(); // return; //} if (txt_tel.Text.Contains("_")) { MessageBox.Show("Lütfen Telefon No belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); txt_tel.Focus(); return; } string cumle = ""; if (cmb_kulid.Visible == true) { cumle = "select * from public.\"KULLANICICALISMALAR_V\" WHERE (\"KUL_KULLANICIID\" = '" + cmb_kulid.EditValue.ToString() + "' and \"CAL_CALISMAID\" = '" + cmb_calismaid.EditValue.ToString() + "') ORDER BY \"CAL_CALISMAID\""; } else { cumle = "select * from public.\"KULLANICICALISMALAR_V\" WHERE (\"KC_KUL_ID\" = " + AnaForm.userid + " and \"CAL_CALISMAID\" = '" + cmb_calismaid.EditValue.ToString() + "') ORDER BY \"CAL_CALISMAID\""; } using (conn = new NpgsqlConnection(AnaForm.cstr)) { conn.Open(); kullanicicalismalarlist = conn.Query <KULLANICICALISMALAR_V>(cumle).ToList(); } if (kullanicicalismalarlist.Count() < 1) { MessageBox.Show("Çalışma ve kullanıcı bağlantısı bulunamadı...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (txt_donem.Text == "") { //MessageBox.Show("Lütfen Referans Dönem belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); //txt_donem.Focus(); //return; } if (txt_ay.Text == "") { //MessageBox.Show("Lütfen Referans Ay belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); //txt_ay.Focus(); //return; } if (txt_hafta.Text == "") { //MessageBox.Show("Lütfen Referans Hafta belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); //txt_hafta.Focus(); //return; } try { ISTEKLER_TBL kayit; kayit = new ISTEKLER_TBL(); kayit.IST_TARIH = AnaForm.tarihsaatgetir(); kayit.IST_CALISMAID = cmb_calismaid.Text; kayit.IST_KULLANICIID = AnaForm.userkullaniciid; //cmb_kulid.Text; kayit.IST_BIRIMNO = Convert.ToInt32(txt_brmno.Text); kayit.IST_ALTBIRIMNO = Convert.ToInt32(txt_altbrmno.Text); if (txt_yil.Text != "") { kayit.IST_REFYIL = Convert.ToInt32(txt_yil.Text); } if (txt_donem.Text != "" && txt_donem.Text != "0") { kayit.IST_REFDONEM = Convert.ToInt32(txt_donem.Text); } if (txt_ay.Text != "" && txt_ay.Text != "0") { kayit.IST_REFAY = Convert.ToInt32(txt_ay.Text); } if (txt_hafta.Text != "" && txt_hafta.Text != "0") { kayit.IST_REFHAFTA = Convert.ToInt32(txt_hafta.Text); } kayit.IST_TELNO = txt_tel.Text.Replace("(", "").Replace(")", "").Replace("_", "").Replace(" ", ""); //txt_tel.Text; kayit.IST_IL = txt_il.Text; kayit.IST_ACIKLAMA = txt_aciklama.Text; kayit.IST_RANDEVUTERCIH = txt_randevutercih.Text; if (rd_cagri.Checked == true) { kayit.IST_NEDIR = "C"; } else { kayit.IST_NEDIR = "R"; } kayit.IST_ICERDEN = true; veri.ISTEKLER_TBL.Add(kayit); string calismaadi = cmb_calismaid.Text; var calisma = (from p in veri.CALISMALAR_TBL where p.CAL_SIL != true && p.CAL_CALISMAID == cmb_calismaid.Text select p).SingleOrDefault(); if (calisma != null) { calismaadi = cmb_calismaid.Text + " " + calisma.CAL_ADI; } MessageBox.Show(veri.SaveChanges() > 0 ? "Kaydedildi" : "Değişiklik yok!", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); AnaForm.logkaydet("İstek", "Ekleme (" + calismaadi + ")" + "(" + txt_tel.Text + ")"); this.Close(); } catch (Exception ex) { MessageBox.Show("Kaydedilemedi, Hata:" + ex.Message, "Hata!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_kaydet_Click(object sender, EventArgs e) // CALISMAPERIYOTLARI_TBL tablosuna kayıt atar ya da günceller. { if (dt_yil.Text == "" && dt_yil.Visible == true) { MessageBox.Show("Lütfen Çalışma Yılı belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); dt_yil.Focus(); return; } if (sp_donem.Text == "" && sp_donem.Visible == true && sp_ay.Visible == false && sp_hafta.Visible == false) //ay ve haftada dönem zorunlu değil. tabi dönemlikte zorunlu { MessageBox.Show("Lütfen Dönem belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); sp_donem.Focus(); return; } if (sp_ay.Text == "" && sp_ay.Visible == true) { MessageBox.Show("Lütfen Ay belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); sp_ay.Focus(); return; } if (sp_hafta.Text == "" && sp_hafta.Visible == true) { MessageBox.Show("Lütfen Hafta belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); sp_hafta.Focus(); return; } if (tbl_referans_panel.Visible == true) { if (dt_manuel_basla.Text == "" && dt_manuel_basla.Visible == true) { MessageBox.Show("Lütfen Manuel Başlama Tarihi belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); dt_manuel_basla.Focus(); return; } if (dt_manuel_bitis.Text == "" && dt_manuel_bitis.Visible == true) { MessageBox.Show("Lütfen Manuel Bitiş Tarihi belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); dt_manuel_bitis.Focus(); return; } } if (dt_baslama.Text == "") { MessageBox.Show("Lütfen Başlama Tarihi belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); dt_baslama.Focus(); return; } if (dt_bitis.Text == "") { MessageBox.Show("Lütfen Bitiş Tarihi belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); dt_bitis.Focus(); return; } try { CALISMAPERIYOTLARI_TBL kayit; if (cpid == 0) { kayit = new CALISMAPERIYOTLARI_TBL(); } else { kayit = (from p in veri.CALISMAPERIYOTLARI_TBL where p.CP_ID == cpid select p).SingleOrDefault(); } if (dt_yil.Visible == true) { kayit.CP_REFYIL = dt_yil.DateTime; } if (sp_donem.Visible == true && sp_donem.Text != null && sp_donem.Text != "" && sp_donem.Text != "0") { kayit.CP_REFDONEM = Convert.ToInt32(sp_donem.Text); } else { kayit.CP_REFDONEM = null; } if (sp_ay.Visible == true && sp_ay.Text != null && sp_ay.Text != "" && sp_ay.Text != "0") { kayit.CP_REFAY = Convert.ToInt32(sp_ay.Text); } else { kayit.CP_REFAY = null; } if (sp_hafta.Visible == true && sp_hafta.Text != null && sp_hafta.Text != "" && sp_hafta.Text != "0") { kayit.CP_REFHAFTA = Convert.ToInt32(sp_hafta.Text); } else { kayit.CP_REFHAFTA = null; } if (dt_manuel_basla.Visible == true) { kayit.CP_REF_MA_BASLANGIC = dt_manuel_basla.DateTime; } if (dt_manuel_bitis.Visible == true) { kayit.CP_REF_MA_BITIS = dt_manuel_bitis.DateTime; } kayit.CP_BASLAMATARIH = dt_baslama.DateTime; kayit.CP_BITISTARIH = dt_bitis.DateTime; kayit.CP_AKTIF = chk_aktif.Checked; kayit.CP_CAL_ID = sayfacal_id; if (cpid == 0) { veri.CALISMAPERIYOTLARI_TBL.Add(kayit); } MessageBox.Show(veri.SaveChanges() > 0 ? "Kaydedildi" : "Değişiklik yok!", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); if (cpid == 0) { AnaForm.logkaydet("Çalışma Aktif Periyodu", "Ekleme (" + lbl_calisma.Text + ")"); } else { AnaForm.logkaydet("Çalışma Aktif Periyodu", "Güncelleme (" + lbl_calisma.Text + ")"); } listele(); temizle(); } catch (Exception ex) { MessageBox.Show("Kaydedilemedi, Hata:" + ex.Message, "Hata!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_kaydet_Click(object sender, EventArgs e) //KULLANICILAR_TBL a kayıt atar ya da günceller. { if (cmb_kulid.Text == "") { MessageBox.Show("Lütfen Kullanıcı ID belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); cmb_kulid.Focus(); return; } if (cmb_rol.Text == "") { MessageBox.Show("Lütfen Rol belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); cmb_rol.Focus(); return; } if (txt_kuladi.Text == "") { MessageBox.Show("Lütfen Kullanıcı Adı belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); txt_kuladi.Focus(); return; } if (txt_sifre.Text == "") { MessageBox.Show("Lütfen Şifre belirtiniz...", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); txt_sifre.Focus(); return; } var varmi = (from p in veri.KULLANICILAR_TBL where p.KUL_KULLANICIID == cmb_kulid.Text && p.KUL_ID != kulid select p).SingleOrDefault(); if (varmi != null) { string msj = ""; if (varmi.KUL_SIL == true) { msj = "Bu Kullanıcı ID daha önce silinmiştir, tanımlanamaz..."; } else { msj = "Aynı Kullanıcı ID birden fazla tanımlanamaz..."; } MessageBox.Show(msj, "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning); cmb_kulid.Focus(); return; } try { KULLANICILAR_TBL kayit; if (kulid == 0) { kayit = new KULLANICILAR_TBL(); kayit.KUL_HOPARLORDUZEYI = 100; kayit.KUL_MIKROFONDUZEYI = 100; } else { kayit = (from p in veri.KULLANICILAR_TBL where p.KUL_ID == kulid select p).SingleOrDefault(); } kayit.KUL_ADI = txt_kuladi.Text; kayit.KUL_SIFRE = txt_sifre.Text; kayit.KUL_SANTRALUSERID = txt_santralkuladi.Text; kayit.KUL_SANTRALSIFRE = txt_santralsifre.Text; kayit.KUL_ROL_ID = Convert.ToInt32(cmb_rol.EditValue); kayit.KUL_KULLANICIID = cmb_kulid.Text; kayit.KUL_SEC = false; kayit.KUL_SIL = false; if (kulid == 0) { veri.KULLANICILAR_TBL.Add(kayit); } MessageBox.Show(veri.SaveChanges() > 0 ? "Kaydedildi" : "Değişiklik yok!", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Information); if (kulid == 0) { AnaForm.logkaydet("Kullanıcı", "Ekleme (" + cmb_kulid.Text + " " + txt_kuladi.Text + ")"); } else { AnaForm.logkaydet("Kullanıcı", "Güncelleme (" + cmb_kulid.Text + " " + txt_kuladi.Text + ")"); } listele(); temizle(); } catch (Exception ex) { MessageBox.Show("Kaydedilemedi, Hata:" + ex.Message, "Hata!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }