parent
fd3aacf010
commit
bf31814c9c
@ -12497,6 +12497,17 @@
|
||||
<param name="mainSections"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IGanjoorService.SetCategoryExtraInfo(System.Int32,System.String,System.Nullable{System.Guid},System.Boolean,System.String)">
|
||||
<summary>
|
||||
Update category extra info
|
||||
</summary>
|
||||
<param name="catId"></param>
|
||||
<param name="bookName"></param>
|
||||
<param name="imageId"></param>
|
||||
<param name="sumUpSubsGeoLocations"></param>
|
||||
<param name="mapName"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IGanjoorService.GetPageByUrl(System.String,System.Boolean)">
|
||||
<summary>
|
||||
get page by url
|
||||
@ -15670,6 +15681,17 @@
|
||||
<param name="mainSections"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.Implementation.GanjoorService.SetCategoryExtraInfo(System.Int32,System.String,System.Nullable{System.Guid},System.Boolean,System.String)">
|
||||
<summary>
|
||||
Update category extra info
|
||||
</summary>
|
||||
<param name="catId"></param>
|
||||
<param name="bookName"></param>
|
||||
<param name="imageId"></param>
|
||||
<param name="sumUpSubsGeoLocations"></param>
|
||||
<param name="mapName"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.Implementation.GanjoorService.GetCatById(System.Int32,System.Boolean,System.Boolean)">
|
||||
<summary>
|
||||
get cat by id
|
||||
|
||||
@ -62,6 +62,17 @@ namespace RMuseum.Services
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<GanjoorPoetCompleteViewModel>> GetCatByUrl(string url, bool poems = false, bool mainSections = false);
|
||||
|
||||
/// <summary>
|
||||
/// Update category extra info
|
||||
/// </summary>
|
||||
/// <param name="catId"></param>
|
||||
/// <param name="bookName"></param>
|
||||
/// <param name="imageId"></param>
|
||||
/// <param name="sumUpSubsGeoLocations"></param>
|
||||
/// <param name="mapName"></param>
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<GanjoorCatViewModel>> SetCategoryExtraInfo(int catId, string bookName, Guid? imageId, bool sumUpSubsGeoLocations, string mapName);
|
||||
|
||||
/// <summary>
|
||||
/// get page by url
|
||||
/// </summary>
|
||||
|
||||
@ -172,6 +172,43 @@ namespace RMuseum.Services.Implementation
|
||||
return await GetCatById(cat.Id, poems, mainSections);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update category extra info
|
||||
/// </summary>
|
||||
/// <param name="catId"></param>
|
||||
/// <param name="bookName"></param>
|
||||
/// <param name="imageId"></param>
|
||||
/// <param name="sumUpSubsGeoLocations"></param>
|
||||
/// <param name="mapName"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<RServiceResult<GanjoorCatViewModel>> SetCategoryExtraInfo(int catId, string bookName, Guid? imageId, bool sumUpSubsGeoLocations, string mapName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var cat = await _context.GanjoorCategories.Where(c => c.Id == catId).SingleOrDefaultAsync();
|
||||
if (cat == null)
|
||||
return new RServiceResult<GanjoorCatViewModel>(null);//not found
|
||||
cat.BookName = bookName;
|
||||
cat.RImageId = imageId;
|
||||
cat.SumUpSubsGeoLocations = sumUpSubsGeoLocations;
|
||||
cat.MapName = mapName;
|
||||
_context.Update(cat);
|
||||
await _context.SaveChangesAsync();
|
||||
return new RServiceResult<GanjoorCatViewModel>
|
||||
(
|
||||
new GanjoorCatViewModel()
|
||||
{
|
||||
RImageId = imageId,
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
return new RServiceResult<GanjoorCatViewModel>(null, exp.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get cat by id
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user