using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Common; //2016-05-09 -v1.2 price increase + stain % - maanie namespace PersonalLaundry { public partial class PriceIncreaseForm : Form { public OperatorLogin operatorLogin; public PriceIncreaseForm(OperatorLogin operatorLogin) { this.operatorLogin = operatorLogin; InitializeComponent(); } private void PriceIncreaseForm_Load(object sender, EventArgs e) { LoadCustomerPricingPercentages(); } private void LoadCustomerPricingPercentages() { try { using (var db = new DataModel()) { CustomerPricingPercentageGrid.DataSource = db.Customers.OrderBy(d => d.Name).ToList(); } } catch (Exception ex) { MessageBox.Show(ex.Message, @"LoadPricingPercentages", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void ApplyButton_Click(object sender, EventArgs e) { var result = MessageBox.Show(@"Are you sure you would you like to apply these price increases?" + Environment.NewLine + "Please note: These changes cannot be undone!", "Apply changes", MessageBoxButtons.YesNoCancel); if (result == DialogResult.Cancel || result == DialogResult.No) return; using (var db = new DataModel()) { db.UpdateCustomerInventoryByPercentages(operatorLogin.OperatorLoginId); MessageBox.Show(@"Changes Applied!", @"Customer", MessageBoxButtons.OK); } } } }