Ejemplo n.º 1
0
        public async void GetControlRows()
        {
            try
            {
                InternalControlPerformRow cont;
                //await Dbcontext.OpenAsync();

                var result = Dbcontext.GetOfficeInternalControl("as12", "as12", "xxxyyyzzz", IniOfficeId, IniControlId);
                ObservableCollection <InternalControlPerformRow> temp = new ObservableCollection <InternalControlPerformRow>();

                if (result != null)
                {
                    ControlName = result.Name;

                    if (result.HasVehicleBrand == true)
                    {
                        VehicleIsVisible = true;
                    }
                    if (result.ControlRows != null && result.ControlRows.Length > 0)
                    {
                        foreach (var data in result.ControlRows)
                        {
                            cont = new InternalControlPerformRow();
                            cont.InternalControlOffieRowId = data.Id;
                            cont.Question                  = data.RowText;
                            cont.TextColor                 = Xamarin.Forms.Color.Gray;
                            cont.IndicatorColor            = Xamarin.Forms.Color.Gray;
                            cont.Group                     = data.Group;
                            cont.ErrorCodeMainGroups       = ErrorCodeMainGroups;
                            cont.AddErrorCodesIsVisible    = true;
                            cont.DeleteErrorCodesIsVisible = false;
                            cont.AddPhotoIsVisible         = true;
                            cont.DeletePhotoIsVisible      = false;
                            cont.AddedPhotos               = new ObservableCollection <Classes.Photo.PhotoCls>();
                            cont.IsClickabled              = true;
                            temp.Add(cont);
                        }
                    }
                }



                AllRows = new ObservableCollection <InternalControlPerformRow>(temp);
                IsBusy  = false;
            }
            catch (Exception e)
            {
                IsBusy = false;
                await Application.Current.MainPage.DisplayAlert("Fel", e.Message, "Stäng");
            }
        }