private void barButtonItemDeleteDiagnosis_ItemClick(object sender, ItemClickEventArgs e)
        {
            Diagnosis diagnosis = bindingSourceDiagnosis.Current as Diagnosis;

            if (diagnosis.IsNull())
            {
                Extensions.Extensions.ObjectNotSelectedForEdit();
                return;
            }

            if (Extensions.Extensions.DeletingAlert(diagnosis.Name) != DialogResult.Yes)
            {
                return;
            }
            Extensions.Extensions.ShowWaitForm(description: "İlaç siliniyor...");
            DiagnosisSolClient client        = Extensions.Extensions.GetDiagnosisSolClient();
            ProcessResult      processResult = client.Delete(diagnosis.Id);

            SplashScreenManager.CloseForm(false);
            Extensions.Extensions.ProcessResultMessage(processResult.Errors, (int)processResult.Result);
            if (processResult.Result == ExtensionsBLLResult.Success)
            {
                RefreshData(1);
            }
        }
Example #2
0
        private void barButtonItemSave_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (_diagnosis == null)
            {
                _diagnosis = new Diagnosis
                {
                    Name         = textEditName.Text,
                    DepartmentId = (int)(gridLookUpEditDep.EditValue.IsNull() ? 0 : gridLookUpEditDep.EditValue),
                    IsActive     = checkEditIsAktive.Checked
                };
            }
            else
            {
                _diagnosis.Name         = textEditName.Text;
                _diagnosis.DepartmentId = (int)(gridLookUpEditDep.EditValue.IsNull() ? 0 : gridLookUpEditDep.EditValue);
                _diagnosis.IsActive     = checkEditIsAktive.Checked;
            }

            Extensions.Extensions.ShowWaitForm(description: "Hastalık ismi kaydediliyor...");

            DiagnosisSolClient client        = Extensions.Extensions.GetDiagnosisSolClient();
            ProcessResult      processResult = update ? client.Update(_diagnosis) : client.Insert(_diagnosis);

            SplashScreenManager.CloseForm(false);
            Extensions.Extensions.ProcessResultMessage(processResult.Errors, (int)processResult.Result);
            if (processResult.Result == ExtensionsBLLResult.Success)
            {
                Close();
            }
        }
Example #3
0
 public XtraFormDiagnosis(Diagnosis diagnosis)
 {
     InitializeComponent();
     this._diagnosis           = diagnosis;
     textEditName.Text         = _diagnosis.Name;
     checkEditIsAktive.Checked = _diagnosis.IsActive;
     barButtonItemSave.Caption = "Güncelle";
     update = true;
 }
        private void barButtonItemEditDiagnosis_ItemClick(object sender, ItemClickEventArgs e)
        {
            Diagnosis selectedDiagnosis = bindingSourceDiagnosis.Current as Diagnosis;

            if (selectedDiagnosis.IsNull())
            {
                Extensions.Extensions.ObjectNotSelectedForEdit();
                return;
            }
            XtraFormDiagnosis formDiagnosis = new XtraFormDiagnosis(selectedDiagnosis);

            formDiagnosis.ShowDialog();
        }