//Methods public string AddReceipt(Receipt receipt) { try { if (receipt != null) { bool IsExists = false; foreach (var i in ReceiptList) { if (i.receipt_sn == receipt.receipt_sn) { i.amount += receipt.amount; IsExists = true; break; } } if (!IsExists) ReceiptList.Add(receipt); return AddToReceipttOK; } else return AddToReceiptNG; } catch(Exception e) { return AddToReceiptNG; } }
private void CreateNewReceipt() { CurrentPurchase = new PurchasedProductModel(); CurrentPurchase.Label = $"{++_receiptCounter}"; ReceiptList.Add(CurrentPurchase); ReceiptIndex = ReceiptList.Count() - 1; }
//Returns product information from the list public ReceiptList GetProductInfo(int Idproduct) { var res = shopContext.Products.Join(shopContext.Categories, x => x.Idcategory, y => y.Idcategory, (x, y) => new { Discount = x.Discount, Vat = x.IdcategoryNavigation.Vat, Idproduct = x.Idproduct, Idcategory = x.Idcategory, ProductName = x.ProductName, UnitPrice = x.UnitPrice, UnitQuantity = x.UnitQuantity, }) .Where(x => x.Idproduct == Idproduct); ReceiptList receiptLists = new ReceiptList(); foreach (var item in res) { receiptLists.Discount = item.Discount; receiptLists.Idcategory = item.Idcategory; receiptLists.Idproduct = item.Idproduct; receiptLists.ProductName = item.ProductName; receiptLists.UnitPrice = Math.Round(item.UnitPrice, 2);//Because in database i have type money which is not rounded to two places after pointer receiptLists.UnitQuantity = item.UnitQuantity; receiptLists.Vat = item.Vat; } return(receiptLists); }
private void Pay() { ReceiptList.Remove(CurrentPurchase); if (ReceiptList.Count == 0) { CreateNewReceipt(); } else { SelectPreviousReceipt(); } }
protected void ReceiptBind(bool current = false) { if (current) { TabPlay("receipt"); } int pageCount = 0; List <WMUserReceipts> list = WMUserReceipts.GetList(out pageCount, UserId, ReceiptPager.CurrentPageIndex - 1, ReceiptPager.PageSize); ReceiptList.DataSource = list; ReceiptList.DataBind(); ReceiptPager.RecordCount = pageCount; }
public ReceiptForm() { InitializeComponent(); Receipt = new ReceiptExternal(); ReceiptV2 = new Receipt.Receipt(); ReceiptList = new ReceiptExternalList(); ReceiptListV2 = new ReceiptList(); reFunc = new ReceiptEndPointFunctionality(); reFunc.ReturnMessageXml += ReturnMessageXmlHandler; SaveReceipt = new ReceiptExternal(); UpdateReceipt = new Receipt.Receipt(); receiptSearchShipment = new ReceiptSearchExternalShipment(); receiptV2SearchShipment = new ReceiptV2SearchExternalShipment(); receiptSaveShipment = new ReceiptSaveExternalShipment(); receiptUpdateShipment = new ReceiptUpdateExternalShipment(); receiptListSearchShipment = new ReceiptListSearchExternalShipment(); receiptListV2SearchShipment = new ReceiptListV2SearchExternalShipment(); SetupObjectsForPropertyGrid(); }
public ReceiptAgencyFormEC2() { InitializeComponent(); ReceiptExt = new ReceiptExternal(); ReceiptV2 = new ReceiptAgencyEC2.Receipt(); ReceiptList = new ReceiptExternalList(); ReceiptListV2 = new ReceiptList(); RaeFunc = new ReceiptAgencyEndpointFunctionalityEC2(); RaeFunc.ReturnMessageXml += ReturnMessageXmlHandler; SaveReceipt = new ReceiptExternal(); UpdateReceipt = new ReceiptAgencyEC2.Receipt(); SetupObjectsForPropertyGrid(); ReceiptSearchShipment = new ReceiptSearchExternalShipmentEC2(); ReceiptV2SearchShipment = new ReceiptV2SearchExternalShipmentEC2(); ReceiptSaveShipment = new ReceiptSaveExternalShipmentEC2(); ReceiptUpdateShipment = new ReceiptUpdateExternalShipmentEC2(); ReceiptListSearchShipment = new ReceiptListSearchExternalShipmentEC2(); ReceiptListV2SearchShipment = new ReceiptListV2SearchExternalShipmentEC2(); TestShipment = new BaseShipment(); }
/// <summary> /// 获取数据 /// </summary> public void GetDate() { try { List <SeatManage.ClassModel.AMS_Advertisement> modelList = SeatManage.Bll.AdvertisementOperation.GetAdList(null, SeatManage.EnumType.AdType.PrintReceiptAd); ReceiptList.Clear(); foreach (SeatManage.ClassModel.AMS_Advertisement model in modelList) { SeatManage.ClassModel.PrintReceiptInfo view = SeatManage.ClassModel.PrintReceiptInfo.ToModel(model.AdContent); view.AdContent = model.AdContent; view.ID = model.ID; ReceiptList.Add(view); } } catch (Exception ex) { ErrorMessage = ex.Message; SeatManage.SeatManageComm.WriteLog.Write("获取学校通知失败" + ex.Message); } }
/// <summary> /// Fügt der Konfigruationsdatei eine neue Rechnung hinzu. /// </summary> /// <param name="receipt"></param> public void AddReceipt(Receipt receipt) { ReceiptList.Add(receipt); _configManager.SaveReceiptChanges(); }
/// <summary> /// Holt alle Rechnungen aus der Config /// </summary> public void GetReceipt() { ReceiptList.Clear(); ReceiptList = _configManager.GetReceipts(); }
public void CreateInput(IStream stream) { var streamId = StreamIdentifier.Create(Owner.Owner.Owner.Id, Owner.Owner.Id, stream.Map); ReceiptList.Add(streamId); }