Esempio n. 1
0
            private void NuevasSecciones()
            {
                decimal ultId = 0;
                PL_SECCIONES oldSecciones = ctx.PL_SECCIONES.OrderByDescending(t => t.ID).FirstOrDefault();
                if (oldSecciones != null) ultId = oldSecciones.ID;

                foreach (vPL_SECCIONES item in oDto.lSecciones.Where(t=> t.ES_NUEVO).ToList())
                {
                    PL_SECCIONES Seccion = new PL_SECCIONES();
                    ultId++;

                    item.ID = ultId;
                    item.ID_PLA = oDto.ID;
                    Mapper.Map(item, Seccion);
                    ctx.PL_SECCIONES.Add(Seccion);
                }
            }
Esempio n. 2
0
            private void InsertSecciones()
            {
                decimal ultId = 0;
                PL_SECCIONES oldSecciones = ctx.PL_SECCIONES.OrderByDescending(t => t.ID).FirstOrDefault();
                if (oldSecciones != null) ultId = oldSecciones.ID;
                int count = 1;
                foreach (vPL_SECCIONES item in oDto.lSecciones)
                {
                    PL_SECCIONES Seccion = new PL_SECCIONES();
                    ultId++;

                    item.ID = ultId;
                    item.ID_PLA = oDto.ID;
                    Mapper.Map(item, Seccion);
                    if (count == 1) Seccion.HTML = styles + "  " + Seccion.HTML;
                    ctx.PL_SECCIONES.Add(Seccion);
                    count++;
                }
            }