/// <summary> /// Handles the Click event of the btn25OFF control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> public void btn25OFF_Click(object sender, EventArgs e) { if (parentForm.lblMemberCode.Text == "101" | parentForm.lblName.Text == "WALK INS") { MyMessageBox.ShowBox("MEMBERSHIP REQUIRED", "ERROR"); return; } if (parentForm.calSubTotal >= 50) { if (parentForm.eDiscount1 == false) { InputCashierID inputCashierForm = new InputCashierID(1); inputCashierForm.parentForm1 = this.parentForm; inputCashierForm.parentForm2 = this; inputCashierForm.ShowDialog(); } else { rowCount = parentForm.dataGridView1.RowCount; for (int i = 0; i < rowCount; i++) { if (Convert.ToString(parentForm.dataGridView1.Rows[i].Cells[7].Value) == "B4UGIFTCARD1" | Convert.ToString(parentForm.dataGridView1.Rows[i].Cells[7].Value) == "B4UGIFTCARD2" | Convert.ToString(parentForm.dataGridView1.Rows[i].Cells[7].Value) == "B4UGIFTCARD3") { } else if (Convert.ToDouble(parentForm.dataGridView1.Rows[i].Cells[4].Value) == 0 & Convert.ToDouble(parentForm.dataGridView1.Rows[i].Cells[3].Value) > 0) { qty = Convert.ToInt16(parentForm.dataGridView1.Rows[i].Cells[2].Value); discountPrice = Convert.ToDouble(parentForm.dataGridView1.Rows[i].Cells[3].Value) * 0.75; price = qty * Math.Round(discountPrice, 2, MidpointRounding.AwayFromZero); parentForm.dataGridView1.Rows[i].Cells[4].Value = Math.Round(discountPrice, 2, MidpointRounding.AwayFromZero); parentForm.dataGridView1.Rows[i].Cells[5].Value = price; parentForm.dataGridView1.Rows[i].Cells[6].Value = Math.Round(price * parentForm.storeTaxRate, 2, MidpointRounding.AwayFromZero); } } parentForm.Calculation(); parentForm.Calculating_Saved_Amount(); parentForm.Display_Item_Price(0); this.Close(); parentForm.Enabled = true; parentForm.richTxtUpc.Select(); parentForm.richTxtUpc.Focus(); } } else { MyMessageBox.ShowBox("SUBTOTAL MUST EQUAL $5O OR MORE", "ERROR"); return; } }
/// <summary> /// Handles the Click event of the btnSocialMediaDiscount control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> public void btnSocialMediaDiscount_Click(object sender, EventArgs e) { if (parentForm.smDiscount == false) { InputCashierID inputCashierForm = new InputCashierID(0); inputCashierForm.parentForm1 = this.parentForm; inputCashierForm.parentForm2 = this; inputCashierForm.ShowDialog(); } else { rowCount = parentForm.dataGridView1.RowCount; for (int i = 0; i < rowCount; i++) { if (Convert.ToString(parentForm.dataGridView1.Rows[i].Cells[7].Value) == "B4UGIFTCARD1" | Convert.ToString(parentForm.dataGridView1.Rows[i].Cells[7].Value) == "B4UGIFTCARD2" | Convert.ToString(parentForm.dataGridView1.Rows[i].Cells[7].Value) == "B4UGIFTCARD3") { } else if (Convert.ToDouble(parentForm.dataGridView1.Rows[i].Cells[4].Value) == 0 & Convert.ToDouble(parentForm.dataGridView1.Rows[i].Cells[3].Value) > 0) { qty = Convert.ToInt16(parentForm.dataGridView1.Rows[i].Cells[2].Value); discountPrice = Convert.ToDouble(parentForm.dataGridView1.Rows[i].Cells[3].Value) * 0.95; price = qty * Math.Round(discountPrice, 2, MidpointRounding.AwayFromZero); parentForm.dataGridView1.Rows[i].Cells[4].Value = Math.Round(discountPrice, 2, MidpointRounding.AwayFromZero); parentForm.dataGridView1.Rows[i].Cells[5].Value = price; parentForm.dataGridView1.Rows[i].Cells[6].Value = Math.Round(price * parentForm.storeTaxRate, 2, MidpointRounding.AwayFromZero); } } parentForm.Calculation(); parentForm.Calculating_Saved_Amount(); parentForm.Display_Item_Price(0); this.Close(); parentForm.Enabled = true; parentForm.richTxtUpc.Select(); parentForm.richTxtUpc.Focus(); } }