private void getSubjectsInquirers()
        {
            ShowBusyIndicator("در حال بارگذاری اطلاعات");
            employeeService.GetAllEmployees(
                (res, exp) => appController.BeginInvokeOnDispatcher(() =>
            {
                HideBusyIndicator();
                if (exp == null)
                {
                    Inquirers.TotalItemCount   = res.TotalCount;
                    Inquirers.PageIndex        = Math.Max(0, res.CurrentPage - 1);
                    Inquirers.SourceCollection = res.Result;
                }
                else
                {
                    appController.HandleException(exp);
                }
            }), Period.Id, EmployeeCriteria, Inquirers.PageSize, Inquirers.PageIndex + 1);



            //unitInPeriodService.GetInquirySubjectWithInquirers((res, exp) => appController.BeginInvokeOnDispatcher(() =>
            //{
            //    HideBusyIndicator();
            //    if (exp == null)
            //    {
            //        employeeService.GetAllEmployees((employeeRes, employeeExp) => appController.BeginInvokeOnDispatcher(() =>
            //        {

            //            if (employeeExp == null)
            //            {
            //                Employees = employeeRes;
            //                Inquirers=new List<InquirerDTO>();
            //                Employees.ForEach(c=>Inquirers.Add(new InquirerDTO()
            //                {
            //                    EmployeeNo = c.PersonnelNo,
            //                    FullName = c.FullName
            //                }));

            //                //InquirySubjectWithInquirers =
            //                //    res.Select(i => new InquirySubjectInquirersUnitViewModel(unitInPeriodService, appController, employeeService)
            //                //    {
            //                //        Period = Period,
            //                //        UnitInPeriodDto = UnitInPeriod,
            //                //        SelectedInquirySubjectWithInquirers = i,
            //                //        Employees =
            //                //            employeeRes.Where(e => !(i.Inquirers.Select(j => j.EmployeeNo).Contains(e.PersonnelNo))).ToList()
            //                //    }).ToList();
            //            }
            //            else
            //                appController.HandleException(employeeExp);
            //        }), Period.Id);
            //    }
            //    else
            //        appController.HandleException(exp);
            //}), Period.Id, unitInPeriod.UnitId);
        }
Exemple #2
0
 public void Load(PeriodDTO periodParam)
 {
     period      = periodParam;
     DisplayName = EmployeeMgtAppLocalizedResources.EmployeeListPageTitle + " " + "دوره" + " " + period.Name;
     ShowBusyIndicator("در حال دریافت اطلاعات...");
     employeeService.GetAllEmployees(
         (res, exp) => appController.BeginInvokeOnDispatcher(() =>
     {
         HideBusyIndicator();
         if (exp == null)
         {
             employees.SourceCollection = res.Result;
             employees.TotalItemCount   = res.TotalCount;
             employees.PageIndex        = Math.Max(0, res.CurrentPage - 1);
         }
         else
         {
             appController.HandleException(exp);
         }
     }), period.Id, employees.PageSize, employees.PageIndex + 1);
 }
Exemple #3
0
        private void searchEmployee()
        {
            ShowBusyIndicator("در حال دریافت اطلاعات...");
            employeeService.GetAllEmployees(
                (res, exp) => appController.BeginInvokeOnDispatcher(() =>
            {
                HideBusyIndicator();
                if (exp == null)
                {
                    appController.BeginInvokeOnDispatcher(() =>
                    {
                        Employees.TotalItemCount = res.TotalCount;
                        Employees.PageIndex      = Math.Max(0, res.CurrentPage - 1);

                        Employees.SourceCollection = res.Result.ToList();
                    });
                }
                else
                {
                    appController.HandleException(exp);
                }
            }), Calculation.PeriodId, EmployeeCriteria, employees.PageSize, employees.PageIndex + 1);
        }
Exemple #4
0
 private void getAllEmployee()
 {
     ShowBusyIndicator("در حال بارگذاری اطلاعات");
     employeeService.GetAllEmployees(
         (res, exp) => appController.BeginInvokeOnDispatcher(() =>
     {
         HideBusyIndicator();
         if (exp == null)
         {
             Employees.TotalItemCount   = res.TotalCount;
             Employees.PageIndex        = Math.Max(0, res.CurrentPage - 1);
             Employees.SourceCollection = res.Result;
         }
         else
         {
             appController.HandleException(exp);
         }
     }), Period.Id, EmployeeCriteria, Employees.PageSize, Employees.PageIndex + 1);
 }
        //private void preLoad()
        //{

        //}

        private void getSubjectsInquirers()
        {
            ShowBusyIndicator("در حال بارگذاری اطلاعات");
            jobPositionInPeriodService.GetInquirySubjectWithInquirers((res, exp) => appController.BeginInvokeOnDispatcher(() =>
            {
                HideBusyIndicator();
                if (exp == null)
                {
                    //InquirySubjectWithInquirers = res;
                    //SelectedInquirySubjectWithInquirers = res.First();
                    //employeeService.GetAllEmployees((employeeRes, employeeExp) =>  appController.BeginInvokeOnDispatcher(() =>
                    employeeService.GetAllEmployees((employeeRes, employeeExp) => appController.BeginInvokeOnDispatcher(() =>
                    {
                        if (employeeExp == null)
                        {
                            InquirySubjectWithInquirers =
                                res.Select(i => new InquirySubjectInquirersViewModel(jobPositionInPeriodService, appController, employeeService)
                            {
                                Period = Period,
                                JobPositionInPeriod = JobPositionInPeriod,
                                SelectedInquirySubjectWithInquirers = i,
                                Employees =
                                    employeeRes.Where(e => !(i.Inquirers.Select(j => j.EmployeeNo).Contains(e.PersonnelNo))).ToList()
                            }).ToList();
                        }
                        else
                        {
                            appController.HandleException(employeeExp);
                        }
                    }), Period.Id);
                }
                else
                {
                    appController.HandleException(exp);
                }
            }), Period.Id, jobPositionInPeriod.JobPositionId);
        }