Ejemplo n.º 1
0
        private void Button1_Click(object sender, System.EventArgs e)
        {
            pgsBar.Visibility = ViewStates.Visible;
            var intent = new Intent(this, typeof(TaskMenuActivity));


            TaskDownloader TaskDownloader = new TaskDownloader();

            ToDoListDLL.Users Current = TaskDownloader.GetCurrentUserAsync(login.Text, pwd.Text);

            if (Current == null)
            {
                pgsBar.Visibility = ViewStates.Gone;
                Toast.MakeText(this, "Wrong login or password ", ToastLength.Short).Show();
            }
            else
            {
                intent.PutExtra("UserID", Current.ID.ToString());
                // intent.PutExtra("Task", TasksSelectionned.ID.ToString());
                StartActivity(intent);
                Finish();
            }



            // StartActivity(intent);
        }
Ejemplo n.º 2
0
        private void Btn_del_Click(object sender, EventArgs e)
        {
            TaskDownloader TaskDownloader = new TaskDownloader();

            string id = Intent.Extras.GetString("TaskID");

            TaskDownloader.DeleteTasksAsync(id);
            var intent = new Intent(this, typeof(TaskTodoActivity));

            intent.PutExtra("UserID", userid);
            StartActivity(intent);
        }
Ejemplo n.º 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ActivityMyTaskTodo);

            userid = Intent.Extras.GetString("UserID");

            var lv_tasks = FindViewById <ListView>(Resource.Id.listViewMyTaskTodo);

            var btn_menu = FindViewById <Button>(Resource.Id.buttonBackToMenuMyTaskToDo);

            var btn_add = FindViewById <Button>(Resource.Id.buttonMyTaskToDoToAdd);

            btn_menu.Click += Btn_menu_Click;

            btn_add.Click += Btn_add_Click;

            TaskDownloader TaskDownloader = new TaskDownloader();


            tasksList = TaskDownloader.GetAllMyTasks(Intent.Extras.GetString("UserID")).ToList();

            var taskAdapter = new TaskAdapter(tasksList, this);

            lv_tasks.Adapter = taskAdapter;


            lv_tasks.ItemClick += (sender, e) =>
            {
                Tasks TasksSelectionned = tasksList[e.Position];



                var intent = new Intent(this, typeof(DetailTaskActivity));


                intent.PutExtra("TaskContent", TasksSelectionned.Note);
                intent.PutExtra("TaskDeadline", TasksSelectionned.DeadLine.ToString());
                intent.PutExtra("TaskID", TasksSelectionned.ID.ToString());
                intent.PutExtra("Task", TasksSelectionned.ID.ToString());
                intent.PutExtra("UserID", userid);
                intent.PutExtra("TaskState", taskstate);

                StartActivity(intent);
            };

            // Create your application here
        }
Ejemplo n.º 4
0
        private void Btn_edit_Click(object sender, EventArgs e)
        {
            pgsBar.Visibility = ViewStates.Visible;
            TaskDownloader TaskDownloader = new TaskDownloader();
            Tasks          s = TaskDownloader.GetTasks(id);

            s.Note     = taskdetailcontent.Text;
            s.DeadLine = dl;
            RadioButton radioButton = FindViewById <RadioButton>(rdgroup.CheckedRadioButtonId);

            s.TaskState = radioButton.Text;
            TaskDownloader.EditTaskAsync(s);

            var intent = new Intent(this, typeof(TaskTodoActivity));

            intent.PutExtra("UserID", userid);
            StartActivity(intent);
        }
Ejemplo n.º 5
0
        private void Button1_Click(object sender, EventArgs e)
        {
            var intent = new Intent(this, typeof(TaskTodoActivity));

            intent.PutExtra("addedtaskscontent", contentTask.Text);
            intent.PutExtra("addedtasksdeadline", _dateDisplay.Text);
            intent.PutExtra("UserID", userid);

            TaskDownloader TaskDownloader = new TaskDownloader();


            ToDoListDLL.Tasks t = new ToDoListDLL.Tasks();
            t.Note = contentTask.Text;
            RadioButton radioButton = FindViewById <RadioButton>(rdgroup.CheckedRadioButtonId);

            t.TaskState     = radioButton.Text;
            t.IDUserCreator = int.Parse(userid);

            t.IDUserCreator = int.Parse(userid);
            DateTime date = new DateTime(2011, 2, 19);

            date.ToString("s");
            t.CreateDate = DateTime.Now;
            DateTime test;

            if (DateTime.TryParse(_dateDisplay.Text, out test))
            {
                t.DeadLine = DateTime.Parse(_dateDisplay.Text);
            }
            else
            {
                t.DeadLine = DateTime.Now;
            }

            // t.DeadLine = _dateDisplay.Text;

            TaskDownloader.AddTasksAsync(t);

            intent.PutExtra("UserID", userid);
            StartActivity(intent);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.ActivityTaskTodo);
            userid = Intent.Extras.GetString("UserID");

            var lv_tasks = FindViewById <ListView>(Resource.Id.listViewTaskTodo);

            var btn_menu = FindViewById <Button>(Resource.Id.buttonBackToMenuToDo);

            var btn_add = FindViewById <Button>(Resource.Id.buttonToDoToAdd);

            btn_menu.Click += Btn_menu_Click;

            btn_add.Click += Btn_add_Click;

            //    var swipeRefresh = FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayoutTasks);


            // swipeRefresh.Refresh += async (sender, e) =>
            // {
            //    swipeRefresh.Refreshing = true;

            //var newArticles = await rssDownloader.Get(url);
            // lv_tasks.Adapter = new TaskAdapter( newArticles,this);

            //    swipeRefresh.Refreshing = false;
            //   };

            TaskDownloader TaskDownloader = new TaskDownloader();


            tasksList = TaskDownloader.GetTodoAllTasks().ToList();



            //foreach(Tasks s in tall)
            //{
            //    tasksList.Add(s);
            //}

            // progressbar.Visibility = ViewStates.Gone;

            var taskAdapter = new TaskAdapter(tasksList, this);

            lv_tasks.Adapter = taskAdapter;
            // tasksList.Add(new Tasks(Intent.Extras.GetString("addedtaskscontent")));



            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));
            //tasksList.Add(new Tasks("hsdlhfklsdhkf"));

            // var taskAdapter = new TaskAdapter( tasksList, this);
            //lv_tasks.Adapter = taskAdapter;


            lv_tasks.ItemClick += (sender, e) =>
            {
                Tasks TasksSelectionned = tasksList[e.Position];



                var intent = new Intent(this, typeof(DetailTaskActivity));


                intent.PutExtra("TaskContent", TasksSelectionned.Note);
                intent.PutExtra("TaskDeadline", TasksSelectionned.DeadLine.ToString());
                intent.PutExtra("TaskID", TasksSelectionned.ID.ToString());
                intent.PutExtra("Task", TasksSelectionned.ID.ToString());
                intent.PutExtra("UserID", userid);
                intent.PutExtra("TaskState", taskstate);

                StartActivity(intent);
            };


            // Create your application here
        }