Exemple #1
0
        public Screen3Entry(Activity context, PointDto point)
            : base(context, Resource.Layout.Edit3Entry, point)
        {
            if (View == null)
                return;

            PointPart3Entry item = Point.PointDataDto.PointPart3Entry;

            var awning = View.FindViewById<CheckBox>(Resource.Id.awning);
            var doorMarks = View.FindViewById<CheckBox>(Resource.Id.doorMarks);
            var doorWidth = View.FindViewById<CheckBox>(Resource.Id.doorWidth);
            var handle = View.FindViewById<CheckBox>(Resource.Id.handle);
            var invalidEntry = View.FindViewById<CheckBox>(Resource.Id.invalidEntry);
            var rampNeeded = View.FindViewById<CheckBox>(Resource.Id.rampNeeded);
            var rampNotNeeded = View.FindViewById<CheckBox>(Resource.Id.rampNotNeeded);
            var rampType = View.FindViewById<CheckBox>(Resource.Id.rampType);
            var threshold = View.FindViewById<CheckBox>(Resource.Id.threshold);

            awning.Checked = item.Awning;
            doorMarks.Checked = item.DoorMarks;
            doorWidth.Checked = item.DoorWidth;
            invalidEntry.Checked = item.InvalidEntry;
            rampNeeded.Checked = item.RampNeeded;
            handle.Checked = item.Handle;
            rampNotNeeded.Checked = item.RampNotNeeded;
            rampType.Checked = item.RampType;
            threshold.Checked = item.Threshold;
        }
Exemple #2
0
        public Screen4Lobby(Activity context, PointDto point)
            : base(context, Resource.Layout.Edit4Lobby, point)
        {
            PointPart4Lobby item = Point.PointDataDto.PointPart4Lobby;

            View.FindViewById<CheckBox>(Resource.Id.doorWeight).Checked = item.DoorWeight;
            View.FindViewById<CheckBox>(Resource.Id.entryPost).Checked = item.EntryPost;
            View.FindViewById<CheckBox>(Resource.Id.SoundAmplifyingEquipment).Checked = item.SoundAmplifyingEquipment;
            View.FindViewById<CheckBox>(Resource.Id.floor).Checked = item.Floor;
            View.FindViewById<CheckBox>(Resource.Id.invalidManeuver).Checked = item.InvalidManeuver;
            View.FindViewById<CheckBox>(Resource.Id.invalidMove).Checked = item.InvalidMove;
            var liftCheckBox = View.FindViewById<CheckBox>(Resource.Id.lift);
            liftCheckBox.Checked = item.Lift;
            View.FindViewById<CheckBox>(Resource.Id.liftBrail).Checked = item.LiftBrail;
            View.FindViewById<CheckBox>(Resource.Id.liftDepth).Checked = item.LiftDepth;
            View.FindViewById<CheckBox>(Resource.Id.liftDoorWeight).Checked = item.LiftDoorWeight;
            View.FindViewById<CheckBox>(Resource.Id.liftWight).Checked = item.LiftWight;
            View.FindViewById<CheckBox>(Resource.Id.noSteps).Checked = item.NoSteps;
            View.FindViewById<CheckBox>(Resource.Id.noThresholds).Checked = item.NoThresholds;
            View.FindViewById<CheckBox>(Resource.Id.riffleSurface).Checked = item.RiffleSurface;
            View.FindViewById<CheckBox>(Resource.Id.stepsHaveRamp).Checked = item.StepsHaveRamp;
            View.FindViewById<CheckBox>(Resource.Id.liftBrail).Enabled = liftCheckBox.Checked;
            View.FindViewById<CheckBox>(Resource.Id.liftDepth).Enabled = liftCheckBox.Checked;
            View.FindViewById<CheckBox>(Resource.Id.liftDoorWeight).Enabled = liftCheckBox.Checked;
            View.FindViewById<CheckBox>(Resource.Id.liftWight).Enabled = liftCheckBox.Checked;
            View.FindViewById<CheckBox>(Resource.Id.lift).CheckedChange += Screen4Lobby_CheckedChange;
        }
        public Screen7Summary(Activity context, PointDto point)
            : base(context, Resource.Layout.Edit7Summary, point)
        {
            PointPart7Summary item = Point.PointDataDto.PointPart7Summary;

            invalidMoveAvailable = View.FindViewById<Spinner>(Resource.Id.invalid_move_availability);
            invalidHearingAvailable = View.FindViewById<Spinner>(Resource.Id.invalid_hearing_availability);
            invalidEyeAvailable = View.FindViewById<Spinner>(Resource.Id.invalid_eye_availability);
            otherText = View.FindViewById<EditText>(Resource.Id.otherComments);
            reportDate = View.FindViewById<EditText>(Resource.Id.protocolDate);

            invalidMoveAvailable.Adapter = new BoolSpinnerAdapter(context, "ќбъект доступен",
                                                                  "ќбъект не доступен (если нет пандуса, не соответствует ширина проемов, высота порогов)");
            invalidHearingAvailable.Adapter = new BoolSpinnerAdapter(context, "ќбъект доступен",
                                                                     "ќбъект не доступен (если отсутствуют световые табло, индукционна¤ петл¤)");
            invalidEyeAvailable.Adapter = new BoolSpinnerAdapter(context, "ќбъект доступен",
                                                                 "ќбъект не доступен (если отсутствуют тактильные маршруты, звуковое оповещение, контрастна¤ маркировка дверей и стекл¤нных поверхностей)");

            reportDate.Text = item.ReportDate.ToLocalTime().Date.ToString(CultureInfo.CurrentCulture);

            invalidMoveAvailable.SetSelection(BoolSpinnerAdapter.SetPositionOf(item.InvalidMoveAvailability));
            invalidHearingAvailable.SetSelection(BoolSpinnerAdapter.SetPositionOf(item.InvalidHearingAvailability));
            invalidEyeAvailable.SetSelection(BoolSpinnerAdapter.SetPositionOf(item.InvalidEyeAvailability));

            otherText.Text = item.OtherComments;
        }
Exemple #4
0
        public PointDto ToDto()
        {
            var pointDto = new PointDto
                {
                    Id = Id,
                    Name = Name,
                    Category = CategoryId
                };

            pointDto.PointDataDto.FromJson(JObject.Parse(PointData));
            return pointDto;
        }
        public Screen6Hygiene(Activity context, PointDto point)
            : base(context, Resource.Layout.Edit6Hygiene, point)
        {
            PointPart6Hygiene item = Point.PointDataDto.PointPart6Hygiene;

            View.FindViewById<CheckBox>(Resource.Id.wc).Checked = item.Wc;
            View.FindViewById<CheckBox>(Resource.Id.wc_doors_out).Checked = item.WcDoorsOut;
            View.FindViewById<CheckBox>(Resource.Id.wc_inner_handles).Checked = item.WcInnerHandles;
            View.FindViewById<CheckBox>(Resource.Id.wc_invalid).Checked = item.WcInvalid;
            View.FindViewById<CheckBox>(Resource.Id.wc_invalid_signs).Checked = item.WcInvalidSigns;
            View.FindViewById<CheckBox>(Resource.Id.wc_universal).Checked = item.WcUniversal;
        }
Exemple #6
0
 protected BaseScreen(Activity context, int viewResourseId, PointDto point)
 {
     Point = point;
     try
     {
         View = context.LayoutInflater.Inflate(viewResourseId, null);
     }
     catch (Throwable t)
     {
         MessageBox.ShowMessage("ќшибка при построени " + GetType().Name + ": " + t.LocalizedMessage, context);
     }
 }
Exemple #7
0
        public Screen5Info(Activity context,  PointDto point)
            : base(context, Resource.Layout.Edit5Info, point)
        {
            PointPart5Info item = Point.PointDataDto.PointPart5Info;

            View.FindViewById<CheckBox>(Resource.Id.evacuation).Checked = item.Evacuation;
            View.FindViewById<CheckBox>(Resource.Id.infoLuminance).Checked = item.InfoLuminance;
            View.FindViewById<CheckBox>(Resource.Id.infoSigns).Checked = item.InfoSigns;
            View.FindViewById<CheckBox>(Resource.Id.infoVoice).Checked = item.InfoVoice;
            View.FindViewById<CheckBox>(Resource.Id.infoWeight).Checked = item.InfoWeight;

        }
Exemple #8
0
        public Screen1Main(EditItemMainActivity context, PointDto point)
            : base(context, Resource.Layout.Edit1Main, point)
        {
            this.context = context;
            if (View == null)
                return;

            name = View.FindViewById<EditText>(Resource.Id.nameText);
            address = View.FindViewById<EditText>(Resource.Id.addressText);
            category = View.FindViewById<Spinner>(Resource.Id.category);
            photo = View.FindViewById<ImageView>(Resource.Id.photo);
            loadPhotoButton = View.FindViewById<Button>(Resource.Id.loadPhotoButton);

            //adapter = new SmartEnumAdapter<PointDto.CategoryType>(CategoriesHelper.GetName, context);
            //var list = typeof(PointDto.CategoryType);
            //var list = PointDto.EnumValues;
            //var list1 = (from object s in list select CategoriesHelper.GetName((PointDto.CategoryType)s)).ToList();
            var list1 = new List<string>
                {
                    "Административные объекты",
                    "Коммерческие объекты",
                    "Офисные объекты",
                    "Медицинские объекты",
                    "Объекты культуры",
                    "Сфера услуг",
                    "Объекты питания",
                    "Спортивные объекты",
                    "Образование",
                    "Иные объекты "
                };
            adapter = new ArrayAdapter<string>(context, Android.Resource.Layout.SimpleSpinnerItem, list1);
            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            category.Adapter = adapter;

            photo.Touch += photo_Touch;
            loadPhotoButton.Click += loadPhotoButton_Click;

            //adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);


            name.Text = Point.Name;
            address.Text = Point.PointDataDto.Address;

            if (point.Id == 0)
            {
                loadPhotoButton.Visibility = ViewStates.Invisible;
            }
            else
            {
                photo.Visibility = ViewStates.Invisible;
            }
        }
Exemple #9
0
 public override void FromJson(JObject obj)
 {
     JProperty jProperty = obj.Property("Points");
     var val = (JArray) jProperty.Value;
     var ps = new List<PointDto>();
     foreach (JObject jObj in val)
     {
         var point = new PointDto();
         point.FromJson(jObj);
         ps.Add(point);
     }
     Points = ps.ToArray();
     Message = (string) obj.Property("Message").Value;
 }
Exemple #10
0
        public static StringResultDto RemovePoint(PointDto point)
        {
            WebRequest request = WebRequest.Create(GlobalContants.ServerPath + "PointManager.asmx/RemovePoint");

            var input = new EditPointDto
                {
                    Auth = AuthData.AuthResult,
                    Point = point
                };

            CommonHelper.PrepareRequest(input, request);

            return CommonHelper.ProcessRequest<StringResultDto>(request);
        }
Exemple #11
0
        public Screen2Invalid(Activity context, PointDto point)
            : base(context, Resource.Layout.Edit2Invalid, point)
        {
            if (View == null)
                return;

            driveAvailable = View.FindViewById<CheckBox>(Resource.Id.drive_available);
            pathes = View.FindViewById<CheckBox>(Resource.Id.pathes);
            parking = View.FindViewById<CheckBox>(Resource.Id.parking);
            parkingInvalid = View.FindViewById<CheckBox>(Resource.Id.parking_invalid);

            PointPart2Invalid pointPart2Invalid = Point.PointDataDto.PointPart2Invalid;

            driveAvailable.Checked = pointPart2Invalid.DriveAvailable;
            pathes.Checked = pointPart2Invalid.Pathes;
            parking.Checked = pointPart2Invalid.Parking;
            parkingInvalid.Checked = pointPart2Invalid.ParkinInvalid;
        }
Exemple #12
0
        private static void Main(string[] args)
        {
            var loginData = new LoginRequestDto()
            {
                Login = "******",
                Password = "******"
            };

            if (!LoginService.Login(loginData))
                Debugger.Break();

            PointsSetDto points = PointService.ListPoints();

            var newPoint = new PointDto()
                {
                    Name = "123"
                };

            var result = PointService.NewPoint(newPoint);

            if(result.Result != null)
                Debugger.Break();

            points = PointService.ListPoints();

            var old = points.Points.Last();

            old.Name = "321";

            result = PointService.EditPoint(old);

            if (result.Result != null)
                Debugger.Break();

            result = PointService.RemovePoint(old);

            if (result.Result != null)
                Debugger.Break();

            points = PointService.ListPoints();


            // Thread.Sleep(1000000);
        }
Exemple #13
0
        public static string GetName(PointDto.CategoryType category)
        {
            switch (category)
            {
                case PointDto.CategoryType.Administration:
                    return "Административные объекты";

                case PointDto.CategoryType.Commerce:
                    return "Коммерческие объекты";

                case PointDto.CategoryType.Office:
                    return "Офисные объекты";

                case PointDto.CategoryType.HealthArea:
                    return "Медицинские объекты";

                case PointDto.CategoryType.CultureArea:
                    return "Объекты культуры";

                case PointDto.CategoryType.Services:
                    return "Сфера услуг";

                case PointDto.CategoryType.Food:
                    return "Объекты питания";

                case PointDto.CategoryType.Sport:
                    return "Спортивные объекты";

                case PointDto.CategoryType.Education:
                    return "Образование";

                case PointDto.CategoryType.Other:
                    return "Иные объекты ";

                default:
                    throw new ArgumentOutOfRangeException("category", ((int)category).ToString(CultureInfo.InvariantCulture));
            }
        }
        private void ReadPoint()
        {
            string json = Intent.GetStringExtra(PointJsonExtraKey);

            point = new PointDto();

            if (json != null)
            {
                point.FromJson(JObject.Parse(json));
            }
        }
        /// <summary>
        /// сохранение точки в файл
        /// </summary>
        /// <param name="pointDto">точка</param>
        private void SavePoint(PointDto pointDto)
        {
            try
            {
                var path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
                var file = new File(path, "/" + Resource.String.dirname);
                if (!file.Exists())
                {
                    file.Mkdirs();
                }
                File sdFile;
                string nameFile;
                if (point.Id > 0)
                {
                    nameFile = point.Id.ToString(CultureInfo.InvariantCulture);
                    sdFile = new File(file, nameFile);
                }
                else
                    do
                    {
                        nameFile = "NewPoint_" + Guid.NewGuid();
                        sdFile = new File(file, nameFile);
                    } while (sdFile.Exists());

                using (var bw = new StreamWriter(sdFile.AbsolutePath))
                {
                    bw.Write(pointDto.ToJson().ToString());
                    bw.Close();
                }
            }
            catch (FileNotFoundException e)
            {
                e.PrintStackTrace();
                var inner1 = e;
                MessageBox.ShowMessage("FileNotFoundException: " + inner1.Message, this);

            }
            catch (IOException e)
            {
                e.PrintStackTrace();
                var inner = e;
                MessageBox.ShowMessage("IOException: " + inner.Message, this);

            }
            catch (Exception e)
            {
                var inner = e;

                while (inner.InnerException != null)
                {
                    inner = inner.InnerException;
                }

                MessageBox.ShowMessage(inner.Message + inner.StackTrace, this);
            }
        }
Exemple #16
0
 public void Update(PointDto point)
 {
     Name = point.Name;
     PointData = point.PointDataDto.ToJson().ToString();
     CategoryId = (int)point.Category;
 }
Exemple #17
0
 public EditPointDto()
 {
     Auth = new AuthDto();
     Point = new PointDto();
 }