User Profile & Activity

Arief Handany Member
Page
of 20
Posted: March 23, 2015 2:53 AM

Hi Thomas,

Looks like the file path is too long, in the end i put it in my C:/ drive, i also get the same error if i put it inside crosslight samples.

Sorry for the long file name, hope that solve your problem :)

Best Regards
Arief

Hi Jimmy,

You actually need to call the method but it is actually useable because already generated by EDMX to inherit the EditableEntityRepository in the repository (if you peek this you can see InitializeSaveRequest).  So the bottom line is, it is built-in but user can choose whether want to use it or not.

Based from what i know repository generated from EDMX shouldn't expected to be changed, especially if you change the EDMX properties which means it can change repository dynamically and remove change that you made in that repository, so it is better to extend repository. I think it is also true for each files autogenerated from edmx.

Did it show any error code when you save the data? I think your extended repository already right.

You also need to extend from DomainModels\InventoryModel.Controller.cs generated from edmx into web.API controller using this code:

using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Web;using MyInventory.DomainModels;namespace MyInventory.DomainModels.Controllers
{
    partial class InventoryController
    {
        public InventoryController()
        {
            db.AfterSaveChangesDelegate = (context, affectedRows) =>
                {
                    if (affectedRows > 0)
                    {
                        string imagePath = HttpContext.Current.Server.MapPath("~/images");

                        if (db.Files != null && db.Files.Count() > 0)
                        {
                            foreach (var file in db.Files)
                            {
                                file.Save(Path.Combine(imagePath, file.Name == "Thumbnail" ? "thumbs" : "large"));
                            }
                        }
                    }
                };
        }
    }
}

 This code is for saving the file into web

Hope that solve the problems :)

Best Regards
Arief

Also i forgot to tell you need also changes in ItemRepository.cs:

protected override void InitializeSaveRequest(RestRequest request, IEnumerable<IEntity> entities)		{
			var items = entities.OfType<Item>();

			// send the new images (both thumbnail and large) along with the save request

			foreach (var item in items)
			{
				var originalItem = this.GetSingle(item.ItemID);

				if (originalItem.ImageDetail.ThumbnailImage != null)
                    request.AddFile("Thumbnail", originalItem.ImageDetail.ThumbnailImage, item.Image, "image/jpg");

				if (originalItem.ImageDetail.LargeImage != null)
                    request.AddFile("Large", originalItem.ImageDetail.LargeImage, item.Image, "image/jpg");
			}
		}

 Which is rather crucial for image uploading

Hi Jimmy,

I made a sample and i'm successfully upload image to File, you should check it out. I also use similar structure of your model and i also already try it in IOS and Android.

Here is the link sorry for using mediafire: http://www.mediafire.com/download/nnks8ymrn924djj/MyInventory_WebApi.zip

I only change these files:
myinventory.core\domainmodels\item.cs
MyInventory.Core\ViewModels\ItemEditorViewModel.cs
myinventory.core\models\item.formmetadata.cs
myinventory.core\bindingproviders\itemdetailbindingprovider.cs

My samples based on MyInventoryAPI

Based from what i found, previously i can't upload image which return error with HTML code then I use multiparts which solve the error but other than that i can upload file successfully (file appear in my webAPI folder and saved in database).

I suspect maybe there are something wrong with your EDMX configurations

If you may please send us your samples

Best Regards,
Arief

Hi Jimmy,

Did you already Allow Multiparts Media inside your Entity Data Model's Intersoft WebAPI EDM, if not please try changing the allow multiparts media to yes like in the screenshot.

Hope that solve the problem :)

Best Regard,
Arief






Posted: March 17, 2015 2:03 AM

Hi Thomas,

I found the cause of error which is caused by assembly. I already updated the samples from http://git.intersoftpt.com/projects/CROS-SUPP/repos/android-fusedlocationprovider/browse

You only need to insert the crosslight assemblies and googleplayservices-13.0 folder inside package folder for android fused location to run

Best Regards,
Arief

Posted: March 16, 2015 8:22 AM

Hi Thomas,

Did you use Migrate to Unified feature from Xamarin? You need to follow these steps (http://developer.xamarin.com/guides/cross-platform/macios/updating_ios_apps) from Xamarin to successfully migrate to unified API. Please try this samples, i already change the sample to unified api and attach it in this message just to make sure.


About the IOS 7, actually transculent modal navigation only supported for IOS 8, but IOS 8 work fine in my samples.

Hope that solve the problem :)

Best Regards,
Arief

Posted: March 16, 2015 4:09 AM

Hi Jimmy,

I'm unsuccessfully replicate your problem, i'm using Android in Windows 8, also i'm using MyInventory samples.

What i do:

  • I add multiple item with the same name (inside inventories.xml), and click one of them
  • Inside edit mode i change item into sold then press save icon
The result is only selected item is being struck-out, the other with same name not struck out.

What platform did you use? and What samples did you use?

If you could and would please send me your sample or replicate the problem using MyInventory samples (dont forget to delete the package, bin and obj file) thanks! :)

Best Regards,
Arief





Posted: March 16, 2015 1:54 AM

Hi Thomas,

For that problem usually i only use clean and rebuild project however if the problem still persist you can try:

  • Deleting bin & obj inside .Core & . Android folder
  • Check references are they connected to newest crosslight assembly?
Hope that'll help!

Best Regards,
Arief

Hi Leo,

Our development team has successfully identified the issue and already done creating the hotfix, you can download the hotfix here: http://git.intersoftpt.com/projects/CROS/repos/updates/browse/Crosslight3_0_5000_211

Yes you are right about the problem by the way, thanks for the information and you feedback! :)

All times are GMT -5. The time now is 9:46 AM.
Previous Next