private Serie CreateSerie(int?projectId)
        {
            var serie = new Serie
            {
                Created    = DateTime.Now,
                Name       = SerieName,
                UniqueName = SerieName.ReplaceSpaces(),
                Published  = PublicationDate,
                ProjectId  = projectId
            };

            _context.Series.Add(serie);
            _context.SaveChanges();

            return(serie);
        }
示例#2
0
            /// <summary>
            /// Initialize the specified serie
            /// </summary>
            private static List <short> InitSeries(SerieName serie)
            {
                List <short> result = null;

                switch (serie)
                {
                case SerieName.E3:
                    // If not initialized, initialize
                    if (SerieE3 == null)
                    {
                        SerieE3 = new List <short>()
                        {
                            100, 220, 470
                        };
                    }
                    result = SerieE3;
                    break;

                case SerieName.E6:
                    // If not initialized, initialize
                    if (SerieE6 == null)
                    {
                        SerieE6 = new List <short>()
                        {
                            100, 150, 220, 330, 470, 680
                        };
                    }
                    result = SerieE6;
                    break;

                case SerieName.E12:
                    // If not initialized, initialize
                    if (SerieE12 == null)
                    {
                        SerieE12 = new List <short>()
                        {
                            100, 120, 150, 180, 220, 270, 330, 390, 470, 560, 680, 820
                        };
                    }
                    result = SerieE12;
                    break;

                case SerieName.E24:
                    // If not initialized, initialize
                    if (SerieE24 == null)
                    {
                        SerieE24 = new List <short>()
                        {
                            100, 110, 120, 130, 150, 160, 180, 200, 220, 240, 270, 300, 330, 360, 390, 430, 470, 510, 560, 620, 680, 750, 820, 910
                        };
                    }
                    result = SerieE24;
                    break;

                case SerieName.E48:
                    // If not initialized, initialize
                    if (SerieE48 == null)
                    {
                        SerieE48 = new List <short>()
                        {
                            100, 105, 110, 115, 121, 127, 133, 140, 147, 154, 162, 169, 178, 187, 196, 205, 215, 226, 237, 249, 261, 274, 287, 301, 316, 332, 348, 365, 383, 402, 422, 442, 464, 487, 511, 536, 562, 590, 619, 649, 681, 715, 750, 787, 825, 866, 909, 953
                        };
                    }
                    result = SerieE48;
                    break;

                case SerieName.E96:
                    // If not initialized, initialize
                    if (SerieE96 == null)
                    {
                        SerieE96 = new List <short>()
                        {
                            100, 102, 105, 107, 110, 113, 115, 118, 121, 124, 127, 130, 133, 137, 140, 143, 147, 150, 154, 158, 162, 165, 169, 174, 178, 182, 187, 191, 196, 200, 205, 210, 215, 221, 226, 232, 237, 243, 249, 255, 261, 267, 274, 280, 287, 294, 301, 309, 316, 324, 332, 340, 348, 357, 365, 374, 383, 392, 402, 412, 422, 432, 442, 453, 464, 475, 487, 499, 511, 523, 536, 549, 562, 576, 590, 604, 619, 634, 649, 665, 681, 698, 715, 732, 750, 768, 787, 806, 825, 845, 866, 887, 909, 931, 953, 976
                        };
                    }
                    result = SerieE96;
                    break;

                case SerieName.E192:
                    // If not initialized, initialize
                    if (SerieE192 == null)
                    {
                        SerieE192 = new List <short>()
                        {
                            100, 101, 102, 104, 105, 106, 107, 109, 110, 111, 113, 114, 115, 117, 118, 120, 121, 123, 124, 126, 127, 129, 130, 132, 133, 135, 137, 138, 140, 142, 143, 145, 147, 149, 150, 152, 154, 156, 158, 160, 162, 164, 165, 167, 169, 172, 174, 176, 178, 180, 182, 184, 187, 189, 191, 193, 196, 198, 200, 203, 205, 208, 210, 213, 215, 218, 221, 223, 226, 229, 232, 234, 237, 240, 243, 246, 249, 252, 255, 258, 261, 264, 267, 271, 274, 277, 280, 284, 287, 291, 294, 298, 301, 305, 309, 312, 316, 320, 324, 328, 332, 336, 340, 344, 348, 352, 357, 361, 365, 370, 374, 379, 383, 388, 392, 397, 402, 407, 412, 417, 422, 427, 432, 437, 442, 448, 453, 459, 464, 470, 475, 481, 487, 493, 499, 505, 511, 517, 523, 530, 536, 542, 549, 556, 562, 569, 576, 583, 590, 597, 604, 612, 619, 626, 634, 642, 649, 657, 665, 673, 681, 690, 698, 706, 715, 723, 732, 741, 750, 759, 768, 777, 787, 796, 806, 816, 825, 835, 845, 856, 866, 876, 887, 898, 909, 920, 931, 942, 953, 965, 976, 988
                        };
                    }
                    result = SerieE192;
                    break;

                default:
                    break;
                }

                return(result);
            }
示例#3
0
 /// <summary>
 /// Get the specified serie
 /// </summary>
 /// <param name="serie"></param>
 /// <returns></returns>
 public static List <short> GetSerie(SerieName serie)
 {
     return(InitSeries(serie));
 }