Example #1
0
        void acceptGroupExecute()
        {
            Customers     c  = new Customers();
            ServiceGroups sg = new ServiceGroups();
            long          cIDTemp;

            cIDTemp = newWorksheets[0].customerID;
            //c = SQLConnection.Execute.CustomersTable.Single(cust => cust.customerID == cIDTemp);
            c.serviceCounter += 1;

            sg.deposit = deposit;
            //SQLConnection.Execute.ServiceGroupsTable.AddObject(sg);
            //db.SaveChanges();
            foreach (ServiceWorksheets item in newWorksheets)
            {
                item.groupID = sg.serviceGroupID;
                //SQLConnection.Execute.ServiceWorksheetsTable.AddObject(item);
            }
            SQLConnection.Execute.SaveDb();
            foreach (ServiceWorksheets item in newWorksheets)
            {
                new Print.printService(item, Print.servicePrintType.bringIn);
            }
            AppMessages.ServiceGroupClosed.Send(newWorksheets);
        }
Example #2
0
        public void TestFixWeight()
        {
            Assert.AreEqual(ServiceGroups.DEFAULT_WEIGHT_VALUE, ServiceGroups.FixWeight(null));
            Assert.AreEqual(ServiceGroups.MIN_WEIGHT_VALUE, ServiceGroups.FixWeight(ServiceGroups.MIN_WEIGHT_VALUE));
            Assert.AreEqual(ServiceGroups.MAX_WEIGHT_VALUE, ServiceGroups.FixWeight(ServiceGroups.MAX_WEIGHT_VALUE));

            Assert.AreEqual(ServiceGroups.MIN_WEIGHT_VALUE + 1, ServiceGroups.FixWeight(ServiceGroups.MIN_WEIGHT_VALUE + 1));
            Assert.AreEqual(ServiceGroups.MAX_WEIGHT_VALUE - 1, ServiceGroups.FixWeight(ServiceGroups.MAX_WEIGHT_VALUE - 1));

            Assert.AreEqual(ServiceGroups.DEFAULT_WEIGHT_VALUE, ServiceGroups.FixWeight(ServiceGroups.MIN_WEIGHT_VALUE - 1));
            Assert.AreEqual(ServiceGroups.MAX_WEIGHT_VALUE, ServiceGroups.FixWeight(ServiceGroups.MAX_WEIGHT_VALUE + 1));
        }
Example #3
0
 /// <summary>
 /// Получение ИД брони для определённой услуги
 /// </summary>
 /// <param name="serviceID">ИД услуги, ИД брони которой требуется получить</param>
 /// <returns>ИД брони для запрошенной услуги</returns>
 public long GetBookID(int serviceID)
 {
     return(ServiceGroups.Find(sg => sg.GroupType == ServiceGroupType.SingleBook && sg.ServiceRef.Contains(serviceID)).BookID.Value);
 }