Esempio n. 1
0
 public bool Update(GalleryType mType, IList <Gallery> galleries, out string messages)
 {
     messages = "";
     BeginTran();
     try
     {
         IGalleryService gallerySrv = FX.Core.IoC.Resolve <IGalleryService>();
         foreach (var ii in mType.Galleries)
         {
             gallerySrv.Delete(ii);
         }
         foreach (var it in galleries)
         {
             it.TypeID = mType.Id;
             gallerySrv.CreateNew(it);
         }
         Save(mType);
         CommitTran();
         return(true);
     }
     catch (Exception ex)
     {
         RolbackTran();
         messages = "Có lỗi xảy ra, vui lòng thực hiện lại.";
         return(false);
     }
 }
Esempio n. 2
0
 public bool CreateNew(GalleryType mType, IList <Gallery> galleries, out string messages)
 {
     messages = "";
     try
     {
         CreateNew(mType);
         IGalleryService gallerySrv = FX.Core.IoC.Resolve <IGalleryService>();
         foreach (var it in galleries)
         {
             it.TypeID = mType.Id;
             gallerySrv.CreateNew(it);
         }
         CommitChanges();
         return(true);
     }
     catch (Exception ex)
     {
         messages = "Có lỗi xảy ra, vui lòng thực hiện lại.";
         return(false);
     }
 }