Hi, Thanks a lot.It is working.Cheers :)
Hi, Thanks a lot :) I'll try the AngularJS-native version.I think it is the best for my job. B'cos I tried it with the Jquery version you have mentioned above.But it doesn't work with the below kind of set up.
ng-options="a.id as a.name + ' | '+ a.zipCode for a in vm.cities"
It just work only the simple query like this :
ng-options="a.id as a.name for a in vm.cities"
Do you know any way to sort out this issue or is this the limitation of the uiJq directive ? Thanks.
Hi, But it is not the angular version no ? Could you tell me the url for the angular version ? Thanks.
Hi, Could you tell me which library you're using for below mentioned drop down ? If you can provide any doc reference for that it's highly appreciated. Thanks.
<div class="form-group">
<label for="LanguageNameSelectionCombobox">@L("Language")</label>
<select
id="LanguageNameSelectionCombobox"
class="form-control"
ng-options="languageName.value as languageName.displayText for languageName in vm.languageNames"
ng-model="vm.language.name"
ui-jq="selectpicker"
ui-options='{ iconBase: "famfamfam-flag", tickIcon: "fa fa-check" }'
ng-change="vm.languageChanged()"
data-live-search="true"></select>
</div>
Hi, Could you tell me how to do this "If you really don't need, you can remove ISoftDelete from your child entity, since soft-delete can be problematic in some cases and it should be carefully used." ? Thanks.
Note : Actually I don't need to keep that child entity on "TaxMapLots" table.
Hi, Could you tell me how to use "SweetAlert" on my app ? I can see that there is a lib added to the project.But "hSweetAlert" module has not been injected on the app.js file.So then how can I use it ? Thanks.
I just need to show message like this :
sweet.show('Simple right?');
Hi, Perfect it works.I have created a new webApi controller on the WebApi Layer as PictureController .Thanks a lot :)
Here is the complete code snippet.
public class PictureController : IPApiControllerBase
{
/// <summary>
/// to Add Pictures
/// </summary>
[HttpPost]
public async Task<HttpResponseMessage> AddPictures()
{
if (!Request.Content.IsMimeMultipartContent())
{
this.Request.CreateResponse(HttpStatusCode.UnsupportedMediaType);
}
var newImageName = string.Empty;
var path = System.Web.Hosting.HostingEnvironment.MapPath("~");
var provider = GetMultipartProvider();
await Request.Content.ReadAsMultipartAsync(provider);
foreach (var r in provider.FileData)
{
var uploadedFileInfo = new FileInfo(r.LocalFileName);
var uploadedFileName = uploadedFileInfo.Name;
var originalFileName = GetDeserializedFileName(r);
var extension = Path.GetExtension(originalFileName);
if (extension == null) continue;
var ext = extension.ToLower();
var guid = Guid.NewGuid().ToString();
newImageName = guid + ext;
try
{
File.Move(path + "\\Common\\temp\\" + uploadedFileName, path + "\\Common\\pictures\\" + newImageName);
}
catch (IOException ex)
{
//Write error
}
}
return Request.CreateResponse(HttpStatusCode.OK, new { newImageName });
}
#region Private Methods
/// <summary>
/// to Get Multi part Provider
/// </summary>
private MultipartFormDataStreamProvider GetMultipartProvider()
{
const string uploadFolder = "~/Common/temp";
var root = HttpContext.Current.Server.MapPath(uploadFolder);
Directory.CreateDirectory(root);
return new MultipartFormDataStreamProvider(root);
}
/// <summary>
/// to Get De-serialized File Name
/// </summary>
private string GetDeserializedFileName(MultipartFileData fileData)
{
var fileName = GetFileName(fileData);
return JsonConvert.DeserializeObject(fileName).ToString();
}
/// <summary>
/// to Get File Name
/// </summary>
private string GetFileName(MultipartFileData fileData)
{
return fileData.Headers.ContentDisposition.FileName;
}
#endregion Private Methods
}
Hi, Actuality when I use "_context" then it woks fine.You can see that on my 1st post.That code is working fine.When I use the repository then it doesn't delete the data after this line " await _unitOfWorkManager.Current.SaveChanges();//not save this into db here".After the run of the above line (on bedbug mode) , I have checked the data row's "Isdeleted" flag.It remains as "false" and if I run further it gives below mentioned error.My sole purpose is to avoid below mentioned error.I don't have any mapping issues here.Hence it is working fine when I use the "_context" (1st post).So what is your thoughts about this strange behaviour ? Thanks.
The relationship could not
be changed because one or more of the foreign-key properties is non-nullable. When
a change is made to a relationship, the related foreign-key property is set to a
null value.
Hi Halil, Do you have any feedback for this issue ? Thanks.
Hi, I have developed below mentioned code snippets for the app with the WebApi (not for the ABP app).So my question is how can I replace Application Layer method instaed of the Web api Url below (i.e. url: "/api/EventImages/AddPictures",) ? Thanks.
Note : In other words how can I implement below kind of implementation with the ABP.
JS
//to add Pictures
vm.AddPictures = function ($files) {
vm.upload = [];
for (var i = 0; i < $files.length; i++) {
var $file = $files_;
(function (index) {
vm.upload[index] = $upload.upload({
url: "/api/EventImages/AddPictures",
method: "POST",
data: {},
file: $file
}).progress(function (evt) {
}).success(function (data, status, headers, config) {
}).error(function (data, status, headers, config) {
});
})(i);
}
};
[i:2h7l3lfn]Web Api method which above app has been consumed_
[HttpPost]
public async Task<HttpResponseMessage> AddPictures()
{
if (!Request.Content.IsMimeMultipartContent())
{
this.Request.CreateResponse(HttpStatusCode.UnsupportedMediaType);
}
var newImageName = string.Empty;
var path = System.Web.Hosting.HostingEnvironment.MapPath("~");
var provider = GetMultipartProvider();
await Request.Content.ReadAsMultipartAsync(provider);
foreach (var r in provider.FileData)
{
var uploadedFileInfo = new FileInfo(r.LocalFileName);
var uploadedFileName = uploadedFileInfo.Name;
var originalFileName = GetDeserializedFileName(r);
var extension = Path.GetExtension(originalFileName);
if (extension == null) continue;
var ext = extension.ToLower();
var guid = Guid.NewGuid().ToString();
newImageName = guid + ext;
try
{
File.Move(path + "\\Resources\\images\\temp\\" + uploadedFileName, path + "\\Resources\\images\\event-images\\" + newImageName);
}
catch (IOException ex)
{
//Write error
}
}
return Request.CreateResponse(HttpStatusCode.OK, new { newImageName });
}