Subversion Repository Public Repository

AmsLaserficheDataProvider

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AmsLaserficheDataProvider.Models
{
    public class LetterModel
    {
        public Int32 Id { get; set; }
        public String Reference { get; set; }
        public Int32 Cycle { get; set; }
        public Int32 LetterDays { get; set; }
        public String MailType { get; set; }
        public String LetterType { get; set; }
        public String FullName { get; set; }

        public LetterModel(int id, String reference, int cycle, int letterDays, string mailType, string letterType, string fullName)
        {
            Id = id;
            Reference = reference;
            Cycle = cycle;
            LetterDays = letterDays;
            MailType = mailType;
            LetterType = LetterType;
            FullName = fullName;
        }

        public LetterModel(int id, string letterName)
        {
            Id = id;
            ParseLetterName(letterName);
        }

        private void ParseLetterName(string letterName)
        {
            string[] splitLetterName = letterName.Split(new char[] { '-' });
            Reference = splitLetterName[0];
            Cycle = Int32.Parse(splitLetterName[1].Substring(0,2));
            LetterDays = Int32.Parse(splitLetterName[4].Substring(0, 2));
            MailType = splitLetterName[2] + "-" + splitLetterName[3];
            LetterType = splitLetterName[5];
            FullName = letterName;
        }
    }
}

Commits for AmsLaserficheDataProvider/AmsLaserficheDataProvider/Models/LetterModel.cs

Diff revisions: vs.
Revision Author Commited Message
1 BBDSCHRIS picture BBDSCHRIS Thu 09 Aug, 2018 12:33:02 +0000