本文整理汇总了C#中Receipt类的典型用法代码示例。如果您正苦于以下问题:C# Receipt类的具体用法?C# Receipt怎么用?C# Receipt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Receipt类属于命名空间,在下文中一共展示了Receipt类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button_Buy_Click
// BUY Cart
protected void Button_Buy_Click(object sender, EventArgs e)
{
bool phoneNumExists = false;
if (phoneNumExists)
{
// Make reciept on phone number
// Make customer
// Make reciept
}
else
{
// Make NEW CUSTOMER and Reciept on NEW CUSTOMER PHONE NUMBER
Customer newCust = new Customer(null, TextBox_fullName.Text, TextBox_address.Text, TextBox_phoneNumNew.Text, TextBox_email.Text, 0);
List<Animal> animals = new List<Animal>();
foreach (Animal a in selectedAnimals)
{
animals.Add(a);
}
Receipt newReceipt = new Receipt(animals, new DateTime(), 0);
PersistenceController controller = Persistence.PersistenceController.Instance();
controller.makeReceipt(newReceipt, newCust);
}
}
示例2: bindReceiptToUI
private void bindReceiptToUI(Receipt r)
{
lblReceiptNoValue.Text = r.Id == 0 ? "[New]" : r.Id.ToString();
txtAmount.Text = r.Amount.ToString();
dtDate.Value = r.Date==null? DateTime.Today: (DateTime)r.Date;
cmbBills.SelectedItem = r.Bill;
}
示例3: Overpayment
public Overpayment(int overpayment_id, int receipt_id, decimal total, DateTime overpayment_date_added, int staff_id)
{
this.overpayment_id = overpayment_id;
this.receipt = new Receipt(receipt_id);
this.total = total;
this.overpayment_date_added = overpayment_date_added;
this.staff = new Staff(staff_id);
}
示例4: Insert
public void Insert(Receipt receipt)
{
using (var context = new TrianglesDataContext())
{
context.Receipts.InsertOnSubmit(receipt);
context.SubmitChanges();
}
}
示例5: btnNew_Click
private void btnNew_Click(object sender, EventArgs e)
{
receipt = new Receipt();
loadOutstandingBills();
bindReceiptToUI(receipt);
cmbBills.Text = "";
lblCustomerName.Text = "";
}
示例6: InitPageParameter
public void InitPageParameter(Receipt receipt, bool printReceipt)
{
this.ReceiptNo = receipt.ReceiptNo;
this.ucEdit.InitPageParameter(ReceiptNo);
this.ucList.InitPageParameter(receipt);
if (printReceipt)
{
this.PrintReceipt(receipt);
}
}
示例7: getReceiptEntry
// This method will go through the process of acquiring the data for an individual receipt, and then returning the finished receipt.
public Receipt getReceiptEntry(string receiptOwner, int receiptNumber)
{
Receipt receipt = new Receipt(receiptOwner, receiptNumber);
Console.WriteLine("\nReceipt {0}{1}:", receiptOwner, receiptNumber);
Console.Write("Enter Receipt {0}{1}'s Communal Total: ", receiptOwner, receiptNumber);
double communalTotal = Convert.ToDouble(Console.ReadLine());
receipt.getCommunalTotal(communalTotal);
Console.Write("\nAre there any individual items that are not communal? (y/n): ");
string answer = Console.ReadLine().ToUpper();
if (answer == "Y") {
Console.WriteLine("Enter the first initial of the persons to whom the item(s) was bought for (A / V / M).");
Console.Write("If multiple persons have items on this Receipt, separate their initials with a space: ");
string indivItemOwner = Console.ReadLine().ToUpper();
string[] initials = indivItemOwner.Split(' ');
for (int j = 0; j < initials.Length; j++) {
indivItemOwner = initials[j];
switch (initials[j]) {
case "A":
Console.Write("\nEnter the total amount (including tax) that Andy owes for his items on Receipt {0}{1}: ", receiptOwner, receiptNumber);
receipt.getIndivTotal(indivItemOwner, Convert.ToDouble(Console.ReadLine()));
break;
case "V":
Console.Write("\nEnter the total amount (including tax) that Vinny owes for his items on Receipt {0}{1}: ", receiptOwner, receiptNumber);
receipt.getIndivTotal(indivItemOwner, Convert.ToDouble(Console.ReadLine()));
break;
case "M":
Console.Write("\nEnter the total amount (including tax) that Mike owes for his items on Receipt {0}{1}: ", receiptOwner, receiptNumber);
receipt.getIndivTotal(indivItemOwner, Convert.ToDouble(Console.ReadLine()));
break;
default:
Console.WriteLine("Error: Unrecognized first initial.");
break;
}
}
}
// Now we display all of the data entered for the current receipt.
Console.WriteLine("\nReceipt {0}{1}:", receiptOwner, receiptNumber);
Console.WriteLine("Communal Total = {0}", receipt.returnCommunalTotal());
if (receiptOwner == "A") {
Console.WriteLine("Additional Amount Owed By Vince: {0}", receipt.returnVTotal());
Console.WriteLine("Additional Amount Owed By Mike: {0}", receipt.returnMTotal());
}
else if (receiptOwner == "V") {
Console.WriteLine("Additional Amount Owed By Andy: {0}", receipt.returnATotal());
Console.WriteLine("Additional Amount Owed By Mike: {0}", receipt.returnMTotal());
}
else if (receiptOwner == "M") {
Console.WriteLine("Additional Amount Owed By Andy: {0}", receipt.returnATotal());
Console.WriteLine("Additional Amount Owed By Vince: {0}", receipt.returnVTotal());
}
return receipt;
}
示例8: Update
public void Update(Receipt receipt)
{
using (var context = new TrianglesDataContext())
{
var existedReceipt = context.Receipts.First(x => x.Id == receipt.Id);
existedReceipt.Description = receipt.Description;
existedReceipt.Payer = receipt.Payer;
context.SubmitChanges();
}
}
示例9: Calculate_Click
protected void Calculate_Click(object sender, EventArgs e)
{
if (IsValid)
{
Receipt receiptInstance = new Receipt(Double.Parse(TotalSum.Text));
ReceiptPanel.Visible = true;
SubTotal.Text = String.Format("{0:c}", receiptInstance.Subtotal);
DiscountRate.Text = String.Format("{0:p0}", receiptInstance.DiscountRate);
Discount.Text = String.Format("{0:c}", receiptInstance.MoneyOff);
Total.Text = String.Format("{0:c}", receiptInstance.Total);
}
}
示例10: Map
public ReceiptExportDocument Map(Receipt receipt)
{
var mapto = new ReceiptExportDocument();
var order = _mainOrderRepository.GetById(receipt.DocumentParentId);
string orderExternalRef = "";
string outletCode = "";
string salesmanCode = "";
string shipToAddress = "";
Guid orderId;
if (order != null)
{
orderExternalRef = order.ExternalDocumentReference;
mapto.OrderTotalGross = order.TotalGross;
mapto.OrderNetGross = order.TotalNet;
}
if (order != null && order.DocumentIssuerCostCentre is DistributorSalesman)
{
salesmanCode = order.DocumentIssuerCostCentre.CostCentreCode;
}
else if(order != null && order.DocumentRecipientCostCentre is DistributorSalesman)
{
salesmanCode = order.DocumentRecipientCostCentre.CostCentreCode;
}
if (order != null && order.IssuedOnBehalfOf!=null)
{
outletCode = order.IssuedOnBehalfOf.CostCentreCode;
}
if (order != null)
{
shipToAddress = order.ShipToAddress;
}
mapto.Id = receipt.Id;
mapto.InvoiceRef = receipt.InvoiceId.ToString();
mapto.OrderExternalRef = orderExternalRef;
mapto.OutletCode = outletCode;
mapto.ReceiptRef = receipt.DocumentReference;
mapto.SalesmanCode = salesmanCode;
mapto.PaymentDate = receipt.DocumentDateIssued;
mapto.ShipToAddress = shipToAddress;
mapto.RouteName = GetOnBehalfOfCCRouteName(order.Id);
mapto.LineItems = receipt.LineItems.Select(s => MapItem(s)).ToList();
return mapto;
}
示例11: Send_Click
protected void Send_Click(object sender, EventArgs e)
{
if (IsValid)
{
Output.Visible = true;
var receipt = new Receipt(double.Parse(Input.Text));
Total.Text = String.Format("{0:C}", receipt.Subtotal);
Discount.Text = String.Format("{0:C}", receipt.MoneyOff);
PayValue.Text = String.Format("{0:C}", receipt.Total);
DiscountRate.Text = String.Format("{0:P0}", receipt.DiscountRate);
}
}
示例12: Start
void Start () {
var address = new Address
{
street = "123 Tornado Alley\nSuite 16",
city = "East Westville",
state = "KS"
};
var receipt = new Receipt
{
receipt = "Oz-Ware Purchase Invoice",
date = new DateTime(2007, 8, 6),
customer = new Customer
{
given = "Dorothy",
family = "Gale"
},
items = new Item[]
{
new Item
{
part_no = "A4786",
descrip = "Water Bucket (Filled)",
price = 1.47M,
quantity = 4
},
new Item
{
part_no = "E1628",
descrip = "High Heeled \"Ruby\" Slippers",
price = 100.27M,
quantity = 1
}
},
bill_to = address,
ship_to = address,
specialDelivery = "Follow the Yellow Brick\n" +
"Road to the Emerald City.\n" +
"Pay no attention to the\n" +
"man behind the curtain."
};
var serializer = new Serializer();
var stringBuilder = new StringBuilder();
var stringWriter = new StringWriter(stringBuilder);
serializer.Serialize(stringWriter, receipt);
Debug.Log(stringBuilder);
}
示例13: saveFile
private String saveFile(HttpPostedFile postedFile)
{
int userID = 0;
string userName = getUserNameFromFile(postedFile);
EReceiptLINQDataContext context = new EReceiptLINQDataContext();
var lastReceiptNumber = from num in context.Receipts
select num;
int maxReceiptValue = (from c in lastReceiptNumber select c.RECEIPT_ID).Max();
string savePath = ("~/IMG/receiptImage/" + userName + "/receipt" + (maxReceiptValue + 1) + ".jpg");
DirectoryCheck(userName);
FileUpload1.SaveAs(Server.MapPath(savePath));
string pathOfFile = "http://localhost:49765/" + savePath.Substring(savePath.IndexOf("~") + 2);
Receipt receiptImage = new Receipt
{
RECEIPT_URL = pathOfFile,
UPLOAD_DATE = DateTime.Now,
};
context.Receipts.InsertOnSubmit(receiptImage);
context.SubmitChanges();
var userIDNumber = from u in context.Customers
where u.USER_NAME == userName
select u;
foreach (var x in userIDNumber)
{
userID = x.USER_ID;
break;
}
CustomerReceipt custRec = new CustomerReceipt
{
USER_ID = userID,
RECEIPT_ID = (maxReceiptValue + 1),
};
context.CustomerReceipts.InsertOnSubmit(custRec);
context.SubmitChanges();
context.Connection.Close();
Label1.Text = "Upload Successful";
return savePath;
}
示例14: ItCalculatesATotalWith1ItemDecimal
public void ItCalculatesATotalWith1ItemDecimal()
{
var receipt = new Receipt()
{
ScannedItems = new List<ScannedItem>()
{
new ScannedItem { Name = "Apple" },
},
ItemPrices = new List<ItemPrice>()
{
new ItemPrice() { Name = "Apple", Price = 0.75M }
}
};
Assert.AreEqual(0.75M, receipt.GetTotal());
}
示例15: ReceiptReport_Load
private void ReceiptReport_Load(object sender, EventArgs e)
{
string stringFormula;
BookingSystemDataSet ds = new BookingSystemDataSet();
BookingSystemDataSetTableAdapters.TransactionsTableAdapter ta = new BookingSystemDataSetTableAdapters.TransactionsTableAdapter();
ta.Fill(ds.Transactions);
stringFormula = "{Transactions.ID}=" + id.ToString();
crystalReportViewer1.SelectionFormula = stringFormula;
Receipt crpt = new Receipt();
crpt.SetDataSource(ds);
crystalReportViewer1.ReportSource = crpt;
}