예제 #1
0
        void EditUserButton_Click(object sender, EventArgs e)
        {
            FragmentTransaction trans = this.ParentActivity.SupportFragmentManager.BeginTransaction();
            //Employee employee = employeesAdapter[pos];
            // add some arguments to our fragment for onCreateView
            Bundle employeeBundle = new Bundle();
            employeeBundle.PutString("EmployeeName", this.CurrentEmployee.Name);
            employeeBundle.PutString("EmployeeID", this.CurrentEmployee.Number);
            EditEmployeeFragment editEmployeeDialog = new EditEmployeeFragment(position, employeeBundle);

            editEmployeeDialog.Show(trans, "EditEmployee");
            Dismiss();
        }
        public bool OnSingleTapUp(MotionEvent e)
        {
            int pos = listView.PointToPosition((int)e.GetX(), (int)e.GetY());

            if (EmployeeCheck(pos) && _isEditing == false)
            {
                    Employee employee = employeesAdapter[pos];
                    var employeeCall = new Intent(this, typeof(EmployeeLogsActivity));
                    employeeCall.PutExtra("EmployeeNumber", employee.Number);
                    StartActivity(employeeCall);
            }
            else
            {
                if (_isEditing)
                {
                    FragmentTransaction trans = this.SupportFragmentManager.BeginTransaction();
                    Employee employee = employeesAdapter[pos];
                    // add some arguments to our fragment for onCreateView
                    Bundle employeeBundle = new Bundle();
                    employeeBundle.PutString("EmployeeName", employee.Name);
                    employeeBundle.PutString("EmployeeID", employee.Number);
                    EditEmployeeFragment editEmployeeDialog = new EditEmployeeFragment(pos, employeeBundle);
                    editEmployeeDialog.Show(trans, "EditEmployee");
                }
            }
            return true;
        }