Пример #1
0
        public static InfoRepair Convert(InfoRepairDto countryDto)
        {
            if (countryDto == null)
            {
                return(null);
            }
            InfoRepair country = new InfoRepair();

            country.Cost        = countryDto.Cost;
            country.Length      = countryDto.Length;
            country.NameRepairs = countryDto.NameRepairs;
            country.Note        = countryDto.Note;
            country.StartDate   = countryDto.StartDate;
            return(country);
        }
Пример #2
0
        public string genHtmlInfoRepairs(string rep)
        {
            List <object> works    = ProcessFactory.InfoRepairDtoProcess().GetList().Cast <object>().ToList();
            string        res_html = "<tr><td><b>Дата начала</b></td><td><b>Продолжительность</b></td><td><b>Стоимость</b></td><td><b>Название ремонта</b> </td><td><b>Примечание</b></td></tr>";

            double sum   = 0;
            string cData = "";

            try
            {
                foreach (var work in works)
                {
                    InfoRepairDto WorkItem = (InfoRepairDto)work;
                    res_html += "<tr><td><p>" + WorkItem.StartDate + "</p></td>";
                    res_html += "<td><p>" + WorkItem.Length + "</p></td>";
                    res_html += "<td><p>" + WorkItem.Cost + "</p></td>";
                    res_html += "<td><p>" + WorkItem.NameRepairs + "</p></td>";
                    res_html += "<td><p>" + WorkItem.Note + "</p></td></tr>";

                    sum += Convert.ToDouble(WorkItem.Cost);
                    if (WorkItem.StartDate.ToString() != cData)
                    {
                        cData = WorkItem.StartDate.ToString();

                        res_html += "<tr><td colspan='5'><b>Итог: " + sum + "</b></td></tr>";
                        sum       = 0;
                    }
                    else
                    {
                    }
                }

                res_html = rep.Replace("[VRA_TABLE_REPORT]", res_html);
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, "Ошибка");
            }

            return(res_html);
        }
Пример #3
0
 public void Update(InfoRepairDto artist)
 {
     _infoRepairDao.Update(DtoConvert.Convert(artist));
 }
Пример #4
0
 public void Add(InfoRepairDto artist)
 {
     _infoRepairDao.Add(DtoConvert.Convert(artist));
 }