public void LoadFormFunctionality() { //Вчитување на сите издадени сметки billDoc = LoadBills(); //Постапка за сите копчиња да бидат со hand при hover foreach (Button b in groupBox1.Controls.OfType <Button>()) { b.MouseEnter += (s, e) => b.Cursor = Cursors.Hand; b.MouseLeave += (s, e) => b.Cursor = Cursors.Arrow; } //Пополнување на статусната лента int dateYear = DateTime.Now.Year; copyrightContent.Text = String.Format("© {0} All rights reserved", dateYear); //Пополнување на часот и датумот changeTime(); changeDate(); //Пополнување на масите tables = new Table[20]; for (int i = 0; i < 20; i++) { tables[i] = new Table(i + 1); } //LoadName loadName(); }
private void SaveBills(BillDoc billDoc) { string filePath = "../../Content/content/bills.dat"; using (Stream stream = File.Open(filePath, FileMode.Create)) { var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); binaryFormatter.Serialize(stream, billDoc); } }
private void makeNewBill() { double price = 0; foreach (Product p in tables[tableNumber].products) { price += Convert.ToDouble(p.price * p.howMany); } BillDoc billDoc = form.billDoc; Bill newBill = new Bill(tables[tableNumber].products, String.Format("A{0:0000}", billDoc.howMany + 1), DateTime.Today.ToString("dd.MM.yyyy"), DateTime.Now.ToString("HH:mm:ss"), price); billDoc.Add(newBill); }
public void LoadFormFunctionality() { billDoc = parentForm.parentForm.billDoc; datePicker.Text = DateTime.Today.ToString("dd.MM.yyyy"); fillBills(); //Постапка за сите копчиња да бидат со hand при hover foreach (Button b in this.Controls.OfType <Button>()) { b.MouseEnter += (s, e) => b.Cursor = Cursors.Hand; b.MouseLeave += (s, e) => b.Cursor = Cursors.Arrow; } }