private void InvoiceForm_Load(object sender, EventArgs e) { using (var bitmap = new Bitmap(this.ClientSize.Width, this.ClientSize.Height)) { Customer cust = Customer.getInstance(); this.pnlInvoice.DrawToBitmap(bitmap, new Rectangle(0, 0, bitmap.Width, bitmap.Height)); System.IO.Directory.CreateDirectory(Application.StartupPath + @"\Resources\Invoices\"); bitmap.Save(Application.StartupPath + @"\Resources\Invoices\" + cust.Username + cust.PurchCount + ".png"); cust.PurchCount++; DataBaseHandler dh = DataBaseHandler.getInstance(); dh.CustomerUpdate(cust); } }
private void btnUpdate_Click(object sender, EventArgs e) { Logger.logger("Profile Form Update"); DataBaseHandler dh = DataBaseHandler.getInstance(); cstmr.Name = txtName.Text; cstmr.Adress = txtAddress.Text; cstmr.Email = txtEmail.Text; cstmr.Password = txtPassword.Text; dh.CustomerUpdate(cstmr); MessageBox.Show("Your profile has been updated successfully.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); }