public void MunchChargeOnlySetup(bool isCafe, Customer customer) { bool flag = ((customer == null) || ((customer.MunchMoney <= 0M) && customer.isStudent())) || customer.isInactive(); string str = "Munch Money"; bool flag2 = false; if ((customer != null) && customer.isEmployee()) { str = "Employee Charge"; flag2 = true; } this.lblCustType.Visible = isCafe; this.lblCustTypeValue.Visible = isCafe; this.lblMealPlan.Visible = isCafe; this.lblMealPlanValue.Visible = isCafe; if (flag) { isCafe = false; } this.chkSpecial.Visible = isCafe; this.lblMMAvailable.Visible = !flag; this.lblMMAvailableLabel.Visible = !flag; this.lblPriceOfMeal.Visible = isCafe; this.txtCostPerMeal.Visible = isCafe; this.lblMeal.Visible = isCafe; this.lblMealValue.Visible = isCafe; this.lblNumberOfGuests.Visible = isCafe; this.txtNumGuests.Visible = isCafe; this.txtTotalCharge.ReadOnly = isCafe; if (isCafe) { this.txtTotalCharge.BorderStyle = BorderStyle.None; } else { this.txtTotalCharge.BorderStyle = BorderStyle.NotSet; } this.btnAddMunchCharge.Visible = !flag; this.lblTotalCharge.Visible = !flag; this.txtTotalCharge.Visible = !flag; if (flag) { this.lblEnterGuests.Text = "No " + str; } else if (isCafe) { this.lblEnterGuests.Text = "Enter Guests on " + str; } else { this.lblEnterGuests.Text = "Enter Charges on " + str; } if (flag2) { this.lblMMAvailableLabel.Text = "Current " + str + ":"; } else { this.lblMMAvailableLabel.Text = str + " Available:"; } }
protected void btnFindId_Click(object sender, EventArgs e) { this.lblMunchError.Visible = false; this.transactionCompleted(false); string path = null; this.txtNumGuests.Text = "0"; this.txtTotalChargeCopy.Text = "0"; this.lblError.Visible = false; this.lblEmpChargeValue.Visible = false; this.lblEmpCharge.Visible = false; this.lblCurMeals.Visible = false; this.lblCurMealsValue.Visible = false; this.lblMunchError.Visible = false; this.Image1.ImageUrl = this.pictureLocation + this.pictureDefault; this.lblIdNumValue.Text = this.tbID.Text; Customer customer = new Customer(); customer.find("(c.[PeopleID]='" + this.tbID.Text + "')"); Location location = (Location)this.Session["location"]; this.MunchChargeOnlySetup(location.isCafe(), customer); if (customer.PeopleID != null) { if (customer.isEmployee()) { customer.MealCost = this.empMealCost; } else { customer.MealCost = this.mealCost; } path = this.pictureLocation + this.tbID.Text + this.pictureFormat; if (MyFile.Exists(path)) { this.Image1.ImageUrl = path; } this.lblFirstName.Text = customer.FirstName; this.lblLastName.Text = customer.LastName; this.lblCustTypeValue.Text = customer.CustomerType; if (customer.isEmployee()) { this.lblMMAvailable.Text = customer.EmployeeCharges.ToString("#,##0.00"); } else if (customer.isStudent()) { this.lblMMAvailable.Text = customer.MunchMoney.ToString("#,##0.00"); } else { this.lblMMAvailable.Text = ""; } this.lblMealPlanValue.Text = customer.PlanId; this.lblCurMealsValue.Text = customer.CurrentMeals.ToString(); this.lblEmpChargeValue.Text = customer.EmployeeCharges.ToString("#,##0.00"); this.Session["customer"] = customer; string id = this.empMealCost.Id; string description = this.empMealCost.Description; string text3 = customer.MealCost.Id; ICharge charge = null; if (location.isCafe()) { if (customer.isEmployee()) { charge = new CafeEmpCharge(); this.lblEmpCharge.Visible = true; this.lblEmpChargeValue.Visible = true; } else { charge = new CafeStudentCharge(); this.lblCurMeals.Visible = true; this.lblCurMealsValue.Visible = true; } } else { charge = new GenericCharge(); } try { charge.Execute(customer); } catch (Exception exception) { this.lblError.Text = exception.Message; this.lblError.Visible = true; } } else { this.lblError.Visible = true; this.lblFirstName.Text = ""; this.lblLastName.Text = ""; } this.lblCurMealsValue.Text = customer.CurrentMeals.ToString(); this.lblEmpChargeValue.Text = customer.EmployeeCharges.ToString("#,##0.00"); if (location.isCafe() && customer.isEmployee()) { this.lblMMAvailable.Text = this.lblEmpChargeValue.Text; } this.tbID.Text = ""; this.tbID.Focus(); if (!location.isCafe() && this.txtTotalCharge.Visible) { this.txtTotalCharge.Focus(); } }