Exemplo n.º 1
0
 private void LoadData(int?Id)
 {
     using (var e = new posb.Faena
     {
         Id = this.Id
     })
     {
         e.Get();
     }
 }
Exemplo n.º 2
0
 private void FillFaena(int?Id = null)
 {
     if (Id.HasValue)
     {
         using (var faena = new posb.Faena
         {
             Id = Id
         })
         {
             this.cmbFaena.Fill(faena.ListByHabitant(), Display: "NameCombo");
         }
     }
     else
     {
         this.cmbFaena.Fill(new List <posb.Faena>());
     }
 }
Exemplo n.º 3
0
        private void LoadData(int?Id)
        {
            using (var e = new posb.Faena
            {
                Id = this.Id
            })
            {
                e.Get();

                this.txtName.Text = e.Name;

                this.cmbYear.Text           = e.Year.ToString();
                this.cmbMonth.SelectedIndex = e.Month.Value;

                this.txtAmount.Text      = String.Format("{0:0.00}", e.Amount);
                this.txtDescription.Text = e.Description;
                this.cbActive.Checked    = e.Active.Value;
                this.cbAlways.Checked    = e.Always.Value;
            }
        }
Exemplo n.º 4
0
        private void Save()
        {
            using (var e = new posb.Faena
            {
                Id = this.Id,
                Name = this.txtName.Text,
                Amount = decimal.Parse(this.txtAmount.Text),
                Year = int.Parse(this.cmbYear.Text),
                Month = this.cmbMonth.SelectedIndex,
                Description = this.txtDescription.Text,
                Active = this.cbActive.Checked,
                Always = this.cbAlways.Checked
            })
            {
                e.Save();

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

                this.Close();
            }
        }
Exemplo n.º 5
0
        private void Save()
        {
            using (var e = new posb.Faena
            {
                Id = this.Id,
                IdHabitant = int.Parse(this.cmbHabitant.SelectedValue.ToString()),
                IdFaena = int.Parse(this.cmbFaena.SelectedValue.ToString())
            })
            {
                e.SaveHabitantFaena();

                if (this.Confirm("¿Deseas imprimir el recibo?"))
                {
                    this.PrintFaena(e.Id.Value);
                }

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

                this.Close();
            }
        }
Exemplo n.º 6
0
        public HabitantFaenasList()
        {
            this.Entity = new posb.Faena();

            InitializeComponent();
        }