public static ISale CreateSale(ISale thisSale) { if (Connect()) { try { SqlCommand Command = Connection.CreateCommand(); Command.CommandType = CommandType.StoredProcedure; Command.CommandText = "fif_sale_create"; Command.Parameters.AddWithValue("name", thisSale.Name); Command.Parameters.AddWithValue("price", thisSale.Price); Command.Parameters.AddWithValue("description", thisSale.Description); Command.Parameters.AddWithValue("size", thisSale.Size); Command.Parameters.Add("@activity_id", SqlDbType.Int, 0, "activity_id"); Command.Parameters["@activity_id"].Direction = ParameterDirection.Output; Command.ExecuteNonQuery(); thisSale.ActivityId = int.Parse(Command.Parameters["@activity_id"].Value.ToString()); Disconnect(); return thisSale; } catch (Exception) { Disconnect(); return null; } } return thisSale; }
public ISale CreateOTCSale(Guid areaId, Guid registerId, Guid userId) { var sale = Facade.CreateOTCSale(areaId, registerId, userId); _sale = sale; return(sale); }
public int ProcessTransaction(ItemType[] items, TransactionType type) { Sale transaction = null; switch (type) { case TransactionType.SALE: transaction = new Sale(items); break; case TransactionType.REFUND: transaction = new Refund(items); break; } int confCode = transaction.ProcessPayment("email"); Console.WriteLine(); Console.Write(transaction.ToString()); Console.WriteLine(); ISale sale = transaction; appointmentSales.Add(sale); return(confCode); }
public ISaleLineItem CreateSLIMessage(ISale sale, string message) { var sli = sale.SaleLineItems.Last(); sli.Message = message; return(sli); }
double MarkUp; // Наценка public Purchase(List <Catalog> rows, int quantity, ISale sale, int id_product, ref double revenue) { this.name = rows[id_product].name; rows[id_product].quantity = rows[id_product].quantity - quantity; this.MarkUp = sale.SetMarkUp(); // Если покупаемых товаров одного типа больше двух if (quantity > 2) { this.price = rows[id_product].cost * MarkUp; revenue = revenue + this.price * 2; this.quantity = 2; Purchase.ConsoleOutput(this); sale = new PurchaseTwoThingsAndMore(); this.quantity = quantity - 2; this.MarkUp = sale.SetMarkUp(); this.price = rows[id_product].cost * MarkUp; revenue = revenue + this.price * (quantity - 2); Purchase.ConsoleOutput(this); } else { this.quantity = quantity; this.price = rows[id_product].cost * MarkUp; revenue = revenue + this.price * quantity; Purchase.ConsoleOutput(this); } }
public SaleEntity(ISale iSale) { CreatedDate = iSale.CreatedDate; Customer = iSale.Customer; SaleStatus = iSale.SaleStatus; SpecialRequests = iSale.SpecialRequests; }
public PaymentEntity(ISale sale, IMember member, int paymentId = 0) { this.PaymentId = paymentId; this.Sale = sale; this.Member = member; this.Date = DateTime.Now; }
public void AddSale(int key, ISale oSale) { if (slSale == null) { slSale = new SortedList <int, ISale>(); } slSale.Add(key, oSale); }
public Payment(ISale sale, IMember member, int paymentId = 0) { this.PaymentId = paymentId; this.Sale = sale; this.Member = member; this.Date = DateTime.Now; this.ActivityType = "sale"; }
public void Sell(IPlayer player, ISale sale, Game game, Campaign campaign) { Console.WriteLine("Sayın " + player.FirstName + " " + player.LastName + ", sepetinizde bulunan " + game.GameName + " ürünü için " + sale.SaleMethodName + " yöntemiyle " + sale.SaleAmount + "TL tutarında alışverişiniz tamamlanmıştır.\t" + campaign.CampaignName + " kampanyasından faydalandınız." ); }
public decimal Price(ISale sale) { var sales = new List <ISale>() { sale }; return(Price(sales)); }
public static List<IMember> RetrieveSaleMemberList(ISale thisSale) { List<IMember> memberList = new List<IMember>(); foreach (IPayment thisPayment in thisSale.PaymentList) { memberList.Insert(0, thisPayment.Member); } return memberList; }
public IBooking CreateBooking(ISale iSale) { IBooking iBooking = bookingController.Create(iSale); iBooking = dataAccessFacade.CreateBooking(iBooking); if (iBooking.Deleted == false) { UpdateBooking(iBooking); } return iBooking; }
public Sale(ISale iSale) { Id = iSale.Id; Deleted = iSale.Deleted; LastUpdated = iSale.LastUpdated; CreatedDate = iSale.CreatedDate; Customer = iSale.Customer; SaleStatus = iSale.SaleStatus; SpecialRequests = iSale.SpecialRequests; }
public SaleModel(ICar car, IManufacture manufacture, Ifile file, ISale sale, ISellrecord sellrecord, IIncome income, ICash cash, ICheck check, ICustomer customer) { this.car = car; this.manufacture = manufacture; _file = file; _sale = sale; this.sellrecord = sellrecord; this.income = income; this.cash = cash; this.check = check; this.customer = customer; }
public FrmAddReplaceSale(ISale sale) { _sale = sale; var controls = _sale.CreateView(); controls.ForEach(c => { if (c.Name.Equals("tblAddReplace")) { ((MaterialRadioButton)c.Controls.Find("rdoCredit", true)?[0]).CheckedChanged += RdtIsChecked; } }); this.flyContainer.Controls.AddRange(controls.ToArray()); ((MaterialSingleLineTextField)this.flyContainer.Controls.Find("txtNit", true)[0]).Visible = false; }
public static bool DeactiveSale(ISale thisSale) { if (Connect()) { SqlCommand Command = Connection.CreateCommand(); Command.CommandType = CommandType.StoredProcedure; Command.CommandText = "fif_activity_delete"; Command.Parameters.AddWithValue("activity_id", thisSale.ActivityId); Command.ExecuteNonQuery(); Disconnect(); return true; } return false; }
public Form1(Form4 main) { db = new SaleRepositopy(); InitializeComponent(); LoadData(); mainForm = main; Manager manager = main.comboBox1.SelectedItem as Manager; //Текущий менеджер label2.Text = manager.FirstName; if (manager.Roots == false) { button5.Hide(); } }
public static ISale createPromo(SaleType type) { ISale instance = null; switch (type) { case SaleType.OnePlusOneEqThreeSale: instance = new OnePlusOneEqThreeSale(); break; default: break; } return(instance); }
public void DefineCovers(int numberOfCovers) { if (CurrentSale == null) { CurrentSale = System.CreateNewSale(Company.Id, CurrentEmployee.Id, Store.Id, CurrentTable.Area.Id, CurrentTable.Id, Terminal.Id, TerminalArea.Id, numberOfCovers); } else { System.ChangeCovers(Company.Id, Store.Id, TerminalArea.Id, Terminal.Id, CurrentTable.CurrentSaleOnTable.Id, numberOfCovers, CurrentEmployee.Id); } System.Dispose(); this.TasksManager.StartTask(typeof(ProcessSaleTask), new object[] { CurrentEmployee.Id, CurrentTable.Id, currentTableAreaId, CurrentSale.Id }); }
public Payment ChargePurchase(IClient payingClient, ISale purchase, Money moneyReceived) { if (purchase.IsPaid()) { throw new PurchaseIsAlreadyPaidException("The purchase is already paid"); } if (!this.MoneyIsCorrect(purchase.Cost, moneyReceived)) { throw new MoneyReceivedIsUnequalThanPurchaseCostException("Money received is unequal than the purchase cost"); } Payment payment = new Payment(payingClient, this); purchase.Payment = payment; return(payment); }
public override void OnStart(object param) { var currentEmployeeId = new Guid((param as object[])[0].ToString()); var currentTableId = new Guid((param as object[])[1].ToString()); currentTableAreaId = new Guid((param as object[])[2].ToString()); CurrentEmployee = System.GetEmployee(Company.Id, currentEmployeeId); CurrentTable = System.GetTable(Company.Id, Store.Id, currentTableAreaId, currentTableId); if ((param as object[]).Count() > 3) { var currentSaleId = new Guid((param as object[])[3].ToString()); CurrentSale = System.GetSale(Company.Id, Store.Id, Terminal.Id, TerminalArea.Id, currentSaleId); } Navigator.ActivateView(CoversView); }
public bool DeactiveSale(ISale thisSale) { //jeppes metode PaymentController paymentcontroller; try { if (SalePersistence.DeactiveSale(thisSale)) { thisSale.Activated = false; paymentcontroller = PaymentController.GetPaymentControllerInstance(); saleList.Remove(thisSale); } return false; } catch (Exception) { return false; ; } }
public ISale UpdateSale(ISale iSale) { iSale = saleController.Update(iSale); return iSale; }
public ISale CreateSale(ISale iSale) { iSale = saleController.Create(iSale); return iSale; }
public ISaleLineItem CreateSLIMessage(ISale sale, string message) { return Facade.CreateSLIMessage(Register.AreaId, Register.Id, sale.Id, message); }
public IEnumerable <ISaleLineItem> FetchSalelineItems(ISale sale) { return(Facade.FetchSalelineItems(Register.AreaId, Register.Id, Sale.Id)); }
public GetUserSalesHandler(ISale saleService) { _saleService = saleService; }
public void Add(ISale sale) { base.Create((Sale)sale); }
public void Cancel(ISale sale) { base.Delete((Sale)sale); }
public ISale CreateTableSale(Guid areaId, Guid registerId, Guid userId, Guid tableId) { var sale = Facade.CreateTableSale(areaId, registerId, userId, tableId); _sale = sale; return sale; }
public IEnumerable<ISaleLineItem> FetchSalelineItems(ISale sale) { return Facade.FetchSalelineItems(Register.AreaId, Register.Id, Sale.Id); }
public void AddSale(ISale sale) { sales.Add(sale); }
public FrmDetailSale(ISale sale) { _sale = sale; this.flyContainer.Controls.AddRange(_sale.CreateView().ToArray()); }
public void Sell(IPlayer player, ISale sale, Game game) { Console.WriteLine("Sayın " + player.FirstName + " " + player.LastName + ", sepetinizde bulunan " + game.GameName + " ürünü için " + sale.SaleMethodName + " yöntemiyle " + sale.SaleAmount + "TL tutarında alışverişiniz tamamlanmıştır."); }
public IEnumerable <ISaleLineItem> FetchSalelineItems(ISale sale) { return(MainTask.FetchSalelineItems(sale)); }
public IEnumerable<ISaleLineItem> FetchSalelineItems(ISale sale) { return MainTask.FetchSalelineItems(sale); }
public SalesEmployee(int id, string firstName, string lastName, Department department, decimal salary, ISale sale) : this(id, firstName, lastName, department, salary, new List <ISale>() { sale }) { }
public ISale DeleteSale(ISale iSale) { iSale = saleController.Delete(iSale); return iSale; }
public SaleController(ISale _ISale) { this.ISale = _ISale; }
public ISaleLineItem CreateSLIMessage(ISale sale, string message) { var sli = sale.SaleLineItems.Last(); sli.Message = message; return sli; }
public Payment PayPurchase(ISale purchase, Money money, ICashier cashier) { return(cashier.ChargePurchase(this, purchase, money)); }
private void AddSale(string[] inputToArray, ISale saleToAdd) { listofSales.Add(saleToAdd); itemsInStore[FindItemInSupplies(inputToArray)] -= 1; }
public ISaleLineItem CreateSLIMessage(ISale sale, string message) { return(Facade.CreateSLIMessage(Register.AreaId, Register.Id, sale.Id, message)); }
public void CrateNewSale(ISale sale) { SaleRepository.Add(sale); }
public void FetchTableSale(ITable table) { _sale = table.TableSales.Last() as ISale; }
public Booking(ISale iSale) { Sale = iSale; }
public bool DeleteSale(ISale iSale) { iSale = saleController.Delete(iSale); if (dataAccessFacade.DeleteSale(iSale).Deleted == true) { return true; } return false; }
public SalesEmployee(string firstName, string lastName, int id, decimal salary, Department department, ISale sale) : this(firstName, lastName, id, salary, department, new List<ISale>() { sale}) { }
public ISale UpdateSale(ISale iSale) { iSale = saleController.Update(iSale); dataAccessFacade.UpdateSale(iSale); return iSale; }
public void AddSale(ISale sale) { sales.Add(sale); sale.SetOrder(index++); }
public static void AddSale(ISale sale) { sales.Add(sale); }