void AddAttendanceByCash(Client client, DateTime dateVisit, float price)
        {
            //string priceString = price.ToString().Replace(',', '.');

            string querry = string.Format(
                dtFormatter,
                "INSERT INTO `drivefitness`.`attendance` (`clientid`, `datevisit`, `payment`, `attprice`) " +
                "VALUES ('{0}', '{1}', '{2}', '{3}');",
                client.ID,
                dateVisit,
                price,
                price
                //priceString,
                //priceString
                );

            string paymnt = "Наличный расчет " + price + " грн.";

            messager.SuccessMessage(
                string.Format("Посещение клиента {3} зафиксировано - {0}!{1}{1}{2}",
                              dateVisit.ToShortDateString(),
                              Environment.NewLine,
                              paymnt,
                              client
                              )
                );

            DataBaseManager.SendCommand(querry);
        }
Esempio n. 2
0
        public void AddNewGroup(string groupName)
        {
            string querry = string.Format("INSERT INTO `drivefitness`.`groups` (`groupname`) VALUES ('{0}');",
                                          groupName
                                          );

            DataBaseManager.SendCommand(querry);
            messager.SuccessMessage(string.Format("Новая группа \"{0}\" создана.", groupName));
        }
Esempio n. 3
0
        public void AddNewClient(Client client, Group group)
        {
            string querry = string.Format(dtFormatter,
                                          "INSERT INTO `drivefitness`.`clients` " +
                                          "(`groupid`, `name`, `lastname`, `birthday`, `email`, `telephone`) " +
                                          "VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}'); ",
                                          //"call add_new_client('{0}', '{1}', '{2}', '{3}', '{4}', '{5}')",
                                          group.ID,
                                          client.Name,
                                          client.LastName,
                                          client.Birthday,
                                          client.Email,
                                          client.Telephone
                                          );

            DataBaseManager.SendCommand(querry);

            messager.SuccessMessage(string.Format("Клиент \"{0}\" добавлен в базу данных.", client));
        }