Beispiel #1
0
        private void barButtonItemDeleteDep_ItemClick(object sender, ItemClickEventArgs e)
        {
            Department department = bindingSourceDepartment.Current as Department;

            if (department.IsNull())
            {
                Extensions.Extensions.ObjectNotSelectedForDelete();
                return;
            }

            if (Extensions.Extensions.DeletingAlert(department.Name) != DialogResult.Yes)
            {
                return;
            }

            Extensions.Extensions.ShowWaitForm(description: "Departman siliniyor...");
            DepartmentSolClient client        = Extensions.Extensions.getDepartmentSolClient();
            ProcessResult       processResult = client.Delete(department.Id);

            SplashScreenManager.CloseForm(false);
            Extensions.Extensions.ProcessResultMessage(processResult.Errors, (int)processResult.Result);
            if (processResult.Result == ExtensionsBLLResult.Success)
            {
                RefreshData(1);
            }
        }
        private void XtraFormDoctorDetail_Load(object sender, EventArgs e)
        {
            DepartmentSolClient departmentSolClient = Extensions.Extensions.getDepartmentSolClient();

            departmentBindingSource.DataSource = departmentSolClient.Departments(true, false);
            departmentSolClient.Close();
            DegreeSolClient degreeSolClient = Extensions.Extensions.GetDegreeSolClient();

            degreeBindingSource.DataSource = degreeSolClient.Degrees(true);
            degreeSolClient.Close();
            bindingSourceMail.DataSource   = doctorMails;
            bindingSourcePhones.DataSource = doctorPhones;

            if (this.Text == "Doktor Detay")
            {
                barButtonItemCancelNewDoctor.Enabled = false;
                textEditMail.Visible         = false;
                textEditPhone.Visible        = false;
                simpleButtonNewMail.Visible  = false;
                simpleButtonNewPhone.Visible = false;
                labelControlMail.Visible     = false;
                LabelControlName.Visible     = false;
                this.Size = new Size(650, 513);
            }
        }
Beispiel #3
0
 private void XtraFormDiagnosis_Load(object sender, EventArgs e)
 {
     if (GlobalVariables.Departments.IsNull())
     {
         DepartmentSolClient client = Extensions.Extensions.getDepartmentSolClient();
         GlobalVariables.Departments = new List <Department>(client.Departments(true, false));
     }
     departmentBindingSource.DataSource = GlobalVariables.Departments;
 }
Beispiel #4
0
        public static void GetDepartments(bool refresh = false)
        {
            if (GlobalVariables.Departments.IsNotNull() && !refresh)
            {
                return;
            }

            DepartmentSolClient client = Extensions.Extensions.getDepartmentSolClient();

            GlobalVariables.Departments = client.Departments(true, true).ToList();
        }
Beispiel #5
0
        private void RefreshData(int i)
        {
            if (i == 0 || i == 1)
            {
                DepartmentSolClient client = Extensions.Extensions.getDepartmentSolClient();
                bindingSourceDepartment.DataSource = client.Departments(true, false).ToList();
                client.Close();
            }

            if (i == 0 || i == 2)
            {
                DegreeSolClient client1 = Extensions.Extensions.GetDegreeSolClient();
                bindingSourceDegree.DataSource = client1.Degrees(true);

                client1.Close();
            }
        }
Beispiel #6
0
        private void barButtonItemSave_ItemClick(object sender, ItemClickEventArgs e)
        {
            Extensions.Extensions.ShowWaitForm(description: "Departman kaydediliyor...");
            DepartmentSolClient client = Extensions.Extensions.getDepartmentSolClient();

            if (client == null)
            {
                return;
            }

            if (_department == null)
            {
                _department = new Department
                {
                    Name     = textEditName.Text,
                    IsActive = checkEditIsActive.Checked,
                    MinAge   = textEditMin.Text.ToNullableInt32(),
                    MaxAge   = Text.ToNullableInt32(),
                    Gender   = lookUpEditGender.EditValue as bool?
                };
            }
            else
            {
                _department.Name     = textEditName.Text;
                _department.IsActive = checkEditIsActive.Checked;
                _department.MinAge   = textEditMin.Text.ToNullableInt32();
                _department.MaxAge   = textEditMax.Text.ToNullableInt32();
                _department.Gender   = lookUpEditGender.EditValue as bool?;
            }

            ProcessResult processResult = update ? client.Update(_department) : client.Insert(_department);

            SplashScreenManager.CloseForm(false);
            Extensions.Extensions.ProcessResultMessage(processResult.Errors, (int)processResult.Result);
            if (processResult.Result == ExtensionsBLLResult.Success)
            {
                Close();
            }
        }
Beispiel #7
0
        public static DepartmentSolClient getDepartmentSolClient()
        {
            DepartmentSolClient client;

            try
            {
                client = new DepartmentSolClient(binding,
                                                 new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "DepartmentService.svc")));
                client.Select(-1);
            }
            catch (Exception)
            {
                bool b = Program.TestService();
                if (!b)
                {
                    Application.Exit();
                }
                client = new DepartmentSolClient(binding,
                                                 new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "DepartmentService.svc")));
            }

            return(client);
        }