本文整理汇总了C#中Customer.find方法的典型用法代码示例。如果您正苦于以下问题:C# Customer.find方法的具体用法?C# Customer.find怎么用?C# Customer.find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customer
的用法示例。
在下文中一共展示了Customer.find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: validate
public bool validate()
{
this.lblValidStart.Visible = false;
this.lblValidEnd.Visible = false;
this.lblIdValid.Visible = false;
if (!this.txtID.Text.Equals(""))
{
Customer customer = new Customer();
customer.find("(c.[PeopleID]='" + this.txtID.Text + "')");
if (customer.PeopleID == null)
{
this.lblIdValid.Visible = true;
return false;
}
}
if (!"".Equals(this.txtStartDate.Text.Trim()))
{
if (DateTime.MinValue == this.validateDate(this.txtStartDate.Text))
{
this.lblValidStart.Visible = true;
return false;
}
if (DateTime.MinValue == this.validateDate(this.txtEndDate.Text))
{
this.lblValidEnd.Visible = true;
return false;
}
}
return true;
}
示例2: btnCreate_Click
protected void btnCreate_Click(object sender, EventArgs e)
{
try
{
Customer customer = new Customer();
customer.find("(c.[PeopleID]='" + this.tbID.Text + "')");
if (customer.PeopleID != null)
{
throw new Exception("Already Exists");
}
customer.PeopleID = this.tbID.Text;
customer.FirstName = this.lblFirstName.Text;
customer.LastName = this.lblLastName.Text;
customer.PlanId = this.ddlMealPlan.SelectedValue;
customer.CustomerType = this.ddlCustType.SelectedValue;
MealPlan plan = new MealPlan();
plan.find("planID = '" + customer.PlanId + "'");
if (plan.PlanId != null)
{
customer.CurrentMeals = plan.MealsPerWeek;
customer.MunchMoney = plan.MunchMoney;
}
customer.create(this.txtNotes.Text);
this.prepareError("Created!!");
this.txtNotes.Text = "";
}
catch (Exception exception)
{
this.lblError.Text = exception.Message;
this.lblError.Visible = true;
}
this.tbID.Focus();
}
示例3: btnFindId_Click
protected void btnFindId_Click(object sender, EventArgs e)
{
try
{
People people = new People();
people.find("[people_id] = '" + this.tbID.Text + "'");
this.Image1.ImageUrl = this.pictureLocation + this.pictureDefault;
if (people.PeopleId != null)
{
string path = this.pictureLocation + this.tbID.Text + this.pictureFormat;
if (MyFile.Exists(path))
{
this.Image1.ImageUrl = path;
}
this.lblFirstName.Text = people.FirstName;
this.lblLastName.Text = people.LastName;
}
else
{
this.lblFirstName.Text = "";
this.lblLastName.Text = "";
throw new Exception("Invalid ID");
}
Customer customer = new Customer();
customer.find("(c.[PeopleID]='" + this.tbID.Text + "')");
if (customer.PeopleID != null)
{
throw new Exception("Already Exists");
}
this.prepareError(null);
}
catch (Exception exception)
{
this.prepareError(exception.Message);
}
this.tbID.Focus();
}
示例4: btnFindId_Click
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();
//.........这里部分代码省略.........