コード例 #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.addcompliance_createlayout, null);

            checkBox1          = view.FindViewById <RadioButton>(Resource.Id.mandatory);
            checkBox2          = view.FindViewById <RadioButton>(Resource.Id.not);
            spinnerextension   = view.FindViewById <Spinner>(Resource.Id.spiner_format);
            spinnertype        = view.FindViewById <Spinner>(Resource.Id.spinner_type);
            Addtolist          = view.FindViewById <Button>(Resource.Id.btn_addtolist);
            complianceGridview = view.FindViewById <ScrollableListView>(Resource.Id.grid_compliance);
            max_number         = view.FindViewById <EditText>(Resource.Id.maxnumberedit);

            // modelsaddcompliance = new List<ComplianceJoinTable>();
            checkBox1.Click += RadioButtonClick;
            checkBox2.Click += RadioButtonClick;

            getfiletypemethodAsync();

            if (CreateTaskFrag.modelsaddcompliance.Count > 0)
            {
                gridattachmentlist         = new GridForAttachmentCreateReference(Activity, CreateTaskFrag.modelsaddcompliance);
                complianceGridview.Adapter = gridattachmentlist;
                gridattachmentlist.NotifyDataSetChanged();
            }

            Addtolist.Click += delegate
            {
                addtolistcompliance();
            };

            return(view);
        }
コード例 #2
0
        private void addtolistcompliance()
        {
            if (!max_number.Text.Equals(""))
            {
                max_numbers = Convert.ToInt32(max_number.Text);
            }
            if (compliancetype.Equals(""))
            {
                Toast.MakeText(Activity, "Please Select ComplianceType", ToastLength.Short).Show();
                return;
            }
            if (selecteditem.Equals(""))
            {
                Toast.MakeText(Activity, "Please Select FileType", ToastLength.Short).Show();
                return;
            }
            if (selectedextensions.Equals(""))
            {
                Toast.MakeText(Activity, "Please Select File Extension", ToastLength.Short).Show();
                return;
            }
            if (max_numbers <= 0)
            {
                Toast.MakeText(Activity, "Please Enter maximum number", ToastLength.Short).Show();
                return;
            }

            ComplianceJoinTable addtolistcompliace = new ComplianceJoinTable();

            addtolistcompliace.complianceType = compliancetype;
            addtolistcompliace.file_format    = selectedextensions;
            addtolistcompliace.file_type      = selecteditem;
            addtolistcompliace.max_numbers    = max_numbers;

            CreateTaskFrag.modelsaddcompliance.Add(addtolistcompliace);
            gridattachmentlist         = new GridForAttachmentCreateReference(Activity, CreateTaskFrag.modelsaddcompliance);
            complianceGridview.Adapter = gridattachmentlist;
            gridattachmentlist.NotifyDataSetChanged();

            //selecteditem = null;
            //selectedextensions = null;
            //max_num = null;
            //compliancetype = null;
        }
コード例 #3
0
        public void referencedata()
        {
            taskname.Text         = tasklist[pos].task_name;
            taskdescription.Text  = tasklist[pos].description;
            taskdeadlinedate.Text = tasklist[pos].task_creation_date;
            taskdeadlinetime.Text = tasklist[pos].time;
            if (tasklist[pos].addedcompliance != null)
            {
                for (int i = 0; i < tasklist[pos].addedcompliance.Count; i++)
                {
                    gridattachmentlist          = new GridForAttachmentCreateReference(Activity, tasklist[pos].addedcompliance);
                    complianceslistview.Adapter = gridattachmentlist;
                    gridattachmentlist.NotifyDataSetChanged();
                    complianceslistview.setExpanded(true);
                }
            }
            if (tasklist[pos].taskFileMappings != null)
            {
                for (int i = 0; i < tasklist[pos].taskFileMappings.Count; i++)
                {
                    if (tasklist[pos].taskFileMappings[i].FileType.Equals("Image"))
                    {
                        ImageView img = new ImageView(Activity);

                        Bitmap bitmap = BitmapFactory.DecodeFile(tasklist[pos].taskFileMappings[i].Path);

                        img.LayoutParameters = new LinearLayout.LayoutParams(200, 250);

                        img.SetX(10);
                        img.SetY(10);
                        //img.SetImageResource(Resource.Drawable.videofile);
                        img.SetImageBitmap(bitmap);
                        Linear1.AddView(img);
                    }


                    if (tasklist[pos].taskFileMappings[i].FileType.Equals("Video"))
                    {
                        ImageView img = new ImageView(Activity);

                        //Bitmap bitmap = BitmapFactory.DecodeFile(Mitems[i].taskFileMappings[i].localPath);

                        img.LayoutParameters = new LinearLayout.LayoutParams(200, 250);

                        img.SetX(10);
                        img.SetY(10);
                        img.SetImageResource(Resource.Drawable.videofile);
                        //img.SetImageBitmap(bitmap);
                        Linear2.AddView(img);
                    }


                    if (tasklist[pos].taskFileMappings[i].FileType.Equals("Audio"))
                    {
                        ImageView img = new ImageView(Activity);

                        //Bitmap bitmap = BitmapFactory.DecodeFile(Mitems[i].taskFileMappings[i].localPath);

                        img.LayoutParameters = new LinearLayout.LayoutParams(200, 250);

                        img.SetX(10);
                        img.SetY(10);
                        img.SetImageResource(Resource.Drawable.audiofile);
                        //img.SetImageBitmap(bitmap);
                        Linear3.AddView(img);
                    }
                }
            }
        }