Пример #1
0
 public RepositoryResponse <FileViewModel> SaveFile(IFormFile file, string filename, string folder)
 {
     V_0 = new RepositoryResponse <FileViewModel>();
     try
     {
         if (file.get_Length() <= (long)0)
         {
             V_0.set_IsSucceed(false);
             V_0.get_Errors().Add("File not found");
         }
         else
         {
             this.CreateDirectoryIfNotExist(folder);
             stackVariable14    = new string[2];
             stackVariable14[0] = folder;
             stackVariable14[1] = filename;
             V_1 = CommonHelper.GetFullPath(stackVariable14);
             if (File.Exists(V_1))
             {
                 dummyVar0 = this.DeleteFile(V_1);
             }
             V_2 = new FileStream(V_1, 2);
             try
             {
                 file.CopyTo(V_2);
             }
             finally
             {
                 if (V_2 != null)
                 {
                     ((IDisposable)V_2).Dispose();
                 }
             }
             V_0.set_IsSucceed(true);
             stackVariable30 = new FileViewModel();
             stackVariable30.set_Filename(filename.Substring(0, file.get_FileName().LastIndexOf('.')));
             stackVariable30.set_Extension(filename.Substring(file.get_FileName().LastIndexOf('.')));
             stackVariable30.set_FileFolder(folder);
             V_0.set_Data(stackVariable30);
         }
     }
     catch (Exception exception_0)
     {
         V_3 = exception_0;
         V_0.set_IsSucceed(false);
         V_0.set_Exception(V_3);
         V_0.get_Errors().Add(V_3.get_Message());
     }
     return(V_0);
 }
Пример #2
0
		public override RepositoryResponse<bool> RemoveRelatedModels(DeleteViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			stackVariable2 = ViewModelBase<MixCmsContext, MixAttributeSetValue, DeleteViewModel>.Repository;
			V_1 = Expression.Parameter(Type.GetTypeFromHandle(// 
Пример #3
0
		public override RepositoryResponse<bool> SaveSubModels(MixAttributeSet parent, MixCmsContext _context, IDbContextTransaction _transaction)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			if (V_0.get_IsSucceed())
			{
				V_1 = this.get_Fields().GetEnumerator();
				try
				{
					while (V_1.MoveNext())
					{
						V_2 = V_1.get_Current();
						if (!V_0.get_IsSucceed())
						{
							break;
						}
						V_2.set_AttributeSetName(parent.get_Name());
						V_2.set_AttributeSetId(parent.get_Id());
						ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixAttributeFields.UpdateViewModel>(V_2.SaveModel(false, _context, _transaction), ref V_0);
					}
				}
				finally
				{
					((IDisposable)V_1).Dispose();
				}
			}
			return V_0;
		}
Пример #4
0
		private RepositoryResponse<bool> SaveMedias(int id, MixCmsContext _context, IDbContextTransaction _transaction)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			V_1 = this.get_MediaNavs().GetEnumerator();
			try
			{
				while (V_1.MoveNext())
				{
					V_2 = V_1.get_Current();
					V_2.set_PostId(id);
					V_2.set_Specificulture(this.get_Specificulture());
					if (!V_2.get_IsActived())
					{
						ViewModelHelper.HandleResult<MixPostMedia>(V_2.RemoveModel(false, _context, _transaction), ref V_0);
					}
					else
					{
						ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixPostMedias.ReadViewModel>(V_2.SaveModel(false, _context, _transaction), ref V_0);
					}
				}
			}
			finally
			{
				((IDisposable)V_1).Dispose();
			}
			return V_0;
		}
Пример #5
0
					V_1 = Expression.Parameter(Type.GetTypeFromHandle(// 
					// Current member / type: Mix.Cms.Lib.Models.Cms.MixMedia Mix.Cms.Lib.ViewModels.MixMedias.UpdateViewModel::ParseModel(Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
					// Exception in: Mix.Cms.Lib.Models.Cms.MixMedia ParseModel(Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
					// Specified method is not supported.
					// 
					// mailto: [email protected]


		public override RepositoryResponse<bool> RemoveRelatedModels(Mix.Cms.Lib.ViewModels.MixMedias.UpdateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(FileRepository.get_Instance().DeleteWebFile(this.get_FileName(), this.get_Extension(), this.get_FileFolder()));
			V_0 = stackVariable0;
			stackVariable10 = ViewModelBase<MixCmsContext, MixMedia, Mix.Cms.Lib.ViewModels.MixMedias.UpdateViewModel>.Repository;
			V_1 = Expression.Parameter(Type.GetTypeFromHandle(// 
Пример #6
0
		public static RepositoryResponse<UpdateViewModel> GetTemplateByPath(string path, string culture, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			V_0 = new UpdateViewModel.u003cu003ec__DisplayClass92_0();
			V_1 = new RepositoryResponse<UpdateViewModel>();
			stackVariable2 = V_0;
			if (path != null)
			{
				stackVariable7 = path.Split('/', 0);
			}
			else
			{
				stackVariable7 = null;
			}
			stackVariable2.temp = stackVariable7;
			if (V_0.temp == null || (int)V_0.temp.Length < 2)
			{
				V_1.set_IsSucceed(false);
				V_1.get_Errors().Add("Template Not Found");
			}
			else
			{
				V_0.activeThemeId = MixService.GetConfig<int>("ThemeId", culture);
				V_0.name = V_0.temp[1].Split('.', 0)[0];
				stackVariable35 = ViewModelBase<MixCmsContext, MixTemplate, UpdateViewModel>.Repository;
				V_2 = Expression.Parameter(Type.GetTypeFromHandle(// 
Пример #7
0
		private RepositoryResponse<bool> SaveUrlAlias(int parentId, MixCmsContext _context, IDbContextTransaction _transaction)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			V_1 = this.get_UrlAliases().GetEnumerator();
			try
			{
				while (V_1.MoveNext())
				{
					stackVariable8 = V_1.get_Current();
					stackVariable8.set_SourceId(parentId.ToString());
					stackVariable8.set_Type(1);
					stackVariable8.set_Specificulture(this.get_Specificulture());
					ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixUrlAliases.UpdateViewModel>(((ViewModelBase<MixCmsContext, MixUrlAlias, Mix.Cms.Lib.ViewModels.MixUrlAliases.UpdateViewModel>)stackVariable8).SaveModel(false, _context, _transaction), ref V_0);
					if (V_0.get_IsSucceed())
					{
						continue;
					}
					goto Label0;
				}
			}
			finally
			{
				((IDisposable)V_1).Dispose();
			}
		Label0:
			return V_0;
		}
Пример #8
0
		public RepositoryResponse<bool> Validate<T>(IConvertible id, string specificulture, JObject jItem, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		where T : class
		{
			V_0 = new ApiModuleDataValueViewModel.u003cu003ec__DisplayClass40_0<T>();
			V_0.specificulture = specificulture;
			V_1 = Newtonsoft.Json.Linq.Extensions.Value<string>(jItem.get_Item(this.get_Name()).get_Item("value"));
			V_0.jVal = new JProperty(this.get_Name(), jItem.get_Item(this.get_Name()));
			stackVariable18 = new RepositoryResponse<bool>();
			stackVariable18.set_IsSucceed(true);
			V_2 = stackVariable18;
			if (this.get_IsUnique())
			{
				stackVariable35 = V_0;
				if (id != null)
				{
					stackVariable38 = id.ToString();
				}
				else
				{
					stackVariable38 = null;
				}
				stackVariable35.strId = stackVariable38;
				stackVariable40 = _context.get_MixModuleData();
				V_3 = Expression.Parameter(Type.GetTypeFromHandle(// 
				// Current member / type: Mix.Domain.Core.ViewModels.RepositoryResponse`1<System.Boolean> Mix.Cms.Lib.ViewModels.ApiModuleDataValueViewModel::Validate(System.IConvertible,System.String,Newtonsoft.Json.Linq.JObject,Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
				// Exception in: Mix.Domain.Core.ViewModels.RepositoryResponse<System.Boolean> Validate(System.IConvertible,System.String,Newtonsoft.Json.Linq.JObject,Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
				// Specified method is not supported.
				// 
				// mailto: [email protected]

	}
}
Пример #9
0
		public override RepositoryResponse<bool> SaveSubModels(MixPage parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixTemplates.UpdateViewModel>(this.get_View().SaveModel(true, _context, _transaction), ref V_0);
			if (V_0.get_IsSucceed() && this.get_Master() != null)
			{
				ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixTemplates.UpdateViewModel>(this.get_Master().SaveModel(true, _context, _transaction), ref V_0);
			}
			if (V_0.get_IsSucceed() && this.get_UrlAliases() != null)
			{
				V_1 = this.get_UrlAliases().GetEnumerator();
				try
				{
					while (V_1.MoveNext())
					{
						V_2 = V_1.get_Current();
						if (!V_0.get_IsSucceed())
						{
							break;
						}
						V_2.set_SourceId(parent.get_Id().ToString());
						V_2.set_Type(0);
						V_2.set_Specificulture(this.get_Specificulture());
						ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixUrlAliases.UpdateViewModel>(V_2.SaveModel(false, _context, _transaction), ref V_0);
					}
				}
				finally
				{
					((IDisposable)V_1).Dispose();
				}
			}
			if (V_0.get_IsSucceed())
			{
				V_4 = this.get_ModuleNavs().GetEnumerator();
				try
				{
					while (V_4.MoveNext())
					{
						V_5 = V_4.get_Current();
						V_5.set_PageId(parent.get_Id());
						if (!V_5.get_IsActived())
						{
							ViewModelHelper.HandleResult<MixPageModule>(V_5.RemoveModel(false, _context, _transaction), ref V_0);
						}
						else
						{
							ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixPageModules.ReadMvcViewModel>(V_5.SaveModel(false, _context, _transaction), ref V_0);
						}
					}
				}
				finally
				{
					((IDisposable)V_4).Dispose();
				}
			}
			return V_0;
		}
Пример #10
0
				V_1 = Expression.Parameter(System.Type.GetTypeFromHandle(// 
				// Current member / type: Mix.Cms.Lib.Models.Cms.MixPost Mix.Cms.Lib.ViewModels.MixPosts.UpdateViewModel::ParseModel(Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
				// Exception in: Mix.Cms.Lib.Models.Cms.MixPost ParseModel(Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
				// Specified method is not supported.
				// 
				// mailto: [email protected]


		public override RepositoryResponse<bool> RemoveRelatedModels(Mix.Cms.Lib.ViewModels.MixPosts.UpdateViewModel view, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			if (V_0.get_IsSucceed())
			{
				stackVariable293 = _context.get_MixPagePost();
				V_1 = Expression.Parameter(System.Type.GetTypeFromHandle(// 
Пример #11
0
		public override RepositoryResponse<bool> SaveSubModels(MixPost parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			try
			{
				V_1 = this.get_View().SaveModel(true, _context, _transaction);
				stackVariable8 = V_0;
				if (!V_0.get_IsSucceed())
				{
					stackVariable11 = false;
				}
				else
				{
					stackVariable11 = V_1.get_IsSucceed();
				}
				stackVariable8.set_IsSucceed(stackVariable11);
				ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixTemplates.UpdateViewModel>(V_1, ref V_0);
				if (V_0.get_IsSucceed())
				{
					V_0 = this.SaveUrlAlias(parent.get_Id(), _context, _transaction);
				}
				if (V_0.get_IsSucceed())
				{
					V_0 = this.SaveMedias(parent.get_Id(), _context, _transaction);
				}
				if (V_0.get_IsSucceed())
				{
					V_0 = this.SaveAttribute(parent.get_Id(), _context, _transaction);
				}
				if (V_0.get_IsSucceed())
				{
					V_0 = this.SaveRelatedPost(parent.get_Id(), _context, _transaction);
				}
				if (V_0.get_IsSucceed())
				{
					V_0 = this.SaveParentPages(parent.get_Id(), _context, _transaction);
				}
				if (V_0.get_IsSucceed())
				{
					V_0 = this.SaveParentModules(parent.get_Id(), _context, _transaction);
				}
				V_2 = V_0;
			}
			catch (Exception exception_0)
			{
				V_3 = exception_0;
				V_0.set_IsSucceed(false);
				V_0.set_Exception(V_3);
				V_2 = V_0;
			}
			return V_2;
		}
Пример #12
0
				V_1 = Expression.Parameter(System.Type.GetTypeFromHandle(// 
				// Current member / type: Mix.Domain.Core.ViewModels.RepositoryResponse`1<System.Boolean> Mix.Cms.Lib.ViewModels.MixPosts.SyncViewModel::RemoveRelatedModels(Mix.Cms.Lib.ViewModels.MixPosts.SyncViewModel,Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
				// Exception in: Mix.Domain.Core.ViewModels.RepositoryResponse<System.Boolean> RemoveRelatedModels(Mix.Cms.Lib.ViewModels.MixPosts.SyncViewModel,Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
				// Specified method is not supported.
				// 
				// mailto: [email protected]


		public override RepositoryResponse<bool> SaveSubModels(MixPost parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			try
			{
				if (V_0.get_IsSucceed())
				{
					stackVariable171 = ViewModelBase<MixCmsContext, MixMedia, Mix.Cms.Lib.ViewModels.MixMedias.UpdateViewModel>.Repository;
					V_2 = Expression.Parameter(System.Type.GetTypeFromHandle(// 
Пример #13
0
		private RepositoryResponse<bool> SaveParentPages(int id, MixCmsContext _context, IDbContextTransaction _transaction)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			V_1 = this.get_Pages().GetEnumerator();
			try
			{
				while (V_1.MoveNext())
				{
					V_2 = V_1.get_Current();
					V_2.set_PostId(id);
					V_2.set_Description(this.get_Title());
					V_2.set_Image(this.get_ThumbnailUrl());
					V_2.set_Status(2);
					if (!V_2.get_IsActived())
					{
						V_4 = V_2.RemoveModel(false, _context, _transaction);
						V_0.set_IsSucceed(V_4.get_IsSucceed());
						if (V_0.get_IsSucceed())
						{
							dummyVar1 = ViewModelBase<MixCmsContext, MixPage, Mix.Cms.Lib.ViewModels.MixPages.ReadListItemViewModel>.Repository.RemoveCache(V_2.get_Page().get_Model(), _context, _transaction);
						}
						else
						{
							V_0.set_Exception(V_4.get_Exception());
							this.get_Errors().AddRange(V_4.get_Errors());
						}
					}
					else
					{
						V_3 = V_2.SaveModel(false, _context, _transaction);
						V_0.set_IsSucceed(V_3.get_IsSucceed());
						if (V_0.get_IsSucceed())
						{
							dummyVar0 = ViewModelBase<MixCmsContext, MixPage, Mix.Cms.Lib.ViewModels.MixPages.ReadListItemViewModel>.Repository.RemoveCache(V_2.get_Page().get_Model(), _context, _transaction);
						}
						else
						{
							V_0.set_Exception(V_3.get_Exception());
							this.get_Errors().AddRange(V_3.get_Errors());
						}
					}
				}
			}
			finally
			{
				((IDisposable)V_1).Dispose();
			}
			return V_0;
		}
Пример #14
0
				V_0 = Expression.Parameter(Type.GetTypeFromHandle(// 
				// Current member / type: Mix.Cms.Lib.Models.Cms.MixPostMedia Mix.Cms.Lib.ViewModels.MixPostMedias.ReadViewModel::ParseModel(Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
				// Exception in: Mix.Cms.Lib.Models.Cms.MixPostMedia ParseModel(Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
				// Specified method is not supported.
				// 
				// mailto: [email protected]


		public override RepositoryResponse<bool> SaveSubModels(MixPostMedia parent, MixCmsContext _context, IDbContextTransaction _transaction)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			V_1 = this.get_Media().SaveModel(false, _context, _transaction);
			if (!V_1.get_IsSucceed())
			{
				V_0.set_IsSucceed(false);
				V_0.set_Exception(V_1.get_Exception());
				V_0.set_Errors(V_1.get_Errors());
			}
			return V_0;
		}
Пример #15
0
		private RepositoryResponse<bool> SaveRelatedPost(int id, MixCmsContext _context, IDbContextTransaction _transaction)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			V_1 = this.get_PostNavs().GetEnumerator();
			try
			{
				while (V_1.MoveNext())
				{
					V_2 = V_1.get_Current();
					V_2.set_SourceId(id);
					V_2.set_Status(2);
					V_2.set_Specificulture(this.get_Specificulture());
					if (!V_2.get_IsActived())
					{
						V_4 = V_2.RemoveModel(false, _context, _transaction);
						V_0.set_IsSucceed(V_4.get_IsSucceed());
						if (V_0.get_IsSucceed())
						{
							dummyVar1 = ViewModelBase<MixCmsContext, MixPost, Mix.Cms.Lib.ViewModels.MixPosts.ReadViewModel>.Repository.RemoveCache(V_2.get_RelatedPost().get_Model(), null, null);
						}
						else
						{
							V_0.set_Exception(V_4.get_Exception());
							this.get_Errors().AddRange(V_4.get_Errors());
						}
					}
					else
					{
						V_3 = V_2.SaveModel(false, _context, _transaction);
						V_0.set_IsSucceed(V_3.get_IsSucceed());
						if (V_0.get_IsSucceed())
						{
							dummyVar0 = ViewModelBase<MixCmsContext, MixPost, Mix.Cms.Lib.ViewModels.MixPosts.ReadViewModel>.Repository.RemoveCache(V_2.get_RelatedPost().get_Model(), null, null);
						}
						else
						{
							V_0.set_Exception(V_3.get_Exception());
							this.get_Errors().AddRange(V_3.get_Errors());
						}
					}
				}
			}
			finally
			{
				((IDisposable)V_1).Dispose();
			}
			return V_0;
		}
Пример #16
0
		private RepositoryResponse<bool> SaveAttribute(int parentId, MixCmsContext context, IDbContextTransaction transaction)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			this.get_AttributeData().set_ParentId(parentId.ToString());
			this.get_AttributeData().set_ParentType(2);
			ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixRelatedAttributeDatas.UpdateViewModel>(this.get_AttributeData().SaveModel(true, context, transaction), ref V_0);
			V_1 = this.get_SysCategories().GetEnumerator();
			try
			{
				while (V_1.MoveNext())
				{
					V_2 = V_1.get_Current();
					if (!V_0.get_IsSucceed())
					{
						continue;
					}
					V_2.set_ParentId(parentId.ToString());
					V_2.set_ParentType(2);
					V_2.set_Specificulture(this.get_Specificulture());
					ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixRelatedAttributeDatas.FormViewModel>(V_2.SaveModel(false, context, transaction), ref V_0);
				}
			}
			finally
			{
				((IDisposable)V_1).Dispose();
			}
			V_1 = this.get_SysTags().GetEnumerator();
			try
			{
				while (V_1.MoveNext())
				{
					V_3 = V_1.get_Current();
					if (!V_0.get_IsSucceed())
					{
						continue;
					}
					V_3.set_ParentId(parentId.ToString());
					V_3.set_ParentType(2);
					V_3.set_Specificulture(this.get_Specificulture());
					ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixRelatedAttributeDatas.FormViewModel>(V_3.SaveModel(false, context, transaction), ref V_0);
				}
			}
			finally
			{
				((IDisposable)V_1).Dispose();
			}
			return V_0;
		}
Пример #17
0
			V_0 = Expression.Parameter(Type.GetTypeFromHandle(// 
			// Current member / type: System.Void Mix.Cms.Lib.ViewModels.MixThemes.UpdateViewModel::ExpandView(Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
			// Exception in: System.Void ExpandView(Mix.Cms.Lib.Models.Cms.MixCmsContext,Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction)
			// Specified method is not supported.
			// 
			// mailto: [email protected]


		private RepositoryResponse<bool> ImportAssetsAsync(MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			V_0 = new RepositoryResponse<bool>();
			V_1 = string.Concat(this.get_Asset().get_FileFolder(), "/", this.get_Asset().get_Filename(), this.get_Asset().get_Extension());
			if (!File.Exists(V_1))
			{
				V_0.get_Errors().Add("Cannot saved asset file");
			}
			else
			{
				FileRepository.get_Instance().UnZipFile(V_1, this.get_Asset().get_FileFolder());
				V_0.set_IsSucceed(true);
			}
			return V_0;
		}
Пример #18
0
		public override RepositoryResponse<bool> SaveSubModels(MixAttributeSetData parent, MixCmsContext _context, IDbContextTransaction _transaction)
		{
			stackVariable0 = new RepositoryResponse<bool>();
			stackVariable0.set_IsSucceed(true);
			V_0 = stackVariable0;
			if (V_0.get_IsSucceed())
			{
				V_1 = this.get_Values().GetEnumerator();
				try
				{
					while (V_1.MoveNext())
					{
						V_2 = new Mix.Cms.Lib.ViewModels.MixAttributeSetDatas.UpdateViewModel.u003cu003ec__DisplayClass78_0();
						V_2.item = V_1.get_Current();
						if (!V_0.get_IsSucceed())
						{
							break;
						}
						V_2.item.set_Field(this.get_Fields().Find(new Predicate<Mix.Cms.Lib.ViewModels.MixAttributeFields.UpdateViewModel>(V_2.u003cSaveSubModelsu003eb__0)));
						stackVariable25 = V_2.item;
						stackVariable28 = V_2.item.get_Field();
						if (stackVariable28 != null)
						{
							stackVariable29 = stackVariable28.get_Priority();
						}
						else
						{
							dummyVar0 = stackVariable28;
							stackVariable29 = V_2.item.get_Priority();
						}
						stackVariable25.set_Priority(stackVariable29);
						V_2.item.set_DataId(parent.get_Id());
						V_2.item.set_Specificulture(parent.get_Specificulture());
						ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixAttributeSetValues.UpdateViewModel>(V_2.item.SaveModel(false, _context, _transaction), ref V_0);
					}
				}
				finally
				{
					((IDisposable)V_1).Dispose();
				}
			}
			return V_0;
		}
Пример #19
0
 protected RepositoryResponse <List <TView> > SaveList(List <TView> lstVm, bool isSaveSubModel)
 {
     stackVariable0 = new RepositoryResponse <List <TView> >();
     stackVariable0.set_IsSucceed(true);
     V_0 = stackVariable0;
     if (lstVm == null)
     {
         return(V_0);
     }
     V_1 = lstVm.GetEnumerator();
     try
     {
         while (V_1.MoveNext())
         {
             V_2             = V_1.get_Current().SaveModel(isSaveSubModel, BaseRestApiController <TDbContext, TModel, TView> ._context, BaseRestApiController <TDbContext, TModel, TView> ._transaction);
             stackVariable15 = V_0;
             if (!V_0.get_IsSucceed())
             {
                 stackVariable18 = false;
             }
             else
             {
                 stackVariable18 = V_2.get_IsSucceed();
             }
             stackVariable15.set_IsSucceed(stackVariable18);
             if (V_2.get_IsSucceed())
             {
                 continue;
             }
             V_0.set_Exception(V_2.get_Exception());
             V_0.get_Errors().AddRange(V_2.get_Errors());
         }
     }
     finally
     {
         ((IDisposable)V_1).Dispose();
     }
     return(V_0);
 }
		public RepositoryResponse<string> ProcessSelectedExportDataAsync()
		{
			UnitOfWorkHelper<MixCmsContext>.InitTransaction(null, null, ref V_0, ref V_1, ref V_2);
			stackVariable5 = new RepositoryResponse<string>();
			stackVariable5.set_IsSucceed(true);
			V_3 = stackVariable5;
			try
			{
				try
				{
					this.ProcessPages(V_0, V_1);
					this.ProcessModules(V_0, V_1);
					this.ProcessAttributeSetsAsync(V_0, V_1);
					this.ProcessAttributeSetData(V_0, V_1);
					this.ProcessDatas(V_0, V_1);
					V_4 = V_3;
				}
				catch (Exception exception_0)
				{
					V_5 = exception_0;
					V_6 = UnitOfWorkHelper<MixCmsContext>.HandleException<Mix.Cms.Lib.ViewModels.MixPages.ImportViewModel>(V_5, V_2, V_1);
					V_3.set_IsSucceed(false);
					V_3.set_Errors(V_6.get_Errors());
					V_3.set_Exception(V_5);
					V_4 = V_3;
				}
			}
			finally
			{
				if (V_2)
				{
					RelationalDatabaseFacadeExtensions.CloseConnection(V_0.get_Database());
					V_1.Dispose();
					V_0.Dispose();
				}
			}
			return V_4;
		}