Example #1
0
		public static RepositoryResponse<string> ExportAttributeToExcel(List<JObject> lstData, string sheetName, string folderPath, string fileName, List<string> headers = null)
		{
			V_0 = new RepositoryResponse<string>();
			try
			{
				if (lstData.get_Count() <= 0)
				{
					V_0.get_Errors().Add("Can not export data of empty list");
					V_16 = V_0;
				}
				else
				{
					V_3 = DateTime.get_Now();
					V_1 = string.Concat(fileName, "-", V_3.ToString("yyyyMMdd"), ".xlsx");
					V_2 = new DataTable();
					if (headers != null)
					{
						V_6 = headers.GetEnumerator();
						try
						{
							while (V_6.MoveNext())
							{
								V_7 = V_6.get_Current();
								dummyVar1 = V_2.get_Columns().Add(V_7, Type.GetTypeFromHandle(// 
								// Current member / type: Mix.Domain.Core.ViewModels.RepositoryResponse`1<System.String> Mix.Cms.Lib.ViewModels.MixAttributeSetDatas.Helper::ExportAttributeToExcel(System.Collections.Generic.List`1<Newtonsoft.Json.Linq.JObject>,System.String,System.String,System.String,System.Collections.Generic.List`1<System.String>)
								// Exception in: Mix.Domain.Core.ViewModels.RepositoryResponse<System.String> ExportAttributeToExcel(System.Collections.Generic.List<Newtonsoft.Json.Linq.JObject>,System.String,System.String,System.String,System.Collections.Generic.List<System.String>)
								// Specified method is not supported.
								// 
								// mailto: [email protected]


		public static async Task<RepositoryResponse<PaginationModel<TView>>> FilterByKeywordAsync<TView>(string culture, string attributeSetName, RequestPaging request, string keyword, Dictionary<string, StringValues> queryDictionary = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
 private void MapTheRestOfTheFieldsToVariables()
 {
     V_0 = this.delegateTypeDef.get_Fields().GetEnumerator();
     try
     {
         while (V_0.MoveNext())
         {
             V_1 = V_0.get_Current();
             if (this.fieldDefToAssignedValueMap.ContainsKey(V_1))
             {
                 continue;
             }
             stackVariable15 = this.context.get_MethodContext();
             V_3             = stackVariable15.get_LambdaVariablesCount();
             stackVariable15.set_LambdaVariablesCount(V_3 + 1);
             V_2 = new VariableDefinition(String.Concat("lambdaVar", V_3.ToString()), V_1.get_FieldType(), this.context.get_MethodContext().get_Method());
             this.context.get_MethodContext().get_Variables().Add(V_2);
             dummyVar0 = this.context.get_MethodContext().get_VariablesToRename().Add(V_2);
             this.fieldDefToAssignedValueMap.set_Item(V_1, new VariableReferenceExpression(V_2, null));
         }
     }
     finally
     {
         V_0.Dispose();
     }
     return;
 }
Example #3
0
 private void OnLoad(Media model)
 {
     if (model != null)
     {
         V_0            = null;
         stackVariable5 = V_0;
         V_0            = null;
         model.set_PublicUrl(this.GetPublicUrl(model, stackVariable5, V_0, null));
         V_1 = App.get_MediaTypes().get_MetaProperties().GetEnumerator();
         try
         {
             while (V_1.MoveNext())
             {
                 V_2     = new MediaService.u003cu003ec__DisplayClass27_0();
                 V_2.key = V_1.get_Current();
                 if (model.get_Properties().Any <KeyValuePair <string, string> >(new Func <KeyValuePair <string, string>, bool>(V_2.u003cOnLoadu003eb__0)))
                 {
                     continue;
                 }
                 model.get_Properties().Add(V_2.key, null);
             }
         }
         finally
         {
             if (V_1 != null)
             {
                 V_1.Dispose();
             }
         }
         App.get_Hooks().OnLoad <Media>(model);
         stackVariable33 = this._cache;
         if (stackVariable33 == null)
         {
             dummyVar0 = stackVariable33;
             return;
         }
         V_3 = model.get_Id();
         stackVariable33.Set <Media>(V_3.ToString(), model);
     }
     return;
 }
Example #4
0
		public override void Validate(MixCmsContext _context = null, IDbContextTransaction _transaction = null)
		{
			stackVariable1 = this.get_MediaFile();
			if (stackVariable1 != null)
			{
				stackVariable2 = stackVariable1.get_FileStream();
			}
			else
			{
				dummyVar0 = stackVariable1;
				stackVariable2 = false;
			}
			if (!stackVariable2)
			{
				if (this.get_File() != null)
				{
					stackVariable14 = MixService.GetTemplateUploadFolder(this.get_Specificulture());
					V_0 = DateTime.get_UtcNow();
					this.set_FileFolder(string.Concat(stackVariable14, "/", V_0.ToString("yyyy-MM")));
					stackVariable33 = SeoHelper.GetSEOString(this.get_File().get_FileName().Substring(0, this.get_File().get_FileName().LastIndexOf('.')), '-');
					V_3 = DateTime.get_UtcNow().get_Ticks();
					this.set_FileName(string.Concat(stackVariable33, V_3.ToString()));
					this.set_Extension(this.get_File().get_FileName().Substring(this.get_File().get_FileName().LastIndexOf('.')));
					V_2 = FileRepository.get_Instance().SaveWebFile(this.get_File(), string.Concat(this.get_FileName(), this.get_Extension()), this.get_FileFolder());
					if (V_2.get_IsSucceed())
					{
						this.set_IsValid(false);
						this.get_Errors().AddRange(V_2.get_Errors());
					}
					if (string.IsNullOrEmpty(this.get_Title()))
					{
						this.set_Title(this.get_FileName());
					}
				}
			}
			else
			{
				stackVariable78 = MixService.GetTemplateUploadFolder(this.get_Specificulture());
				V_0 = DateTime.get_UtcNow();
				this.set_FileFolder(string.Concat(stackVariable78, "/", V_0.ToString("yyyy-MM")));
				stackVariable86 = this.get_MediaFile();
				stackVariable92 = SeoHelper.GetSEOString(this.get_MediaFile().get_Filename(), '-').ToLower();
				V_1 = Guid.NewGuid();
				stackVariable86.set_Filename(string.Concat(stackVariable92, V_1.ToString("N")));
				this.get_MediaFile().set_FileFolder(this.get_FileFolder());
				if (!FileRepository.get_Instance().SaveWebFile(this.get_MediaFile()))
				{
					this.set_IsValid(false);
				}
				else
				{
					this.set_Extension(this.get_MediaFile().get_Extension().ToLower());
					this.set_FileName(this.get_MediaFile().get_Filename());
					this.set_FileFolder(this.get_MediaFile().get_FileFolder());
					if (string.IsNullOrEmpty(this.get_Title()))
					{
						this.set_Title(this.get_FileName());
					}
				}
			}
			stackVariable7 = this.get_FileType();
			if (stackVariable7 == null)
			{
				dummyVar1 = stackVariable7;
				stackVariable7 = "image";
			}
			this.set_FileType(stackVariable7);
			this.Validate(_context, _transaction);
			return;
		}