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

                this.txtName.Text          = e.Name;
                this.txtDescription.Text   = e.Description;
                this.txtAmount.Text        = String.Format("{0:0.00}", e.Amount);
                this.cmbType.SelectedIndex = e.Type.Value + 1;
            }

            using (var e = new posb.Config())
            {
                var picture1 = e.GetImage("InputOutput", this.Id.Value);

                if (picture1 != null)
                {
                    this.pbPhoto.Image = System.Drawing.Image.FromStream(new MemoryStream(picture1));
                    this.pbPhoto.Refresh();
                }
            }
        }
Ejemplo n.º 2
0
        private void Save()
        {
            using (var e = new posb.Expense
            {
                Id = this.Id,
                Name = this.txtName.Text,
                Description = this.txtDescription.Text,
                Amount = decimal.Parse(this.txtAmount.Text),
                Type = this.cmbType.SelectedIndex - 1
            })
            {
                e.Save();

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

                this.Close();
            }
        }
Ejemplo n.º 3
0
        public InputOutputsList()
        {
            this.Entity = new posb.Expense();

            InitializeComponent();
        }