Ejemplo n.º 1
0
        public void ShowNotice(DTP dtp)
        {
            _excelDoc = openDocumentExcel("Извещение о страховом случае");

            var owners = Owners.getInstance();

            _excelDoc.setValue(6, 5, owners.getItem(Convert.ToInt32(_car.ownerID))); //страхователь
            _excelDoc.setValue(7, 6, "а/я 34, 196128");                              //почтовый адрес
            _excelDoc.setValue(8, 7, "320-40-04");                                   //телефон

            var driverCarList = DriverCarList.getInstance();
            var driver        = driverCarList.GetDriver(_car, dtp.Date);

            var passportList = PassportList.getInstance();
            var passport     = passportList.getLastPassport(driver);

            if (passport.Number != string.Empty)
            {
                var number  = passport.Number;
                var numbers = number.Split(' ');

                _excelDoc.setValue(10, 3, numbers[0]);                            //серия
                _excelDoc.setValue(10, 6, numbers[1]);                            //номер

                _excelDoc.setValue(11, 3, passport.GiveOrg);                      //кем выдан
                _excelDoc.setValue(12, 4, passport.GiveDate.ToShortDateString()); //дата выдачи
            }

            var policyList = PolicyList.getInstance();
            var policy     = policyList.getItem(_car, PolicyType.КАСКО);

            _excelDoc.setValue(14, 6, policy.Number);                                       //полис

            _excelDoc.setValue(16, 6, string.Concat(_car.Mark.Name, " ", _car.info.Model)); //марка а/м
            _excelDoc.setValue(18, 6, _car.Grz);                                            //рег номер а/м
            _excelDoc.setValue(20, 6, _car.vin);                                            //вин

            _excelDoc.setValue(22, 6, dtp.Date.ToShortDateString());                        //дата дтп

            _excelDoc.setValue(27, 2, driver.GetName(NameType.Full));                       //водитель фио

            var regions = Regions.getInstance();

            _excelDoc.setValue(29, 3, regions.getItem(Convert.ToInt32(dtp.IDRegion))); //город
            _excelDoc.setValue(31, 14, dtp.Damage);                                    //повреждения
            _excelDoc.setValue(33, 2, dtp.Facts);                                      //обстоятельства происшествия

            //SsDTP ssDTP = SsDTPList.getInstance().getItem(_car.Mark);

            //_excelDoc.setValue(63, 11, ssDTP.ServiceStantion);

            //DateTime date = DateTime.Today;
            //MyDateTime myDate = new MyDateTime(date.ToShortDateString());

            //_excelDoc.setValue(71, 3, string.Concat("« ", date.Day.ToString(), " »"));
            //_excelDoc.setValue(71, 4, myDate.MonthToStringGenitive());
            //_excelDoc.setValue(71, 8, date.Year.ToString().Substring(2, 2));

            _excelDoc.Show();
        }
Ejemplo n.º 2
0
        public void ShowAttacheToOrder()
        {
            _excelDoc = openDocumentExcel("Приложение к приказу");

            string fullNameAuto = string.Concat(_car.Mark.Name, " ", _car.info.Model);

            _excelDoc.setValue(18, 2, fullNameAuto);
            _excelDoc.setValue(18, 3, _car.Grz);

            var driver = _driverList.getItem(Convert.ToInt32(_invoice.DriverToID));

            _excelDoc.setValue(18, 4, driver.GetName(NameType.Full));
            _excelDoc.setValue(18, 5, driver.Position);

            _excelDoc.Show();
        }
Ejemplo n.º 3
0
        public void CreatePolicyTable()
        {
            const int indexBegin = 6;
            var       date       = DateTime.Today.AddMonths(1);

            _excelDoc = openDocumentExcel("Таблица страхования");

            var myDate = new MyDateTime(date.ToShortDateString());

            _excelDoc.setValue(2, 1, "Страхуем в " + myDate.MonthToStringPrepositive() + " " + myDate.Year + " г.");

            var policyList = PolicyList.getInstance();
            var list       = policyList.GetPolicyList(date);
            var listCar    = policyList.GetCarListByPolicyList(list);

            var diagCardList = DiagCardList.getInstance();

            var rowIndex = indexBegin;

            foreach (var car in listCar)
            {
                _excelDoc.setValue(rowIndex, 2, car.Grz);
                _excelDoc.setValue(rowIndex, 3, car.Mark.Name);
                _excelDoc.setValue(rowIndex, 4, car.info.Model);
                _excelDoc.setValue(rowIndex, 5, car.vin);
                _excelDoc.setValue(rowIndex, 6, car.Year);
                _excelDoc.setValue(rowIndex, 7, GetPolicyBeginDate(list, car, PolicyType.ОСАГО));
                _excelDoc.setValue(rowIndex, 8, GetPolicyBeginDate(list, car, PolicyType.КАСКО));
                _excelDoc.setValue(rowIndex, 9, car.info.Owner);
                _excelDoc.setValue(rowIndex, 10, car.info.Owner);
                _excelDoc.setValue(rowIndex, 11, car.info.Owner);

                var diagCard = diagCardList.getItem(car);

                if (diagCard != null)
                {
                    _excelDoc.setValue(rowIndex, 12, diagCard.Date.ToShortDateString());
                    _excelDoc.setValue(rowIndex, 13, diagCard.Number);
                }

                rowIndex++;
            }

            _excelDoc.Show();
        }
Ejemplo n.º 4
0
        public void ShowInvoice()
        {
            _excelDoc = openDocumentExcel("Накладная");

            _excelDoc.setValue(7, 2, _car.info.Owner);

            _excelDoc.setValue(16, 82, _invoice.Number);
            _excelDoc.setValue(16, 98, _invoice.Date.ToShortDateString());

            string fullNameAuto = string.Concat("Автомобиль ", _car.Mark.Name, " ", _car.info.Model, ", ", _car.Grz);

            _excelDoc.setValue(22, 10, fullNameAuto);
            _excelDoc.setValue(22, 53, _car.dateGet.ToShortDateString());

            var grades = GradeList.getInstance();

            var grade = grades.getItem(Convert.ToInt32(_car.GradeID));

            var ptsList = PTSList.getInstance();
            var pts     = ptsList.getItem(_car);

            var fullDetailAuto = string.Concat("VIN ", _car.vin, ", Двигатель ", _car.eNumber, ", № кузова ",
                                               _car.bodyNumber, ", Год выпуска ", _car.Year, " г., Паспорт ",
                                               pts.Number, " от ", pts.Date.ToShortDateString(), ", мощность двигателя ", grade.EPower, " л.с.");

            _excelDoc.setValue(47, 2, fullDetailAuto);

            Driver driver1 = _driverList.getItem(Convert.ToInt32(_invoice.DriverFromID));
            Driver driver2 = _driverList.getItem(Convert.ToInt32(_invoice.DriverToID));

            _excelDoc.setValue(9, 10, driver1.Dept);
            _excelDoc.setValue(56, 11, driver1.Position);
            _excelDoc.setValue(56, 63, driver1.GetName(NameType.Full));

            _excelDoc.setValue(11, 13, driver2.Dept);
            _excelDoc.setValue(60, 11, driver2.Position);
            _excelDoc.setValue(60, 63, driver2.GetName(NameType.Full));

            _excelDoc.Show();
        }
Ejemplo n.º 5
0
 public void Show()
 {
     _excelDoc.Show();
 }