public Bagde_trad_list(Badge_BO badBO)
 {
     InitializeComponent();
     ListLanguesBadges = Appel_List.GetTraductionBadge(badBO);
     list.ItemsSource  = ListLanguesBadges;
     BadgeName.Content = badBO.Intitule;
 }
        private void Modification_Click(object sender, RoutedEventArgs e)
        {
            lanbadBO.Traduction = C1.Text;
            Update.UpdateBadgeTrad(lanbadBO);
            List <Badge_BO> listBadges = Appel_List.GetBadges();
            Badge_BO        bag        = listBadges.Find(x => x.Id_Badge == lanbadBO.Badge);

            this.NavigationService.Navigate(new Bagde_trad_list(bag));
        }
예제 #3
0
        private void Modification_Click(object sender, RoutedEventArgs e)
        {
            Badge_BO badBO = new Badge_BO
            {
                Intitule = C1.Text,
                Id_Badge = id
            };

            Update.UpdateBadge(badBO);
            this.NavigationService.Navigate(new Uri("Badges.xaml", UriKind.Relative));
        }
예제 #4
0
 public static void AddBadge(Badge_BO badgBO)
 {
     using (var db = new MarcassinEntities())
     {
         db.Badge.Add(new Badge
         {
             nom = badgBO.Intitule
         });
         db.SaveChanges();
     }
 }
예제 #5
0
        private void Creation_Click(object sender, RoutedEventArgs e)
        {
            var badg = new Badge_BO
            {
                Intitule = C1.Text
            };

            Create.CreateBadge(badg);
            listBadges       = Appel_List.GetBadges();
            list.ItemsSource = listBadges;
        }
예제 #6
0
 public static void UpdBadge(Badge_BO badBO)
 {
     using (var db = new MarcassinEntities())
     {
         Badge badg = db.Badge.Where(b => b.id_Badge == badBO.Id_Badge).FirstOrDefault();
         badg.nom = badBO.Intitule;
         db.SaveChanges();
         Langue_Badge lanbad = db.Langue_Badge.Where(lb => lb.id_Badge == badBO.Id_Badge)
                               .Where(lb => lb.Traduction == badBO.Intitule).Where(lb => lb.id_Langue == 1).FirstOrDefault();
         db.SaveChanges();
     }
 }
예제 #7
0
        public static List <Langue_Badge_BO> GetTraductionByBadge(Badge_BO bad)
        {
            List <Langue_Badge_BO> bla = new List <Langue_Badge_BO>();

            using (var db = new MarcassinEntities())
            {
                var trad = from tra in db.Langue_Badge
                           where tra.id_Badge == bad.Id_Badge
                           join lan in db.Langue on tra.id_Langue equals lan.id_Langue
                           select tra;
                foreach (var item in trad)
                {
                    bla.Add(new Langue_Badge_BO
                    {
                        Traduction = item.Traduction,
                        Langue     = item.Langue.Langue_intitule,
                        Badge      = item.id_Badge
                    });
                }
            }
            return(bla);
        }
예제 #8
0
        public static List <Badge_BO> ToListBadgeBO(this List <Badge> list)
        {
            if (list == null)
            {
                return(null);
            }
            List <Badge_BO> listBadgeBO = new List <Badge_BO>();

            foreach (Badge bad in list)
            {
                using (var db = new MarcassinEntities())
                {
                    var bo = new Badge_BO
                    {
                        Id_Badge = bad.id_Badge,
                        Intitule = bad.nom
                    };
                    listBadgeBO.Add(bo);
                }
            }
            return(listBadgeBO);
        }
예제 #9
0
        public static List <Langue_Badge_BO> GetTraductionBadge(Badge_BO bad)
        {
            List <Langue_Badge_BO> listLangBadBO = Langue_Badge_DAL.GetTraductionByBadge(bad);

            return(listLangBadBO);
        }
예제 #10
0
 public Update_Badge(Badge_BO badBO)
 {
     InitializeComponent();
     C1.Text = badBO.Intitule;
     id      = badBO.Id_Badge;
 }
예제 #11
0
 public static void CreateBadge(Badge_BO badgBO)
 {
     Badge_DAL.AddBadge(badgBO);
 }
예제 #12
0
 public static void UpdateBadge(Badge_BO badBO)
 {
     Badge_DAL.UpdBadge(badBO);
 }