示例#1
0
        public int InserirPlanoProtecao(TPlanoProtecaoVO tplanoprotecaovo)
        {
            var banco = new SINAF_WebEntities();

            var query = new TPlanoProtecao
            {
                Codigo              = tplanoprotecaovo.Codigo,
                NomePlano           = tplanoprotecaovo.NomePlano,
                CoberturaMorte      = tplanoprotecaovo.CoberturaMorte,
                CoberturaAcidente   = tplanoprotecaovo.CoberturaAcidente,
                CoberturaEmergencia = tplanoprotecaovo.CoberturaEmergencia,
                Premio_18_30        = tplanoprotecaovo.Premio_18_30,
                Premio_31_40        = tplanoprotecaovo.Premio_31_40,
                Premio_41_45        = tplanoprotecaovo.Premio_41_45,
                Premio_46_50        = tplanoprotecaovo.Premio_46_50,
                Premio_51_55        = tplanoprotecaovo.Premio_51_55,
                Premio_56_60        = tplanoprotecaovo.Premio_56_60,
                Premio_61_65        = tplanoprotecaovo.Premio_61_65,
            };

            banco.AddToTPlanoProtecao(query);
            banco.SaveChanges();

            tplanoprotecaovo.IDPlanoProtecao = query.IDPlanoProtecao;

            return(query.IDPlanoProtecao);
        }