示例#1
0
        private async Task ExecuteLoadCommand()
        {
            try
            {
                IsBusy = true;

                if (IsNetworkConnected)
                {
                    EmployeeList.Clear();
                    var items = await ServiceHandler.ProcessRequestCollectionAsync <Employee>(Constants.Employee);

                    foreach (var item in items)
                    {
                        EmployeeList.Add(item);
                    }                      //Server Call
                    IsBusy = false;
                }
                else
                {
                    _employeeList = App.DataBase.GetItems <Employee>();                    //From Local DB
                    IsBusy        = false;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("An Exception Occured During Save Record {0}", ex.Message);
            }
        }
示例#2
0
        public async void ExecuteLoadEmployeeCommand()

        {
            try

            {
                EmployeeList.Clear();

                var employees = await DataStoreEmp.GetAllAsync();

                foreach (var item in employees)

                {
                    EmployeeList.Add(item);
                }

                int nb = EmployeeList.Count;
            }

            catch (Exception ex)

            {
                Debug.WriteLine(ex);
            }
        }
示例#3
0
        private async Task Search()
        {
            string responseResult   = string.Empty;
            string requestParamJson = string.Empty;

            EmployeeList.Clear();
            EmployeeList.AddRange(await ResourceService.GetInstance().GetResources <Employee>(), System.Collections.Specialized.NotifyCollectionChangedAction.Reset);
        }
示例#4
0
 private void DoRetreive()
 {
     EmployeeList.Clear();
     foreach (var employee in Dal.GetEmployees())
     {
         EmployeeList.Add(employee);
     }
 }
示例#5
0
        public async void GetData()
        {
            EmployeeList.Clear();
            var emplist = await DataStoreEmp.GetAllAsync();

            foreach (Employee e in emplist)
            {
                EmployeeList.Add(e);
            }
        }
示例#6
0
        private async Task LoadEmployee(string departmentIDList)
        {
            await repoEmployeeRepository.GetAsync(departmentIDList);

            EmployeeList.Clear();
            foreach (var item in repoEmployeeRepository.Items)
            {
                EmployeeList.Add(item);
            }
        }
        private void LoadEmployees()
        {
            dgProductPlacements.Columns.Clear();
            EmployeeList.Clear();
            MyList.Clear();
            ProductPlacementList.Clear();
            SelectedProducts.Clear();

            foreach (Employee e in EmployeeManagement.Instance.GetEmployeeAtributes(DepartmentID))
            {
                m_EmployeeList.Add(e);
            }

            CreateRow();
            LoadExistingPlacements();
        }
示例#8
0
        private async Task Search()
        {
            string responseResult   = string.Empty;
            string requestParamJson = string.Empty;

            Dictionary <string, string> requestDic = new Dictionary <string, string>();

            requestDic.Add("USP", "{? = call usp_get_emp_json(?)}"); //프로시저
            requestDic.Add("p_emp_nm", "");                          //프로시저 파라미터와 동일하게

            responseResult = await BaseHttpService.Instance.SendRequestAsync(HttpCommand.GET, requestDic);

            //EmployeeList = new ObservableCollection<Employee>(JsonConvert.DeserializeObject<List<Employee>>(responseResult));

            EmployeeList.Clear();
            EmployeeList.AddRange(JsonConvert.DeserializeObject <List <Employee> >(responseResult), System.Collections.Specialized.NotifyCollectionChangedAction.Reset);
        }
示例#9
0
        public void FillEmployeeGrid()
        {
            if (EmployeeList.Count() > 0)
            {
                EmployeeList.Clear();
            }
            using (var db = new DataSmartDBContext())
            {
                var emp = db.Employee.ToList();

                if (emp != null)
                {
                    foreach (var d in emp)
                    {
                        EmployeeList.Add(d);
                    }
                }
            }
        }
示例#10
0
        public async Task ExecuteLoadItemsCommand()

        {
            try

            {
                EmployeeList.Clear();


                var employees = await DataStoreEmp.GetAllAsync();

                foreach (var item in employees)

                {
                    EmployeeList.Add(item);
                }



                int nb = EmployeeList.Count;

                Console.WriteLine("Employee Number=  " + nb);
            }

            catch (Exception ex)

            {
                Debug.WriteLine(ex);
            }

            finally

            {
                IsBusy = false;
            }
        }
示例#11
0
        static public void SearchEmployee(ComboBox box, TextBox search, HairSpaContext context)
        {
            IQueryable <Employee> list = null;

            EmployeeList.Clear();

            switch (box.SelectedItem)
            {
            case "Id":
                list = context.Employees.Where(emp => emp.Id.ToString().Contains(search.Text));
                break;

            case "First Name":
                list = context.Employees.Where(emp => emp.FirstName.Contains(search.Text));
                break;

            case "Last Name":
                list = context.Employees.Where(emp => emp.LastName.Contains(search.Text));
                break;

            case "Address":
                list = context.Employees.Where(emp => emp.Address.Contains(search.Text));
                break;

            case "City":
                list = context.Employees.Where(emp => emp.City.Contains(search.Text));
                break;

            case "State":
                list = context.Employees.Where(emp => emp.State.Contains(search.Text));
                break;

            case "Job Title":
                list = context.Employees.Where(emp => emp.JobTitle.Contains(search.Text));
                break;

            case "Status Number":
                list = context.Employees.Where(emp => emp.Status.ToString().Contains(search.Text));
                break;

            default:
                break;
            }

            try
            {
                if (list.ToList().Count <= 0)
                {
                    MessageBox.Show("No records were found", "No Results");
                    return;
                }
                else
                {
                    list.ToList().ForEach(emp => EmployeeList.Add(emp));
                }
            }
            catch (Exception)
            {
                MessageBox.Show("No records were found", "No Results");
                return;
            }
        }