Ejemplo n.º 1
0
        public static string Send(Car car, PolicyType type)
        {
            EMail mail = new EMail();

            mail.sendMailPolicy(car, type);

            DriverCarList driverCarList = DriverCarList.getInstance();
            Driver        driver        = driverCarList.GetDriver(car);

            return(string.Concat("Полис ", type.ToString(), " отправлен на адрес ", driver.email));
        }
Ejemplo n.º 2
0
        public static string Send(Car car, PolicyType type)
        {
            EMail mail = new EMail();

            mail.sendMailPolicy(car, type);

            DriverCarList driverCarList = DriverCarList.getInstance();
            Driver driver = driverCarList.GetDriver(car);

            return string.Concat("Полис ", type.ToString(), " отправлен на адрес ", driver.email);
        }
Ejemplo n.º 3
0
        public void SendNotification()
        {
            IEnumerable<Violation> list = ViolationList.getInstance().GetViolationForAccount();

            if (list.Count() > 0)
            {
                Driver driversTo = GetDriverForSending();

                string mailText = CreateMail(list);

                EMail email = new EMail();

                email.SendNotification(driversTo, mailText, false);
            }
        }
Ejemplo n.º 4
0
        public void SendNotification()
        {
            if (DateTime.Today.Day != SEND_DAY)
                return;

            DiagCardList diagCardList = DiagCardList.getInstance();
            List<DiagCard> list = diagCardList.GetDiagCardEnds().ToList();

            int begin = 0;
            int end = 0;

            if (!ListEmpty(list))
            {
                STSList stsList = STSList.getInstance();

                while (end < list.Count)
                {
                    begin = end;
                    end += ((end + MAILS_COUNT) < list.Count) ? MAILS_COUNT : (list.Count - end);

                    List<DiagCard> listCut = new List<DiagCard>();

                    for (int i = begin; i < end; i++)
                        listCut.Add(list[i]);

                    IEnumerable<Car> carList = diagCardList.GetCarListFromDiagCardList(listCut);
                    List<string> files = new List<string>();

                    foreach (Car car in carList)
                    {
                        STS sts = stsList.getItem(car);
                        if (sts.File != string.Empty)
                            files.Add(sts.File);
                    }

                    string mailText = CreateMail(listCut);

                    EMail email = new EMail();

                    Driver employeeAutoDept = GetDriverForSending();
                    email.SendNotification(employeeAutoDept, mailText, true, files);
                }
            }
        }
Ejemplo n.º 5
0
        public void SendNotification()
        {
            SendToBoss();

            if (DateTime.Today.Day != SEND_DAY)
                return;

            PolicyList policyList = PolicyList.getInstance();
            IEnumerable<Policy> list = policyList.GetPolicyEnds();

            if (!ListEmpty(list))
            {
                Driver driversTo = GetDriverForSending();

                string mailText = CreateMail(list);

                EMail email = new EMail();

                email.SendNotification(driversTo, mailText);
            }
        }
Ejemplo n.º 6
0
        public void SendNotification()
        {
            string message = CreateMessageNotification();

            EMail email = new EMail();
            email.SendNotification(Driver, message);

            IsNotificationSent = true;
            if (ID != 0)
                ExecSave();
        }
Ejemplo n.º 7
0
        public void Agree()
        {
            EMail email = new EMail();
            email.SendMailAccountViolation(this);

            Agreed = true;

            Save();
        }
Ejemplo n.º 8
0
        private void SendToBoss()
        {
            PolicyList policyList = PolicyList.getInstance();
            IEnumerable<Policy> list = policyList.GetPolicyAccount();

            if (!ListEmpty(list))
            {
                Driver driversTo = GetDriverForSending(RolesList.Boss);

                string mailText = CreateMailToBoss(list);

                var email = new EMail();

                email.SendNotification(driversTo, mailText);
            }
        }
Ejemplo n.º 9
0
 private void Send()
 {
     EMail mail = new EMail();
     mail.sendMailViolation(_violation);
 }