Esempio n. 1
0
        public void SetValuesCell(Pdv cell)
        {
            endereco.Text = cell.Endereco;
            btnJustificativa.TouchUpInside -= cell.Justificativa;
            btnJustificativa.TouchUpInside += cell.Justificativa;
            btnCheckin.TouchUpInside       -= cell.CheckIn;
            btnCheckin.TouchUpInside       += cell.CheckIn;
            btnLoja.TouchUpInside          -= cell.MapsExec;
            btnLoja.TouchUpInside          += cell.MapsExec;
            justificariocn.TintColor        = UIColor.FromRGB(10, 88, 90);
            checkin.TintColor = UIColor.FromRGB(10, 88, 90);
            btnLoja.SetTitle(cell.NomePDV, UIControlState.Normal);

            ContentView.Layer.MasksToBounds = true;

            contentView.Layer.ShadowColor   = UIColor.DarkGray.CGColor;
            contentView.Layer.ShadowOffset  = new CGSize(0.0f, 1.5f);
            contentView.Layer.ShadowOpacity = 0.4f;
            contentView.Layer.MasksToBounds = false;

            Layer.ShadowColor   = UIColor.Black.CGColor;
            Layer.ShadowOffset  = new CGSize(0.0f, 2.6f);
            Layer.ShadowOpacity = 0.6f;
            Layer.MasksToBounds = false;
        }
Esempio n. 2
0
        public Pdv GetPdvCardUiInfo()
        {
            var tarefa = new Pdv
            {
                NomePDV  = btnLoja.CurrentTitle,
                Endereco = endereco.Text
            };

            return(tarefa);
        }
        void PopulatePdvs()
        {
            feedCollection.Pdvs = new List <Pdv>();

            var onde = controllerPCL.VisitasPendentes();

            foreach (var item in controllerPCL.VisitasPendentes())
            {
                var    fullGeoPT = item.ENDERECO.Split('\n');
                string id        = item.ID;
                double lat       = item.LAT;
                double longi     = item.LONG;
                var    cell      = new Pdv
                {
                    listTypePdv = new List <ListTypePDV>(),
                    NomePDV     = fullGeoPT[0].Split('-')[1].Trim(),
                    Endereco    = (fullGeoPT[1] + " " + fullGeoPT[2].Replace(" - CEP:", ", CEP:"))
                };
                var index = feedCollection.Pdvs.FindIndex(Pdv => (Pdv.NomePDV.ToUpper().Equals(cell.NomePDV.ToUpper()) &&
                                                                  Pdv.Endereco.ToUpper().Equals(cell.Endereco.ToUpper())));

                var infoPdv = new ListTypePDV(id);
                if (index >= 0 && feedCollection.Pdvs.Count > 0)
                {
                    if (feedCollection.Pdvs[index].listTypePdv.FindIndex(ListTypePDV => (ListTypePDV.IdVisita.Equals(infoPdv.IdVisita))) < 0)
                    {
                        feedCollection.Pdvs[index].listTypePdv.Add(infoPdv);
                    }
                }
                else
                {
                    cell.listTypePdv.Add(infoPdv);
                    cell.Lat            = lat;
                    cell.Longi          = longi;
                    cell.IdVisita       = id;
                    cell.Justificativa += Justificativa();
                    cell.CheckIn       += CheckIn();
                    cell.MapsExec      += ExecMaps();
                    feedCollection.Pdvs.Add(cell);
                }
            }
            InvokeOnMainThread(() => collecFeedPdv.ReloadData());
        }