Exemple #1
0
 public Options()
 {
     _db = new dbDataContext();
     _plstTimeZonesTables = _db.GetTable<playstation_timezone>();
     _timeZonesTable = _db.GetTable<timezones_t>();
     CacheDataFromDb();
 }
Exemple #2
0
 public TablesManager()
 {
     InitializeComponent();
     _db = new dbDataContext();
     _tablesList = new List<TablesMyClass>();
     _tableNamesForDataGridView = new List<MyString>();
 }
 public ClosingSessionDialog(int dID, int sId)
 {
     _db = new dbDataContext();
     _dailyId = dID;
     _sessionId = sId;
     InitializeComponent();
 }
Exemple #4
0
 public ChangeCostForm(List<string> tablesToChange, string timeZone)
 {
     timeZoneToFind = timeZone;
     db = new dbDataContext();
     playstationsToChange = tablesToChange;
     InitializeComponent();
 }
Exemple #5
0
 private void CellClickContent_Load(object sender, EventArgs e)
 {
     _currentTime = DateTime.Now;
     _db = new dbDataContext();
     GetDailySession();
     CheckSoonToCloseClients();
     TimeOutChecking();
     labelCurrentTime.Text = DateTime.Now.ToString("HH:mm:ss");
 }
Exemple #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            //              pers.AddNewPerson(personIdTextBox.Text, nameTextBox2.Text, loginTextBox3.Text,
            //                passwordTextBox4.Text, positionTextBox5.Text, phoneTextBox6.Text,
            //                additionalPhoneTextBox7.Text, birthdayDateTimePicker1.Value, homeAddressTextBox9.Text,
            //                int.Parse(salaryTextBox10.Text));

            var db = new dbDataContext();
            Table<personal_info_t> t = db.GetTable<personal_info_t>();

            var id = (from a in db.GetTable<personal_info_t>()
                orderby a.person_id ascending
                //select a.person_id).First();
                select new {a.person_id});
            dataGridView1.DataSource = id; //pers.GetAllPersonalInfos();
        }
Exemple #7
0
 private void addNewClient_Load(object sender, EventArgs e)
 {
     _currentDateTime = DateTime.Now;
     db = new dbDataContext();
     _opt = new Options();
     _db = new dbDataContext();
     StartTimer();
     OpenTables();
     if (table_numComboBox.Items.Count > 0)
     {
         table_numComboBox.SelectedIndex = 0;
     }
     else
     {
         MessageBox.Show("There is no available free consoles. Sorry for that!");
         Close();
     }
 }
Exemple #8
0
 //        private List<object> test;
 public Form1()
 {
     //            test = t;
     db = new dbDataContext();
     //            Options o = new Options();
     //            MessageBox.Show("Price of 1 plst is now " + o.GetCurrentPriceForPlaystation("1") +
     //                            "\nPrice of 2 plst is now " + o.GetCurrentPriceForPlaystation("2") +
     //                            "\nPrice of 3 plst is now " + o.GetCurrentPriceForPlaystation("3") +
     //                            "\nPrice of 4 plst is now " + o.GetCurrentPriceForPlaystation("4") +
     //                            "\nPrice of 5 plst is now " + o.GetCurrentPriceForPlaystation("5") +
     //                            "\nPrice of 6 plst is now " + o.GetCurrentPriceForPlaystation("6") +
     //                            "\nPrice of 7 plst is now " + o.GetCurrentPriceForPlaystation("7") +
     //                            "\nPrice of 8 plst is now " + o.GetCurrentPriceForPlaystation("8") +
     //                            "\nPrice of 9 plst is now " + o.GetCurrentPriceForPlaystation("9") +
     //                            "\nPrice of 11 plst is now " + o.GetCurrentPriceForPlaystation("11") +
     //                            "\nPrice of VIP2 plst is now " + o.GetCurrentPriceForPlaystation("12")
     //                );
     InitializeComponent();
     GetMainTable();
 }
Exemple #9
0
        public void GetPricesFromDb()
        {
            db = new dbDataContext();
            CurrentPlaystationPrice = new Dictionary<string, double>();
            var timezone = (from t in db.GetTable<timezones_t>()
                where t.timezone_start <= DateTime.Now.TimeOfDay
                where t.timezone_end > DateTime.Now.TimeOfDay
                select t.timezone_name).Single();

            var playstationPrice = (from pp in db.GetTable<timezones_t>()
                where pp.timezone_name == timezone
                select new
                {
                    pp.timezone_name
            //                    pp.timezone_cost_per_hour
                }).ToList();

            //            for (int i = 0; i < playstationPrice.Count; i++)
            //            {
            //                CurrentPlaystationPrice.Add(playstationPrice[i].timezone_name,
            //                    playstationPrice[i].timezone_cost_per_hour);
            //            }
            //            MessageBox.Show(CurrentPlaystationPrice.ToString());
        }
Exemple #10
0
        public void AddNewPerson(string personID, string name, string login,
                                        string password, string position, string phone, string additionalPhone,
                                        DateTime birthday, string homeAddress, int salaryPerDay)
        {
            _dataContext = new dbDataContext();
            _personalInfoTables = _dataContext.GetTable<personal_info_t>();

            //var persons = personalInfoTables.Where(person => person.additional_phone == "000000").ToList();

            personal_info_t myPerson = new personal_info_t();
            myPerson.person_id = personID;
            myPerson.name = name;
            myPerson.staff_login = login;
            myPerson.staff_password = password;
            myPerson.position = position;
            myPerson.phone = phone;
            myPerson.additional_phone = additionalPhone;
            myPerson.birthday = birthday;
            myPerson.home_address = homeAddress;
            myPerson.salary_per_day = salaryPerDay;

            _personalInfoTables.InsertOnSubmit(myPerson);
            _dataContext.SubmitChanges();
        }
Exemple #11
0
 public AllBarItemsForm(dbDataContext db)
 {
     _db = db;
     InitializeComponent();
 }
 public AddDiscountCardToSession(dbDataContext db)
 {
     _db = db;
     InitializeComponent();
 }
Exemple #13
0
 private void TimezoneRedactor_Load(object sender, EventArgs e)
 {
     db = new dbDataContext();
     RefreshTable();
 }
Exemple #14
0
 public AddItemToBar()
 {
     _db = new dbDataContext();
     InitializeComponent();
 }
 private void CreateNewConsolePoint_Load(object sender, EventArgs e)
 {
     _db = new dbDataContext();
     UpdateListBoxOfTimezones();
 }
Exemple #16
0
 public DiscountRedactor()
 {
     db = new dbDataContext();
     InitializeComponent();
 }
Exemple #17
0
 public AddNewDiscountForm()
 {
     db = new dbDataContext();
     InitializeComponent();
 }
 public AddRemoveFromDiscountForm(string ifExist)
 {
     ifAlreadyChanged = ifExist;
     db = new dbDataContext();
     InitializeComponent();
 }