Beispiel #1
0
        public override string Save_badge(badgeDTO dto)
        {
            string msg = "";

            using (var context = new PHCEntities())
            {
                try
                {
                    Badge bg = new Badge();
                    bg.Badgename    = dto.Badgename;
                    bg.Badgelogo    = dto.badgeImage;
                    bg.createdDate  = DateTime.Now;
                    bg.CDescription = dto.cdescription;
                    bg.LDescription = dto.ldescription;

                    context.AddToBadges(bg);
                    context.SaveChanges();
                    msg = "success";
                }
                catch (Exception ex)
                {
                    msg = ex.Message;
                }
                return(msg);
            }
        }