本文整理汇总了C#中Receipt类的典型用法代码示例。如果您正苦于以下问题:C# Receipt类的具体用法?C# Receipt怎么用?C# Receipt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Receipt类属于命名空间,在下文中一共展示了Receipt类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:Bryanoh,项目名称:BSPetShopWebApp,代码行数:27,代码来源:Buypage.aspx.cs
示例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;
}
开发者ID:shenoyroopesh,项目名称:CateringPlus,代码行数:7,代码来源:ReceiptScreen.cs
示例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);
}
开发者ID:nblaurenciana-md,项目名称:Websites,代码行数:8,代码来源:Overpayment.cs
示例4: Insert
public void Insert(Receipt receipt)
{
using (var context = new TrianglesDataContext())
{
context.Receipts.InsertOnSubmit(receipt);
context.SubmitChanges();
}
}
开发者ID:G-Rad,项目名称:Triangles,代码行数:8,代码来源:ReceiptRepository.cs
示例5: btnNew_Click
private void btnNew_Click(object sender, EventArgs e)
{
receipt = new Receipt();
loadOutstandingBills();
bindReceiptToUI(receipt);
cmbBills.Text = "";
lblCustomerName.Text = "";
}
开发者ID:shenoyroopesh,项目名称:CateringPlus,代码行数:9,代码来源:ReceiptScreen.cs
示例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);
}
}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:10,代码来源:AjaxViewMain.ascx.cs
示例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;
}
开发者ID:Blurpy-the-RABID,项目名称:ReceiptCalculator,代码行数:56,代码来源:Interface.cs
示例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();
}
}
开发者ID:G-Rad,项目名称:Triangles,代码行数:12,代码来源:ReceiptRepository.cs
示例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);
}
}
开发者ID:nr222cb,项目名称:vt14-1-2-kassakvitto,代码行数:12,代码来源:Kassakvitto.aspx.cs
示例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;
}
开发者ID:asanyaga,项目名称:BuildTest,代码行数:52,代码来源:ReceiptExportDocumentRepository.cs
示例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);
}
}
开发者ID:Guepen,项目名称:vt14-1-2-kassakvitto,代码行数:13,代码来源:Default.aspx.cs
示例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);
}
开发者ID:mxoconnell,项目名称:GGJ_2016,代码行数:49,代码来源:Serializing_an_object_graph.cs
示例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;
}
开发者ID:jrxFive,项目名称:E-Receipt,代码行数:49,代码来源:About.aspx.cs
示例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());
}
开发者ID:absorb-coding-exercise-taker,项目名称:absorb-coding-challenge,代码行数:15,代码来源:ReceiptTest.cs
示例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;
}
开发者ID:NoelKyaw,项目名称:Facility-Booking-System,代码行数:15,代码来源:ReceiptReport.cs
示例16: Edit
public ActionResult Edit(Receipt model)
{
using (CTSContext context = new CTSContext())
{
var receipts = context.Receipts.FirstOrDefault(p => p.Id == model.Id);
receipts.BelongCompany = context.CourierCompanys.FirstOrDefault(p => p.Id == model.BelongCompany.Id);
receipts.CourierNumber = model.CourierNumber;
receipts.CustomerAddress = model.CustomerAddress;
receipts.CustomerName = model.CustomerName;
receipts.CustomerPhone = model.CustomerPhone;
receipts.Remark = model.Remark;
context.SaveChanges();
return Json(new AjaxResult("编辑成功", AjaxResultType.Success));
}
}
开发者ID:Deson621,项目名称:demo,代码行数:15,代码来源:ReceiptController.cs
示例17: PrintReceipt
private void PrintReceipt(Receipt receipt)
{
receipt.ReceiptDetails = TheReceiptDetailMgr.SummarizeReceiptDetails(receipt.ReceiptDetails);
IList<object> list = new List<object>();
list.Add(receipt);
list.Add(receipt.ReceiptDetails);
//TheReportReceiptNoteMgr.FillValues(receipt.ReceiptTemplate, list);
//报表url
string strUrl = TheReportMgr.WriteToFile(receipt.ReceiptTemplate, list);
//客户端打印
//如果在UpdatePanel中调用JavaScript需要使用 ScriptManager.RegisterClientScriptBlock
ScriptManager.RegisterClientScriptBlock(this, GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + strUrl + "'); </script>", false);
//Page.ClientScript.RegisterStartupScript(GetType(), "method", " <script language='javascript' type='text/javascript'>PrintOrder('" + strUrl + "'); </script>");
}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:15,代码来源:AjaxViewMain.ascx.cs
示例18: ItPrintsABasicReceiptItemWithDecimals
public void ItPrintsABasicReceiptItemWithDecimals()
{
var receipt = new Receipt
{
ItemPrices = new List<ItemPrice>
{
new ItemPrice { Name = "Apple", Price = 0.75M}
},
ScannedItems = new List<ScannedItem>
{
new ScannedItem() { Name="Apple" }
}
};
var receiptPrinter = new ReceiptPrinter(receipt);
Assert.AreEqual("Apple x1\t$0.75", receiptPrinter.PrintItems().Trim());
}
开发者ID:absorb-coding-exercise-taker,项目名称:absorb-coding-challenge,代码行数:16,代码来源:ReceiptPrintTest.cs
示例19: ItCalculatesATotalWithDuplicateItem
public void ItCalculatesATotalWithDuplicateItem()
{
var receipt = new Receipt()
{
ScannedItems = new List<ScannedItem>()
{
new ScannedItem { Name = "Apple" },
new ScannedItem { Name = "Apple" },
},
ItemPrices = new List<ItemPrice>()
{
new ItemPrice() { Name = "Apple", Price = 1 }
}
};
Assert.AreEqual(2, receipt.GetTotal());
}
开发者ID:absorb-coding-exercise-taker,项目名称:absorb-coding-challenge,代码行数:16,代码来源:ReceiptTest.cs
示例20: InitPageParameter
public void InitPageParameter(Receipt receipt)
{
IList<ReceiptDetail> receiptDetailList = new List<ReceiptDetail>();
if (receipt.ReceiptDetails != null && receipt.ReceiptDetails.Count > 0)
{
foreach (ReceiptDetail receiptDetail in receipt.ReceiptDetails)
{
if (receiptDetail.HuId != null)
{
receiptDetailList.Add(receiptDetail);
}
}
}
this.GV_List.DataSource = receiptDetailList;
this.GV_List.DataBind();
}
开发者ID:Novthirteen,项目名称:yfkey-scms,代码行数:16,代码来源:ReceiptList.ascx.cs
注:本文中的Receipt类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论