Пример #1
0
        void CreateButton_OnClick(object sender, EventArgs eventArgs)
        {
            name    = task_name.Text;
            comment = task_comment.Text;
            if (task_name.Text.Length >= 5 && task_comment.Text.Length >= 10 && date != null && time1 != null)
            {
                //  db.Insert_InitialTask1(name, comment, date, time1);
                Fragment frag = new Assign();

                FragmentTransaction ft = FragmentManager.BeginTransaction();
                ft.Replace(Resource.Id.container, frag);
                ft.AddToBackStack(null);
                ft.Commit();
            }
            else if (task_name.Text.Length == 0)
            {
                Toast.MakeText(Activity, "Please Fill Task name", ToastLength.Long).Show();
                return;
            }
            else if (task_name.Text.Length < 5)
            {
                Toast.MakeText(Activity, "Task name should be more than 5 characters", ToastLength.Long).Show();
            }
            else if (task_comment.Text.Length < 10)
            {
                Toast.MakeText(Activity, "Task description should be more than 10 characters", ToastLength.Long).Show();
            }
            else if (task_comment.Text.Length == 0)
            {
                Toast.MakeText(Activity, "Please fill task description", ToastLength.Long).Show();
            }
            else if (_dateDisplay.Text.Equals("Select Date") || date == null)
            {
                Toast.MakeText(Activity, "Please Select Date", ToastLength.Long).Show();
            }
            else if (timeDisplay.Text.Equals("Select Time") || time1 == null)
            {
                Toast.MakeText(Activity, "Please Select Time", ToastLength.Long).Show();
            }
        }
        private void Assignbtn_Click(object sender, EventArgs e)
        {
            Fragment frag = new Assign();

            FragmentManager.BeginTransaction().Replace(Resource.Id.container, frag).Commit();
        }