Пример #1
0
        public void GravaEndereco(contratos so, int ClienteId, int ContratoId)
        {
            ClienteEndereco endereco = new ClienteEndereco();
            var             ende     = so._propostas_produtos._propostas_enderecos;
            Predio          Predio   = new Predio();

            if (ende.predio.Trim() != "PNA")
            {
                Predio = Mundbr.Predio.First(x => x.Nome == ende.predio);
            }
            else
            {
                Predio = Mundbr.Predio.First(x => x.PredioId == 1);
            }
            endereco.BairroId         = Mundbr.Bairros.First(x => x.Nome.ToUpper() == ende.bairro.ToUpper()).BairroId;
            endereco.ClienteId        = ClienteId;
            endereco.ContratoId       = ContratoId;
            endereco.Complemento      = ende.complemento;
            endereco.Logradouro       = ende.endereco;
            endereco.Cep              = ende.cep.ToString();
            endereco.TipoLogradouroId = 1;
            endereco.Numero           = ende.numero;
            endereco.PredioId         = Predio.PredioId;

            Mundbr.ClienteEndereco.Add(endereco);
        }
Пример #2
0
        public FractionPage(WindowViewModel vm, Fracao f, Predio p)
        {
            InitializeComponent();
            this.vm = vm;
            this.f  = f;
            this.p  = p;
            Compras = new ObservableCollection <Compra>(f.getAllCompras());


            if (Compras.Count > 0 && Compras.Last()._Data_Venda == DateTime.MaxValue)
            {
                Compra = true;
            }
            else
            {
                Compra = false;
            }

            IntervalTimer = Convert.ToInt32(ConfigurationManager.AppSettings["IntervalTime"]);
            strImagePath  = ConfigurationManager.AppSettings["ImagePath"] + "/Fracao_" + f.ID;
            ImageControls = new[] { myImage, myImage2 };

            LoadImages();


            timerImageChange          = new DispatcherTimer();
            timerImageChange.Interval = new TimeSpan(0, 0, IntervalTimer);
            timerImageChange.Tick    += new EventHandler(timerImageChange_Tick);
        }
Пример #3
0
 public AddNota(WindowViewModel vm, DateTime dt, Predio p)
 {
     InitializeComponent();
     this.vm = vm;
     this.dt = dt;
     this.p  = p;
 }
Пример #4
0
        /// <summary>
        /// Guardar Predios enviados en listas
        /// </summary>
        /// <param name="_model ">Contiene los datos en lista de predios enviados desde el model VUE.JS</param>
        /// <returns></returns>
        public int GuardarPredidios(List <PredioViewModel> _model, String user, int AreaProspeccion)
        {
            int get = 0;

            try
            {
                foreach (var item in _model)
                {
                    Predio _predio = new Predio();
                    _predio.Id                = item.Id;
                    _predio.CreationDate      = DateTime.Now;
                    _predio.IdPropietario     = item.IdPropietario;
                    _predio.IdZonaProspectada = AreaProspeccion;
                    _predio.Latitude          = item.Latitude;
                    _predio.Length            = item.Length;
                    _predio.Name              = item.Name;
                    _predio.StatusRegister    = item.StatusRegister;
                    _predio.Usercreation      = user;
                    _predio.Value             = item.Value;
                    _predio.Zona              = item.Zona;
                    _predio.Image             = item.Image;
                    _context.Add(_predio);
                    _context.Entry(_predio).State = _predio.Id > 0 ? EntityState.Modified : EntityState.Added;
                    _context.SaveChanges();
                }
            }
            catch (Exception)
            {
                return(0);
            }
            return(get);
        }
        public EditFracao(WindowViewModel vm, Predio p, Fracao f)
        {
            InitializeComponent();
            this.vm = vm;
            this.p  = p;
            this.f  = f;

            tbPiso.Text = f.Piso.ToString();
            tbArea.Text = f.Area.ToString();

            if (f.Quota != -1)
            {
                tbQuota.Text = f.Quota.ToString();
            }

            if (!string.IsNullOrEmpty(f.Zona))
            {
                tbZona.Text = f.Zona;
            }

            if (f.Tipo == "Estacionamento")
            {
                CBTipo.SelectedIndex = 1;
            }
            else if (f.Tipo == "Comercial")
            {
                CBTipo.SelectedIndex = 1;
            }

            photos = new ObservableCollection <Photo>(f.getImagesPhotos());
            PropertyChanged(this, new PropertyChangedEventArgs(nameof(photos)));
        }
Пример #6
0
        protected void Application_Start(object sender, EventArgs e)
        {
            Predio predio = new Predio();

            predio.RecuperarApartamento("C:\\Users\\DanielSales\\Desktop\\CRUD\\CRUD.Web\\App_Data\\");
            Application["Predio"] = predio;
        }
Пример #7
0
 public AddReunionWithDate(WindowViewModel vm, Predio p)
 {
     InitializeComponent();
     this.vm    = vm;
     this.p     = p;
     Condominos = new ObservableCollection <Condomino>(Condomino.get_All_Current_Condominos(p.ID));
 }
Пример #8
0
        private void Delete_Building(object sender, RoutedEventArgs e)
        {
            var res = MessageBox.Show(
                "Tem a certeza que deseja apagar o prédio " + p.ToString() + " do sistema ?",
                "Apagar prédio",
                MessageBoxButton.YesNo,
                MessageBoxImage.Question
                );

            if (res.ToString() == "Yes")
            {
                p.Delete();
                Buildings = new ObservableCollection <Predio>(Predio.get_All_Buildings());
                PropertyChanged(this, new PropertyChangedEventArgs(nameof(Buildings)));
                vm.Buildings            = Buildings;
                PushpinPopup.Visibility = Visibility.Hidden;
                MessageBox.Show(
                    "Prédio " + p.ToString() + " apagado com sucesso!",
                    "Apagar prédio",
                    MessageBoxButton.OK,
                    MessageBoxImage.Information
                    );

                p = null;
            }
        }
Пример #9
0
        public EditBuilding(WindowViewModel vm, Predio p)
        {
            InitializeComponent();
            this.vm          = vm;
            this.p           = p;
            tbNome.Text      = p.Nome;
            tbLatitude.Text  = p.Latitude.ToString();
            tbLongitude.Text = p.Longitude.ToString();
            if (p.Area != -1)
            {
                tbArea.Text = p.Area.ToString();
            }
            if (p.Cidade != null)
            {
                tbCidade.Text = p.Cidade.ToString();
            }
            if (p.Morada != null)
            {
                tbMorada.Text = p.Morada;
            }
            if (p.Codigo_Postal != null)
            {
                tbCodigo_Postal.Text  = p.Codigo_Postal.Split('-')[0];
                tbCodigo_Postal2.Text = p.Codigo_Postal.Split('-')[1];
            }

            photos = new ObservableCollection <Photo>(p.getImagesPhotos());
            PropertyChanged(this, new PropertyChangedEventArgs(nameof(photos)));
        }
        public BuildingMainPage(WindowViewModel vm, Predio p)
        {
            InitializeComponent();
            this.vm = vm;
            this.p  = p;

            Map.Center = p.Location;

            IntervalTimer = Convert.ToInt32(ConfigurationManager.AppSettings["IntervalTime"]);
            strImagePath  = ConfigurationManager.AppSettings["ImagePath"] + "/Predio_" + p.ID;
            ImageControls = new[] { myImage, myImage2 };

            LoadImages();

            timerImageChange          = new DispatcherTimer();
            timerImageChange.Interval = new TimeSpan(0, 0, IntervalTimer);
            timerImageChange.Tick    += new EventHandler(timerImageChange_Tick);

            List <Fracao> fractions = Fracao.get_All_Fractions(p.ID);

            foreach (Fracao fraction in fractions)
            {
                Fractions.Add(fraction);
                if (fraction.CurrentCondomino != null)
                {
                    ocupacao += 1;
                }
            }
            Eventos = new ObservableCollection <Evento>(Evento.get_Next_Events(p.ID));
            showColumnChart();
        }
        public FractionsPage(WindowViewModel vm, Predio p)
        {
            InitializeComponent();
            this.vm = vm;
            this.p  = p;

            List <Fracao> fractions = Fracao.get_All_Fractions(p.ID);

            int oc = 0;

            foreach (Fracao fraction in fractions)
            {
                _Items.Add(fraction);
                if (fraction.CurrentCondomino != null)
                {
                    oc += 1;
                }
            }

            if (fractions.Count() != 0)
            {
                Ocupacao = (Math.Round(100 * oc / (double)fractions.Count(), 2)).ToString() + "% (" + oc + "/" + fractions.Count() + ")";
            }
            else
            {
                Ocupacao = "0% (" + oc + "/" + fractions.Count() + ")";
            }
        }
Пример #12
0
        // GET: PredioController/Delete/5
        public ActionResult Delete(int id)
        {
            Predio      predio      = _predioService.Obter(id);
            PredioModel predioModel = _mapper.Map <PredioModel>(predio);

            return(View(predioModel));
        }
Пример #13
0
        private void btnSaveFile_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog saveFileDialog = new OpenFileDialog();

            saveFileDialog.Filter      = "Bitmap Image (.bmp)|*.bmp|Gif Image (.gif)|*.gif|JPEG Image (.jpeg)|*.jpeg|Png Image (.png)|*.png|Tiff Image (.tiff)|*.tiff|Wmf Image (.wmf)|*.wmf|JPG Image (.jpg)|*.jpg|All Images|*.jpg;*.wmf;*.tiff;*.png;*.jpeg;*.gif;*.bmp)";
            saveFileDialog.Multiselect = true;

            if (saveFileDialog.ShowDialog() == true)
            {
                for (int i = 0; i < saveFileDialog.SafeFileNames.Length; i++)
                {
                    if (!photos.Any(p => p.FileName == saveFileDialog.SafeFileNames[i]))
                    {
                        Photo p;
                        if (new FileInfo(saveFileDialog.FileNames[i]).Length == 0)
                        {
                            p = new Photo(saveFileDialog.SafeFileNames[i], new FileInfo(saveFileDialog.FileNames[i]).Length / 100, saveFileDialog.FileNames[i]);
                        }
                        else
                        {
                            p = new Photo(saveFileDialog.SafeFileNames[i], new FileInfo(saveFileDialog.FileNames[i]).Length, saveFileDialog.FileNames[i]);
                        }
                        photos.Add(p);
                    }
                }
                PropertyChanged(this, new PropertyChangedEventArgs(nameof(photos)));
            }
        }
 public AgendaPage(WindowViewModel vm, Predio p)
 {
     InitializeComponent();
     this.vm = vm;
     this.p  = p;
     Eventos = new ObservableCollection <Evento>(Evento.get_Next_Events(p.ID));
 }
Пример #15
0
        public List <Entrenamiento> listaEntrenamientoInscriptoSegunIdSocio(int idSocio)
        {
            List <Entrenamiento> lista = new List <Entrenamiento>();

            bd.consultarBD("select e.id idEntrenamiento, d.id idDeporte, d.nombre nombreDeporte, d.id_clasificacion, dc.nombre tipoDeporte, p.id idPredio, p.descripcion, e.precioMensual, e.precioMatricula, e.cantidadCuotas from Entrenamiento e join Deporte d on d.id = e.deporte join Deporte_Clasificacion dc on d.id_clasificacion = dc.id join Predio p on p.id = e.predio join Inscripcion i on i.entrenamiento = e.id where i.socio = " + idSocio);
            while (bd.Lector.Read())
            {
                Entrenamiento entrenamiento = new Entrenamiento();
                if (!bd.Lector.IsDBNull(0))
                {
                    entrenamiento.Id = bd.Lector.GetInt32(0);
                }

                Deporte deporte = new Deporte();
                if (!bd.Lector.IsDBNull(1))
                {
                    deporte.Id = bd.Lector.GetInt32(1);
                }
                if (!bd.Lector.IsDBNull(2))
                {
                    deporte.Nombre = bd.Lector.GetString(2);
                }
                if (!bd.Lector.IsDBNull(3))
                {
                    deporte.Clasificacion = new ClasificacionDeporte(bd.Lector.GetInt32(3), bd.Lector.GetString(4));
                }

                Predio predio = new Predio();
                if (!bd.Lector.IsDBNull(5))
                {
                    predio.Id = bd.Lector.GetInt32(5);
                }
                if (!bd.Lector.IsDBNull(6))
                {
                    predio.Descripcion = bd.Lector.GetString(6);
                }

                entrenamiento.Deporte = deporte;
                entrenamiento.Predio  = predio;

                if (!bd.Lector.IsDBNull(7))
                {
                    entrenamiento.PrecioMensual = bd.Lector.GetDouble(7);
                }
                if (!bd.Lector.IsDBNull(8))
                {
                    entrenamiento.PrecioMatricula = bd.Lector.GetDouble(8);
                }
                if (!bd.Lector.IsDBNull(9))
                {
                    entrenamiento.CantidadCuotas = bd.Lector.GetInt32(9);
                }

                lista.Add(entrenamiento);
            }
            bd.Lector.Close();
            bd.desconectar();
            return(lista);
        }
Пример #16
0
        public List <Entrenamiento> listaEntrenamiento()
        {
            List <Entrenamiento> lista = new List <Entrenamiento>();

            bd.consultarBD("select * from vw_listaEntrenamiento order by idDeporte");
            while (bd.Lector.Read())
            {
                Entrenamiento entrenamiento = new Entrenamiento();
                if (!bd.Lector.IsDBNull(0))
                {
                    entrenamiento.Id = bd.Lector.GetInt32(0);
                }

                Deporte deporte = new Deporte();
                if (!bd.Lector.IsDBNull(1))
                {
                    deporte.Id = bd.Lector.GetInt32(1);
                }
                if (!bd.Lector.IsDBNull(2))
                {
                    deporte.Nombre = bd.Lector.GetString(2);
                }
                if (!bd.Lector.IsDBNull(3))
                {
                    deporte.Clasificacion = new ClasificacionDeporte(bd.Lector.GetInt32(3), bd.Lector.GetString(4));
                }

                Predio predio = new Predio();
                if (!bd.Lector.IsDBNull(5))
                {
                    predio.Id = bd.Lector.GetInt32(5);
                }
                if (!bd.Lector.IsDBNull(6))
                {
                    predio.Descripcion = bd.Lector.GetString(6);
                }

                entrenamiento.Deporte = deporte;
                entrenamiento.Predio  = predio;

                if (!bd.Lector.IsDBNull(7))
                {
                    entrenamiento.PrecioMensual = bd.Lector.GetDouble(7);
                }
                if (!bd.Lector.IsDBNull(8))
                {
                    entrenamiento.PrecioMatricula = bd.Lector.GetDouble(8);
                }
                if (!bd.Lector.IsDBNull(9))
                {
                    entrenamiento.CantidadCuotas = bd.Lector.GetInt32(9);
                }

                lista.Add(entrenamiento);
            }
            bd.Lector.Close();
            bd.desconectar();
            return(lista);
        }
Пример #17
0
 public AddSujFisc(WindowViewModel vm, Predio p, DateTime dt, ApplicationPage lp)
 {
     InitializeComponent();
     this.vm = vm;
     this.p  = p;
     this.dt = dt;
     this.lp = lp;
 }
 public AddReuniao(WindowViewModel windowViewModel, DateTime dt, Predio p)
 {
     InitializeComponent();
     this.vm    = windowViewModel;
     this.dt    = dt;
     this.p     = p;
     Condominos = new ObservableCollection <Condomino>(Condomino.get_All_Current_Condominos(p.ID));
 }
Пример #19
0
 public PredioViewModel(Predio predio)
 {
     Codigo    = predio.Codigo;
     Nombre    = predio.Nombre;
     CodigoICA = predio.CodigoICA;
     Vereda    = predio.Vereda;
     Municipio = predio.Municipio;
 }
Пример #20
0
 public frmPredio()
 {
     InitializeComponent();
     ge      = new GestorEntrenamiento();
     gd      = new GestorDeporte();
     toolTip = new ToolTip();
     predio  = new Predio();
 }
        public ActionResult DeleteConfirmed(int id)
        {
            Predio predio = db.Predio.Find(id);

            db.Predio.Remove(predio);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #22
0
 public FinancesPage(WindowViewModel vm, Predio p)
 {
     InitializeComponent();
     this.vm = vm;
     this.p  = p;
     showColumnChart();
     Transacoes = new ObservableCollection <Transacao>(Outros_Pagamentos.get_OutrosPagamentos(p, EndDate, StartDate).Union(new ObservableCollection <Transacao>(Pagamentos_Quota.get_Quotas(p.ID, EndDate, StartDate))));
     PropertyChanged(this, new PropertyChangedEventArgs("Transacoes"));
 }
Пример #23
0
 public CompraFracao(WindowViewModel vm, Predio p, Fracao f, DateTime StartDate)
 {
     InitializeComponent();
     Condominos     = new ObservableCollection <Condomino>(Condomino.get_Condominos(p.ID));
     this.vm        = vm;
     this.p         = p;
     this.f         = f;
     this.StartDate = StartDate;
 }
 public VendaFracao(WindowViewModel vm, Predio p, Fracao f, Compra c, DateTime StartDate)
 {
     InitializeComponent();
     this.vm        = vm;
     this.p         = p;
     this.f         = f;
     this.c         = c;
     this.StartDate = StartDate;
 }
Пример #25
0
 public AddPagamento(WindowViewModel vm, Predio p, DateTime dt, ApplicationPage lastPage)
 {
     InitializeComponent();
     this.vm       = vm;
     this.p        = p;
     this.dt       = dt;
     initialDT     = dt;
     this.lastPage = lastPage;
 }
 public ActionResult Edit([Bind(Include = "Id,Descricao")] Predio predio)
 {
     if (ModelState.IsValid)
     {
         db.Entry(predio).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(predio));
 }
Пример #27
0
 public void show_Building(Predio p)
 {
     PushpinPopup.Visibility = Visibility.Visible;
     lName.Text    = p.Nome;
     lName.ToolTip = p.Nome;
     lMor.Text     = p.Morada;
     lMor.ToolTip  = p.Morada;
     lCid.Text     = p.Cidade;
     lCid.ToolTip  = p.Cidade;
 }
        public ActionResult Create([Bind(Include = "Id,Descricao")] Predio predio)
        {
            if (ModelState.IsValid)
            {
                db.Predio.Add(predio);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(predio));
        }
Пример #29
0
        private Predio MapearPredio(PredioInputModel predioInput)
        {
            var predio = new Predio
            {
                Codigo    = predioInput.Codigo,
                Nombre    = predioInput.Nombre,
                CodigoICA = predioInput.CodigoICA,
                Vereda    = predioInput.Vereda,
                Municipio = predioInput.Municipio,
            };

            return(predio);
        }
        public AddManutencaoWithDate(WindowViewModel vm, Predio p, Outros_Pagamentos pg = null)
        {
            InitializeComponent();
            this.vm = vm;
            this.p  = p;

            if (pg != null)
            {
                op = pg;
                AddPay.Visibility = Visibility.Collapsed;
                SP.Visibility     = Visibility.Visible;
            }
        }