Пример #1
0
        public bool Update(DateTime tiempoActualizacion, Observable.NotificationType tn)
        {
            bool toret = false;

            if (tn == Observable.NotificationType.Eliminate &&
                keepUpdating)
            {
                if (uiPlace != null)
                {
                    this.uiPlace.Hide();
                }

                this.OnStopObserving();
                toret = true;
            }
            else
            if (keepUpdating)
            {
                if (lastUpdate != tiempoActualizacion)
                {
                    Build(areaFrom);
                    Show();

                    if (uiPlace != null)
                    {
                        uiPlace.UpdatePanel();
                    }

                    toret      = true;
                    lastUpdate = tiempoActualizacion;
                }
            }

            return(toret);
        }
Пример #2
0
        /// <summary>
        /// Executed when this control needs updating.
        /// </summary>
        /// <returns>Whether it was updated or not.</returns>
        /// <param name="updateTime">Update time.</param>
        /// <param name="tn">The type of the notification</param>
        public bool Update(DateTime updateTime, Observable.NotificationType tn)
        {
            bool toret = false;
            int  posCursor;            // No modificar pos de cursor en obs

            if (tn == Observable.NotificationType.Eliminate &&
                mustUpdate)
            {
                this.OnStopObserving();
                this.Hide();
                toret = true;
            }

            if (mustUpdate &&
                updateTime != lastUpdate)
            {
                // Let's update
                toret      = true;
                mustUpdate = false;
                lastUpdate = updateTime;

                // Basic data
                Text = this.RealEstate.Name
                       + @" - "
                       + EtqFinca
                       + (this.RealEstate.IsUrban ? (@" " + EtqUrbana) : "")
                ;

                textBox1.Text = this.RealEstate.Id;
                textBox2.Text = this.RealEstate.Name;
                textBox3.Text = this.RealEstate.Extension.ToString(textBox3.Mask);
                superfmc.Text = Estate.cnvtHaMc(this.RealEstate.Extension)
                                .ToString(superfmc.Mask)
                ;

                // Is it urban?
                UpdateIsUrban(this.RealEstate.IsUrban);

                // Post address
                if (this.RealEstate.getDireccion() != null)
                {
                    textBox6.Text  = this.RealEstate.getDireccion().Street;
                    textBox7.Text  = this.RealEstate.getDireccion().City;
                    textBox8.Text  = this.RealEstate.getDireccion().Province;
                    textBox9.Text  = this.RealEstate.getDireccion().StreetNumber.ToString(textBox9.Mask);
                    textBox10.Text = this.RealEstate.getDireccion().Floor.ToString(textBox10.Mask);
                    textBox12.Text = this.RealEstate.getDireccion().Door;
                    textBox11.Text = this.RealEstate.getDireccion().PostalCode.ToString(textBox11.Mask);
                }
                else
                {
                    textBox6.Text  = "";
                    textBox7.Text  = "";
                    textBox8.Text  = "";
                    textBox9.Text  = "";
                    textBox10.Text = "";
                    textBox12.Text = "";
                    textBox11.Text = "";
                }

                // Referencia catastral
                textBox14.Text = this.RealEstate.RefCatastral;

                // Value
                lblValue.Text = this.RealEstate.Valor.ToString(lblValue.Mask);
                if (this.RealEstate.Extension != 0)
                {
                    textBox15.Text =
                        Convert.ToString(
                            this.RealEstate.Valor / Estate.cnvtHaMc(this.RealEstate.Extension));
                }
                else
                {
                    textBox15.Text = "0";
                }

                // Was sold?
                textBox5.Text = this.RealEstate.getNombreDeComprador();
                textBox4.Text = this.RealEstate.getPrecioDeVenta().ToString(textBox4.Mask);

                // Remarks
                posCursor                    = richTextBox1.SelectionStart;
                richTextBox1.Text            = this.RealEstate.Remarks;
                richTextBox1.SelectionStart  = posCursor;
                richTextBox1.SelectionLength = 0;
                richTextBox1.ScrollToCaret();

                // Update from now on
                mustUpdate = true;
            }

            return(toret);
        }