Esempio n. 1
0
 partial void Deleteclients_per_session_t(clients_per_session_t instance);
Esempio n. 2
0
 partial void Updateclients_per_session_t(clients_per_session_t instance);
Esempio n. 3
0
 partial void Insertclients_per_session_t(clients_per_session_t instance);
Esempio n. 4
0
		private void detach_clients_per_session_ts(clients_per_session_t entity)
		{
			this.SendPropertyChanging();
			entity.days_sessions_t = null;
		}
Esempio n. 5
0
		private void attach_clients_per_session_ts(clients_per_session_t entity)
		{
			this.SendPropertyChanging();
			entity.client_info_t = this;
		}
Esempio n. 6
0
        public void InsertClientsPerTable(string clientId)
        {
            var db = new dbDataContext();
            lock (db)
            {
                var lastInsertedDaySession = (from ls in db.GetTable<days_sessions_t>()
                    orderby ls.session_id descending
                    select ls).FirstOrDefault(); //get last added session

                var clientsPersessionTable = db.GetTable<clients_per_session_t>();
                var clientsPerSessionT = new clients_per_session_t();

                if (lastInsertedDaySession != null)
                {
                    if (clientId == Options.OptionsInstance().UsualClient)
                    {
                        clientsPerSessionT.session_id = lastInsertedDaySession.session_id;
                        clientsPerSessionT.client_id = Options.OptionsInstance().UsualClient;
                        clientsPerSessionT.payed_sum = 0;
                        clientsPersessionTable.InsertOnSubmit(clientsPerSessionT);
                        db.SubmitChanges();
                    }
                    else if (clientId != null && (!string.IsNullOrEmpty(clientId) && clientId.Length > 2))
                    {
                        IEnumerable<string> discountsArePlaying = DiscountSplitter(clientId);

                        foreach (string d in discountsArePlaying)
                        {
                            clientsPerSessionT = new clients_per_session_t
                            {
                                session_id = lastInsertedDaySession.session_id,
                                client_id = d,
                                payed_sum = 0.0
                                //---------------------------------------------------------------------------------DIVIDE BEFORE !!!!!!!!
                            };
                            clientsPersessionTable.InsertOnSubmit(clientsPerSessionT);
                            db.SubmitChanges();
                        }
                    }
                }
            }
        }