Ejemplo n.º 1
0
 private void FillHabitant()
 {
     using (var habitant = new posb.Habitant())
     {
         this.cmbHabitant.Fill(habitant.List());
     }
 }
Ejemplo n.º 2
0
        private void Save()
        {
            using (var e = new posb.Habitant
            {
                Id = this.Id,
                Name = this.txtName.Text,
                Paterno = this.txtLastName.Text,
                Materno = this.txtMotherLastName.Text,
                observations = this.txtObservations.Text,
                Active = this.cbActive.Checked,
                Year = int.Parse(this.cmbYear.Text),
                Month = this.cmbMonth.SelectedIndex,
                Total = decimal.Parse(this.txtTotal.Text)
            })
            {
                e.Save();

                if (e.Total > 0)
                {
                    if (this.Confirm("¿Deseas imprimir el recibo?"))
                    {
                        this.PrintHabitant(e.Id.Value);
                    }
                }

                this.Result(true, "Success!!");

                this.Close();
            }
        }
Ejemplo n.º 3
0
        private void LoadData(int?Id)
        {
            using (var e = new posb.Habitant
            {
                Id = this.Id
            })
            {
                e.Get();

                this.txtName.Text           = e.Nombre;
                this.txtLastName.Text       = e.Paterno;
                this.txtMotherLastName.Text = e.Materno;
                this.txtObservations.Text   = e.observations;
                this.cbActive.Checked       = e.Active.Value;
                this.cmbYear.Text           = e.Year.ToString();
                this.cmbMonth.SelectedIndex = e.Month.Value;
                this.txtTotal.Text          = String.Format("{0:0.00}", e.Total);
            }
        }
Ejemplo n.º 4
0
        private void FillWaterIntake(int IdHabitant)
        {
            using (var waterIntake = new posb.WaterIntake
            {
                IdHabitant = IdHabitant
            })
            {
                var waterIntakeList = waterIntake.List(4);

                if (waterIntakeList.Count.Equals(0))
                {
                    waterIntakeList = waterIntake.List(3);
                }

                this.cmbWaterIntake.Fill(waterIntakeList);

                if (this.cmbWaterIntake.Items.Count.Equals(2))
                {
                    this.cmbWaterIntake.SelectedIndex = 1;
                }

                if (this.idWaterIntake.HasValue)
                {
                    this.cmbWaterIntake.SelectedValue = this.idWaterIntake;
                    this.idWaterIntake = null;
                }
            }

            using (var habitant = new posb.Habitant
            {
                Id = this.cmbHabitant.GetVal <int>()
            })
            {
                habitant.Get();

                this.StartYear  = habitant.Year;
                this.StartMonth = habitant.Month;

                this.FillYears(this.StartYear);
                this.FillYearsEnd(this.StartYear);
            }
        }
Ejemplo n.º 5
0
        public HabitantList()
        {
            this.Entity = new posb.Habitant();

            InitializeComponent();
        }