/// <summary> /// silme işlemi yapar /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSil_Click(object sender, EventArgs e) { if (selectedData != null) { if (Messaging.DialogExamMessage(Messaging.msg_silmeIslemiSoru)) { Request <Polyclinic, bool> request = new Request <Polyclinic, bool>(); request.MethodName = "DeletePolyclinic"; object[] vs = new object[1]; vs[0] = selectedData; var response = request.Execute(vs); if (!response.Success) { Common.WriteLog("database", "poliklinik kaydı silinemedi."); Messaging.DialogErrorMessage(Messaging.msg_silmeHata + response.ErrorMessage); return; } Messaging.DialogInfoMessage(Messaging.msg_silmeOk); } } else { Messaging.DialogWarningMessage(Messaging.msg_selectRecordWarning); } }
/// <summary> /// hasta bilgisi getirir /// </summary> private void GetPatient() { var filterstring = $"dosyano = '{DosyaNo}'"; var req = new Request <Patient, List <Patient> > { DataContract = new Patient() { DosyaNo = DosyaNo }, MethodName = "SelectPatient" }; var response = req.Execute(o: new object[2] { null, filterstring }); if (!response.Success) { Messaging.DialogErrorMessage(response.ErrorMessage); return; } if (response.Value.Count > 0) { patient = response.Value[0]; } else { Messaging.DialogWarningMessage(Messaging.msg_hastaBulunamadı); return; } }
/// <summary> /// odeme türlerini alır /// </summary> private void GetOdeme() { var request = new Request <bool, List <string> >(); request.MethodName = "SelectOdeme"; var response = request.Execute(); if (!response.Success) { Messaging.DialogErrorMessage("Odeme türü bilgileri alınamadı."); return; } odemeTurleri = response.Value; }
/// <summary> /// son dosya numarası bilgisini getirir. /// </summary> private void GetLastFileNumber() { var request = new Request <bool, int>(); request.MethodName = "SelectDosyaNo"; var response = request.Execute(); if (!response.Success) { Messaging.DialogErrorMessage("son dosya numarası alınamadı."); return; } Dosya.SonDosyaNumarası = response.Value; }
/// <summary> /// ünvan kayıtlarınık getirir /// </summary> private void GetUnvan() { var request = new Request <bool, List <string> >(); request.MethodName = "SelectUnvan"; var response = request.Execute(); if (!response.Success) { Messaging.DialogErrorMessage("unvan listesi alınamadı"); return; } unvans = new List <string>(); unvans = response.Value; }
/// <summary> /// verileri getirir /// </summary> private void GetData() { var request = new Request <TransferListContract, List <TransferListContract> >(); request.MethodName = "SelectGeneralList"; var response = request.Execute(datacontract); if (!response.Success) { Messaging.DialogErrorMessage("Bilgiler alınamadı"); return; } dataList = response.Value; dtgridDataList.DataSource = dataList; }
/// <summary> /// kaydetme işlemi /// </summary> private void SaveCommand() { var request = new Request <Discharged, bool>(); request.MethodName = "InsertDischarged"; var response = request.Execute(dataContract); if (!response.Success) { Messaging.DialogErrorMessage(Messaging.msg_kayıtHata); return; } Messaging.DialogInfoMessage("Çıkış işlemi kaydedildi."); this.Close(); }
/// <summary> /// yeni ekler /// </summary> private void SavePatient() { var request = new Request <Patient, bool>(); request.DataContract = patient; request.MethodName = "UpdatePatient"; var response = request.Execute(patient); if (!response.Success) { Messaging.DialogErrorMessage("Kayıt hatası" + response.ErrorMessage); return; } Messaging.DialogInfoMessage(Messaging.msg_kayıtOk); }
/// <summary> /// dosya numarasından hasta getirir. /// </summary> private void GetPatient() { var request = new Request <Patient, Patient>(); request.MethodName = "SelectPatientByKey"; var response = request.Execute(DosyaNo); if (response.Success) { patient = response.Value; } else { Messaging.DialogErrorMessage(response.ErrorMessage); } }
/// <summary> /// kullanıcı güncelle /// </summary> private void UdateUser() { var request = new Request <User, bool>(); request.MethodName = "UpdateUser"; object[] o = new object[1]; o[0] = updateUser; var response = request.Execute(o); if (!response.Success) { Messaging.DialogErrorMessage(response.ErrorMessage); return; } Messaging.DialogInfoMessage(Messaging.msg_güncellemeOk); }
/// <summary> /// sevk kaydeder. /// </summary> /// <param name="transfer"></param> private void InsertTransfer(Transfer transfer) { var request = new Request <Transfer, bool>(); request.DataContract = transfer; request.MethodName = "InsertTransfer"; var response = request.Execute(transfer); if (!response.Success) { Messaging.DialogErrorMessage(Messaging.msg_kayıtHata); return; } GetTransfersAll(); SetDataGridValues(); }
/// <summary> /// listeyi getirir /// </summary> private void GetPolyclinicList() { Request <Polyclinic, List <Polyclinic> > request = new Request <Polyclinic, List <Polyclinic> >(); request.MethodName = "SelectPolyclinic"; var response = request.Execute(); if (!response.Success) { Common.WriteLog("veri tabanı", "poliklinik listesi alınamadı"); Messaging.DialogErrorMessage("poliklinik listesi alınamadı."); return; } polyList = response.Value; SetListToCombo(); }
/// <summary> /// sevk getir /// git butonu click eventi /// TODO: güncellenecek (filtre kalkacak) /// </summary> private void GetTransfersAll() { transfers = new List <Transfer>(); Request <Transfer, List <Transfer> > request = new Request <Transfer, List <Transfer> >(); request.MethodName = "SelectTransfer"; GenericResponse <List <Transfer> > responseUser = request.Execute(null, "dosyano = '" + txtDosyaNo.Text + "' OR yapilanislem = '" + selectedOperation.IslemAdi + "'"); if (!responseUser.Success) { Messaging.DialogErrorMessage(responseUser.ErrorMessage); return; } transfers = responseUser.Value; }
/// <summary> /// işlemleri al /// </summary> private void GetOperations() { operations = new List <Operation>(); Request <Operation, List <Operation> > request = new Request <Operation, List <Operation> >(); request.MethodName = "SelectOperation"; GenericResponse <List <Operation> > responseUser = request.Execute(); if (!responseUser.Success) { Messaging.DialogErrorMessage(responseUser.ErrorMessage); return; } operations = responseUser.Value; }
/// <summary> /// poliklinikleri al /// </summary> private void GetPolyclinics() { polyclinics = new List <Polyclinic>(); Request <Polyclinic, List <Polyclinic> > request = new Request <Polyclinic, List <Polyclinic> >(); request.MethodName = "SelectPolyclinic"; GenericResponse <List <Polyclinic> > responseUser = request.Execute(); if (!responseUser.Success) { Messaging.DialogErrorMessage(responseUser.ErrorMessage); return; } polyclinics = responseUser.Value; }
/// <summary> /// kullanıcıyı kaydet /// </summary> private void SaveUser() { var request = new Request <User, bool>(); request.MethodName = "InsertUser"; object[] o = new object[1]; o[0] = data; var response = request.Execute(o); if (!response.Success) { Messaging.DialogErrorMessage(response.ErrorMessage); return; } Messaging.DialogInfoMessage(Messaging.msg_kayıtOk); }
/// <summary> /// dosya numarasına göre sevk getirir /// </summary> private void GetTransferByDosyaNo() { transfers = new List <Transfer>(); Request <Transfer, List <Transfer> > request = new Request <Transfer, List <Transfer> >(); request.MethodName = "SelectTransferByDosyaNo"; GenericResponse <List <Transfer> > responseUser = request.Execute(DosyaNo); if (!responseUser.Success) { Messaging.DialogErrorMessage(responseUser.ErrorMessage); return; } transfers = responseUser.Value; dtgTahliller.DataSource = transfers; }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnBul_Click(object sender, EventArgs e) { if (Common.SpaceControl(filterStr)) { var request = new Request <Patient, List <Patient> >(); request.MethodName = "SelectPatient"; var response = request.Execute(null, string.Format("{0} = '{1}'", filterHead, filterStr)); if (!response.Success) { Messaging.DialogErrorMessage(response.ErrorMessage); return; } dtgridHasta.DataSource = response.Value; } else { Messaging.DialogWarningMessage("kriter giriniz."); } }
/// <summary> /// kullanıcıları getir /// </summary> private void GetUsers() { var request = new Request <User, List <User> >(); request.MethodName = "SelectUser"; var response = request.Execute(); if (!response.Success) { Messaging.DialogErrorMessage(Messaging.msg_selectHata); return; } userList = response.Value; userList.Insert(0, new User { UserName = Messaging.msg_seciniz }); cmb_kullanicilar.DataSource = userList; cmb_kullanicilar.DisplayMember = "UserName"; }
/// <summary> /// kullanıcıları al /// </summary> private void GetUsers() { users = new List <User>(); Request <User, List <User> > request = new Request <User, List <User> >(); request.MethodName = "SelectUser"; GenericResponse <List <User> > responseUser = request.Execute(); if (!responseUser.Success) { Messaging.DialogErrorMessage(responseUser.ErrorMessage); return; } users = responseUser.Value; var list = users.Where(x => x.Unvan == Unvan.Doktor).ToList(); cmbDrKodu.DataSource = list; cmbDrKodu.DisplayMember = "Kodu"; }
/// <summary> /// sil /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSil_Click(object sender, EventArgs e) { if (Common.SpaceControl(txtKullaniciKodu.Text)) { if (Messaging.DialogExamMessage(Messaging.msg_silmeIslemiSoru)) { var request = new Request <User, bool>(); request.MethodName = "DeleteUser"; User user = new User { Kodu = Convert.ToInt32(txtKullaniciKodu.Text) }; var response = request.Execute(user); if (!response.Success) { Messaging.DialogErrorMessage(Messaging.msg_silmeHata + response.ErrorMessage); return; } Messaging.DialogInfoMessage(Messaging.msg_silmeOk); } } }
/// <summary> /// seçili kaydı sler /// </summary> private void DeleteSelectedTransfer() { if (SelectedDataGridTransfer != null) { if (!Messaging.DialogExamMessage("Seçili kayıt silinsin mi?")) { return; } var request = new Request <Transfer, bool>(); request.MethodName = "DeleteTransfer"; request.DataContract = SelectedDataGridTransfer; var response = request.Execute(selectedOperation); if (!response.Success) { Messaging.DialogErrorMessage(response.ErrorMessage); return; } Messaging.DialogInfoMessage(Messaging.msg_silmeOk); } }
/// <summary> /// poliklinik güncelleme/kaydetme /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnGuncelle_Click(object sender, EventArgs e) { if (isUpdate) { Request <Polyclinic, bool> request = new Request <Polyclinic, bool>(); request.MethodName = "UpdatePolyclinic"; var response = request.Execute(selectedData); if (!response.Success) { Common.WriteLog("database", "poliklinik kaydı yapılamadı."); Messaging.DialogErrorMessage(Messaging.msg_güncellemeHata); return; } Messaging.DialogInfoMessage(Messaging.msg_güncellemeOk); } else { var request = new Request <Polyclinic, bool>(); request.MethodName = "InsertPolyclinic"; var response = request.Execute(new Polyclinic { PoliklinikAdi = cmb_policlinic.Text, Aciklama = txtAciklama.Text, Durum = (cbx_gecerli.CheckState == CheckState.Checked) ? Common.PolyclinicStatusAktif : Common.PolyclinicStatusPasif }); if (!response.Success) { Messaging.DialogErrorMessage(Messaging.msg_kayıtHata); return; } Messaging.DialogInfoMessage(Messaging.msg_kayıtOk); } }