void ReleaseDesignerOutlets()
        {
            if (AddCustomer != null)
            {
                AddCustomer.Dispose();
                AddCustomer = null;
            }

            if (Camera != null)
            {
                Camera.Dispose();
                Camera = null;
            }

            if (EmployeesTableView != null)
            {
                EmployeesTableView.Dispose();
                EmployeesTableView = null;
            }

            if (NavigationItem != null)
            {
                NavigationItem.Dispose();
                NavigationItem = null;
            }
        }
Ejemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            this.NavigationController.NavigationBar.BarTintColor = UIColor.FromRGB(0, 134, 255);
            this.NavigationController.NavigationBar.TintColor    = UIColor.White;

            var listOfCustomersAsJsonString = File.ReadAllText(mFilename);

            if (listOfCustomersAsJsonString == null)
            {
                mCustomers = new List <Customer>();
            }
            else
            {
                mCustomers = JsonConvert.DeserializeObject <List <Customer> >(listOfCustomersAsJsonString);
            }

            if (mCustomers == null)
            {
                mCustomers = new List <Customer>();
            }


            EmployeesTableView.Source = new EmployeesTableViewSource(mCustomers, this.Storyboard, this);

            //   EmployeesTableView.Source = new EmployeesTableViewSource(mCustomers);

            EmployeesTableView.RowHeight          = UITableView.AutomaticDimension;
            EmployeesTableView.EstimatedRowHeight = 100f;
            EmployeesTableView.ReloadData();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var employees = new List <Employee>
            {
                new Employee
                {
                    Fullname    = "Ahmed",
                    Department  = "Finance",
                    Description = "Controlling expenditures and obligations (including operating expenses, debt, payroll) receipting and depositing all revenues"
                },
                new Employee
                {
                    Fullname    = "Khaled",
                    Department  = "Accounting",
                    Description = "Recording and reporting the cash flow transactions of a company"
                },
                new Employee
                {
                    Fullname    = "Hassen",
                    Department  = "Legal",
                    Description = "Contract management, real estate transactions, customer claims against the company for product damages and defects, litigation, employment law"
                },
                new Employee
                {
                    Fullname    = "Nader",
                    Department  = "Marketing",
                    Description = "Create an overarching image that represents your company in a positive light"
                },
                new Employee
                {
                    Fullname    = "Seif",
                    Department  = "Sales",
                    Description = "Engage in a variety of activities with the objective to promote the customer purchase of a product"
                },
                new Employee
                {
                    Fullname    = "Adam",
                    Department  = "HR",
                    Description = "Responsible for payroll, hiring and firing of employees, explaining and handling benefits"
                },
            };

            EmployeesTableView.Source = new EmployeesTVS(employees);

            EmployeesTableView.RowHeight          = UITableView.AutomaticDimension;
            EmployeesTableView.EstimatedRowHeight = 40f;
            EmployeesTableView.ReloadData();
        }
Ejemplo n.º 4
0
        void AddClicked(NSButton sender)
        {
            Console.WriteLine("EVC Add clicked");
            Employee emp = new Employee();

            DataStore.AddItem <Employee>(emp);
            emp.SetFirstName("New");
            emp.SetLastName("Employee");
            EmployeesTableView.ReloadData();

            // Start editing new item
            int row = DataStore.Employees.IndexOf(emp);

            EmployeesTableView.SelectRow(row, false);
            EmployeesTableView.EditColumn(0, row, null, true);
        }
Ejemplo n.º 5
0
        void ReleaseDesignerOutlets()
        {
            if (AddCustomer != null)
            {
                AddCustomer.Dispose();
                AddCustomer = null;
            }

            if (Camera != null)
            {
                Camera.Dispose();
                Camera = null;
            }

            if (EmployeesTableView != null)
            {
                EmployeesTableView.Dispose();
                EmployeesTableView = null;
            }

            if (mFullUpdateDateText != null)
            {
                mFullUpdateDateText.Dispose();
                mFullUpdateDateText = null;
            }

            if (NavigationItem != null)
            {
                NavigationItem.Dispose();
                NavigationItem = null;
            }

            if (RefreshBtn != null)
            {
                RefreshBtn.Dispose();
                RefreshBtn = null;
            }
        }
Ejemplo n.º 6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            var employees = new List <Employee>
            {
                new Employee {
                    FullName    = "Ahmed",
                    Department  = "Finance",
                    Description = "Controlling expenditures and obligations(including operations)"
                },
                new Employee {
                    FullName    = "Mehmed",
                    Department  = "Accounting",
                    Description = "Controlling expenditures and obligations(including operations)"
                },
                new Employee {
                    FullName    = "Hasan",
                    Department  = "Legal",
                    Description = "Controlling expenditures and obligations(including operations)"
                },
                new Employee {
                    FullName    = "Mazlum",
                    Department  = "IT",
                    Description = "Controlling expenditures and obligations(including operations)"
                },
                new Employee {
                    FullName    = "Mekin",
                    Department  = "Sales",
                    Description = "Controlling expenditures and obligations(including operations)"
                }
            };

            EmployeesTableView.Source             = new EmployeeTVS(employees);
            EmployeesTableView.RowHeight          = UITableView.AutomaticDimension;
            EmployeesTableView.EstimatedRowHeight = 60f;
            EmployeesTableView.ReloadData();
        }
Ejemplo n.º 7
0
        void RemoveClicked(NSButton sender)
        {
            Console.WriteLine("EVC Remove clicked");
            if (!StopEditing() || EmployeesTableView.SelectedRow < 0)
            {
                AppKitFramework.NSBeep();
                return;
            }

            Employee emp = DataStore.Employees[(int)EmployeesTableView.SelectedRow];

            foreach (Department dep in DataStore.Departments)
            {
                if (dep.Manager == emp.ID)
                {
                    dep.ManagerName = "";
                }
            }

            DataStore.RemoveItem(emp);
            EmployeesTableView.DeselectAll(this);
            EmployeesTableView.ReloadData();
        }
Ejemplo n.º 8
0
 public override void ViewWillAppear()
 {
     base.ViewWillAppear();
     IsViewReady = true;
     EmployeesTableView.ReloadData();
 }