C# Class Spontaneous.WebApp.Services.ServiceLayerImpl

Inheritance: IServicesLayer, IBackofficeService
Show file Open project: pashkov/Spontaneous Class Usage Examples

Public Methods

Method Description
AddCouponToDB ( CouponType coupon ) : string
AddGeneralDishToDB ( GeneralDish generalDish ) : string
AddNewDish ( DishModel dish ) : int
AddNewDishBasic ( string restId, int menuPartId, Dish dish ) : int
AddNewMenuPartBasic ( string restaurantId, MenuPart menuPart ) : int
AddNewMenuPartModel ( MenuPartModel MenuPart ) : int
AddNewRestaurantFromOsmRest ( RestaurantOsm osmRest ) : void

Add conver RestaurantOsm to RestaurantBasicData and Add new rest to DB

AddRestaurantBasicToDB ( RestaurantBasicData restaurant ) : string
AddRestaurantToDB ( RestaurantModel restaurantmodel ) : string
ApproveMeal ( IEnumerable meal ) : void
BasicRestApproveMeal ( List portions ) : void
CalculateDistanceInKm ( LocationModel location1, LocationModel location2 ) : double
CalculateDistanceInRad ( LocationModel location1, LocationModel location2 ) : double
CompareAllOsmRestaurantsWithDB ( ) : RestaurantsCompareList

Compare all existing OSM restaurants in ImportedRestaurantsDB with all RestaurantBasicData in main DB in CompareList in ImportedRestaurantsDB

CompareRestaurantsNames ( string rest1Name, string rest2Name ) : bool

Compare existing restaurants in DB with new Open Street Map restaurant list (by calling FindSimilarRestaurants

CopySelectedDishes ( CopyList copyList ) : void
CopySelectedMemuParts ( CopyList copyList ) : void
DeleteCoupon ( string id ) : void
DeleteDish ( DishModel Dish ) : void
DeleteGeneralDish ( string id ) : void
DeleteMenuPart ( MenuPartModel MenuPart ) : void
DeleteRestaurant ( string id ) : void
FindSimilarRestaurants ( ) : RestaurantsCompareList
GetAllCoupons ( ) : List
GetAllGeneralDishes ( ) : List
GetAllGeneralDishesOrderBy ( ) : List
GetAllIngredients ( ) : List
GetAllRestaurants ( bool withMenu = true ) : List
GetAllRestaurantsBasic ( ) : List
GetAllRestaurantsBasicSortedBy ( string sortFiled, int limit = 50 ) : List
GetAllRestaurantsInStringList ( ) : List
GetChainRestaurantsBasicByName ( string name ) : List
GetClosesMedal ( ) : MedalProgress
GetCoupon ( SpontaneousUserModel userData, UserActivity userActivity ) : CouponType
GetCouponById ( string couponId ) : CouponType
GetCouponModelById ( string couponId ) : CouponTypeModel
GetDefaultItems ( System.Web.Security.MembershipUser currentUser, Location userLocation ) : IList
GetDish ( System.Guid dishId ) : DishModel

Gets dish by unique Id.

GetDish ( int MenuPartId, string RestaurantId, int Id, string lang = DefaultLang, RestaurantModel restaurantModel = null ) : DishModel
GetDishBasic ( int menuPartId, string restaurantId, int Id ) : Dish
GetDishEntitiesList ( string restId, int menuPartId ) : List
GetGeneralDishById ( string dishId ) : GeneralDish
GetIdByMenuPartName ( string restaurantId, string menuPartName ) : int
GetIngredientById ( string id ) : Ingredient
GetIngredientByNDBNo ( int ndbNo ) : Ingredient
GetLastMedal ( ) : UserMedalModel
GetMedals ( ) : List
GetMenuListBasic ( string restaurantId ) : List
GetMenuPart ( int id, string restaurantId, string lang = DefaultLang ) : MenuPartModel
GetMenuPartBasic ( int id, string RestaurantId ) : MenuPart
GetPagedRestaurants ( int page, int pageSize, SortByEnum sortedBy ) : PagedList
GetPagedRestaurantsSortedNotByMongo ( int page, int pageSize, SortByEnum sortedBy ) : PagedList

Same to GetPagedRestaurants but sorting performed not by MongoDB query

GetProductByLastCharsOfBarcode ( string barcode ) : ProductCatalogViewModel
GetRecipeByPartialName ( string partialName ) : RecipeModel
GetRestaurantBasicById ( string id ) : RestaurantBasicData
GetRestaurantBasicByIdFromBackup ( string id ) : RestaurantBasicData
GetRestaurantBasicByName ( string name ) : RestaurantBasicData
GetRestaurantById ( string id, string lang = DefaultLang ) : RestaurantModel
GetRestaurantByName ( string name ) : RestaurantModel
GetTotalPoints ( ) : int
GetUserLastMeal ( ) : Meal
GetUserLastMealViewModel ( ) : MealViewModel
GoogleTranslate ( string Text, string targetlan ) : string
IdsListToRestaurantListEntity ( List list ) : List
IngredientSearch ( System.Web.Security.MembershipUser currentUser, Location userLocation, int searchCount, string searchText ) : List
MedalsNotificationCheck ( ) : bool
MenuClone ( MenuCopyModel menuCopy ) : void
MenuCloneFromRestaurant ( string CopyFromId, string CopyToId ) : void
PrintCompareListCounts ( RestaurantsCompareList compareList ) : void

Print to log compareList

SaveUserActivity ( UserActivity userActivity ) : void
Search ( System.Web.Security.MembershipUser currentUser, Location userLocation, int searchCount, string searchText, double maxDistance ) : IList

Returns most relevant items (Restaurants and menu items from database). Ordered by distance from the searchable item.

SearchGeneralDish ( System.Web.Security.MembershipUser currentUser, Location userLocation, int searchCount, string searchText ) : List
SearchNearest ( System.Web.Security.MembershipUser currentUser, Location userLocation, int searchCount, double maxDistance ) : IList
SearchNearestService ( Location location, int searchCount, double maxDistance ) : IList

Will use this function to find similar restaurants in DB, while import new restaurants

ServiceLayerImpl ( ) : System
ServiceLayerImpl ( UserProfileFacade userProfilefacade ) : System
ToStringRestaurantsList ( List restaurantsBasicList ) : List
TranslateDish ( Dish dish, string fromLang, string targetlang ) : Dish
TranslateDish ( string restId, int menuPartId, int dishId, string fromLang, string targetlang ) : Dish
TranslateMenuPart ( MenuPart menuPart, string fromLang, string targetlang, bool withMenu ) : MenuPart
TranslateMenuPart ( MenuPartModel menuPartModel, string fromLang, string targetlang, bool withMenu ) : MenuPart
TranslateMenuParts ( List menuParts, string fromLang, string targetlang, bool withMenu ) : List
TranslateRestaurant ( RestaurantBasicData rest, string fromLang, string targetlang, bool withMenu ) : RestaurantBasicData
TranslateRestaurant ( string restId, string fromLang, string targetlang, bool withMenu ) : RestaurantBasicData
TurnOffMedalFlag ( ) : bool
UpdateCarbsInLastMeal ( string restaurnatId, int menuPartId, int dishId, double totalCarbohydrate ) : bool
UpdateCompareResult ( RestaurantsCompareList compareList ) : void

If find new restaurants, add them to DB, if already exists compare attributes and update if necessary

UpdateCoupon ( CouponType coupon ) : void
UpdateCoupon ( CouponTypeModel couponModel ) : void
UpdateDbFromRestaurantOsmData ( ObjectId osmRestId ) : void

Should add new restaurant if not exists or add new data to existing restaurant

UpdateDbFromRestaurantOsmData ( ObjectId osmRestId, ObjectId similarRestId ) : void

Should add new restaurant if not exists or add new data to existing restaurant

UpdateDish ( Dish dish, string restaurantId, int menuPartId ) : void

Only for update dish image functions and Localized translateions

UpdateDish ( DishModel dishModel ) : void
UpdateDishAndCarbs ( DishModel Dish ) : void
UpdateDishCarbs ( IPrincipal user, string restournatId, int menuPartId, int dishId, double totalCarbohydrate ) : bool

Updates dish carbohidrates, writes to user history

UpdateGeneralDish ( GeneralDish generalDish ) : void
UpdateIngredient ( Ingredient ingredient ) : void
UpdateMenuPart ( MenuPartModel MenuPart ) : void
UpdatePostMealSugar ( int sugarLevel ) : void
UpdatePreMealSugar ( int sugarLevel, int targetSugar ) : void
UpdateRestaurant ( RestaurantBasicData restaurant ) : void
UpdateRestaurant ( RestaurantModel restaurantmodel ) : void
UserLastMealCompleteRequirement ( ) : bool
UserUpdateRestaurant ( RestaurantModel restaurantmodel ) : void
VerifyUserLastMeal ( ) : double

Method Details

AddCouponToDB() public method

public AddCouponToDB ( CouponType coupon ) : string
coupon Spontaneous.DataModel.CouponType
return string

AddGeneralDishToDB() public method

public AddGeneralDishToDB ( GeneralDish generalDish ) : string
generalDish Spontaneous.DataModel.GeneralDish
return string

AddNewDish() public method

public AddNewDish ( DishModel dish ) : int
dish Spontaneous.WebApp.Models.DishModel
return int

AddNewDishBasic() public method

public AddNewDishBasic ( string restId, int menuPartId, Dish dish ) : int
restId string
menuPartId int
dish Spontaneous.DataModel.Dish
return int

AddNewMenuPartBasic() public method

public AddNewMenuPartBasic ( string restaurantId, MenuPart menuPart ) : int
restaurantId string
menuPart Spontaneous.DataModel.MenuPart
return int

AddNewMenuPartModel() public method

public AddNewMenuPartModel ( MenuPartModel MenuPart ) : int
MenuPart Spontaneous.WebApp.Models.MenuPartModel
return int

AddNewRestaurantFromOsmRest() public method

Add conver RestaurantOsm to RestaurantBasicData and Add new rest to DB
public AddNewRestaurantFromOsmRest ( RestaurantOsm osmRest ) : void
osmRest Spontaneous.DataModel.RestaurantOsm
return void

AddRestaurantBasicToDB() public method

public AddRestaurantBasicToDB ( RestaurantBasicData restaurant ) : string
restaurant Spontaneous.DataModel.RestaurantBasicData
return string

AddRestaurantToDB() public method

public AddRestaurantToDB ( RestaurantModel restaurantmodel ) : string
restaurantmodel Spontaneous.WebApp.Models.RestaurantModel
return string

ApproveMeal() public method

public ApproveMeal ( IEnumerable meal ) : void
meal IEnumerable
return void

BasicRestApproveMeal() public method

public BasicRestApproveMeal ( List portions ) : void
portions List
return void

CalculateDistanceInKm() public method

public CalculateDistanceInKm ( LocationModel location1, LocationModel location2 ) : double
location1 Spontaneous.WebApp.Models.LocationModel
location2 Spontaneous.WebApp.Models.LocationModel
return double

CalculateDistanceInRad() public method

public CalculateDistanceInRad ( LocationModel location1, LocationModel location2 ) : double
location1 Spontaneous.WebApp.Models.LocationModel
location2 Spontaneous.WebApp.Models.LocationModel
return double

CompareAllOsmRestaurantsWithDB() public method

Compare all existing OSM restaurants in ImportedRestaurantsDB with all RestaurantBasicData in main DB in CompareList in ImportedRestaurantsDB
public CompareAllOsmRestaurantsWithDB ( ) : RestaurantsCompareList
return Spontaneous.DataModel.RestaurantsCompareList

CompareRestaurantsNames() public method

Compare existing restaurants in DB with new Open Street Map restaurant list (by calling FindSimilarRestaurants
public CompareRestaurantsNames ( string rest1Name, string rest2Name ) : bool
rest1Name string
rest2Name string
return bool

CopySelectedDishes() public method

public CopySelectedDishes ( CopyList copyList ) : void
copyList Spontaneous.DataModel.CopyList
return void

CopySelectedMemuParts() public method

public CopySelectedMemuParts ( CopyList copyList ) : void
copyList Spontaneous.DataModel.CopyList
return void

DeleteCoupon() public method

public DeleteCoupon ( string id ) : void
id string
return void

DeleteDish() public method

public DeleteDish ( DishModel Dish ) : void
Dish Spontaneous.WebApp.Models.DishModel
return void

DeleteGeneralDish() public method

public DeleteGeneralDish ( string id ) : void
id string
return void

DeleteMenuPart() public method

public DeleteMenuPart ( MenuPartModel MenuPart ) : void
MenuPart Spontaneous.WebApp.Models.MenuPartModel
return void

DeleteRestaurant() public method

public DeleteRestaurant ( string id ) : void
id string
return void

FindSimilarRestaurants() public method

public FindSimilarRestaurants ( ) : RestaurantsCompareList
return Spontaneous.DataModel.RestaurantsCompareList

GetAllCoupons() public method

public GetAllCoupons ( ) : List
return List

GetAllGeneralDishes() public method

public GetAllGeneralDishes ( ) : List
return List

GetAllGeneralDishesOrderBy() public method

public GetAllGeneralDishesOrderBy ( ) : List
return List

GetAllIngredients() public method

public GetAllIngredients ( ) : List
return List

GetAllRestaurants() public method

public GetAllRestaurants ( bool withMenu = true ) : List
withMenu bool
return List

GetAllRestaurantsBasic() public method

public GetAllRestaurantsBasic ( ) : List
return List

GetAllRestaurantsBasicSortedBy() public method

public GetAllRestaurantsBasicSortedBy ( string sortFiled, int limit = 50 ) : List
sortFiled string
limit int
return List

GetAllRestaurantsInStringList() public method

public GetAllRestaurantsInStringList ( ) : List
return List

GetChainRestaurantsBasicByName() public method

public GetChainRestaurantsBasicByName ( string name ) : List
name string
return List

GetClosesMedal() public method

public GetClosesMedal ( ) : MedalProgress
return Spontaneous.DataModel.MedalProgress

GetCoupon() public method

public GetCoupon ( SpontaneousUserModel userData, UserActivity userActivity ) : CouponType
userData Spontaneous.DataModel.SpontaneousUserModel
userActivity Spontaneous.DataModel.UserActivity
return Spontaneous.DataModel.CouponType

GetCouponById() public method

public GetCouponById ( string couponId ) : CouponType
couponId string
return Spontaneous.DataModel.CouponType

GetCouponModelById() public method

public GetCouponModelById ( string couponId ) : CouponTypeModel
couponId string
return Spontaneous.WebApp.Models.CouponTypeModel

GetDefaultItems() public method

public GetDefaultItems ( System.Web.Security.MembershipUser currentUser, Location userLocation ) : IList
currentUser System.Web.Security.MembershipUser
userLocation Spontaneous.DataModel.Location
return IList

GetDish() public method

Gets dish by unique Id.
public GetDish ( System.Guid dishId ) : DishModel
dishId System.Guid
return Spontaneous.WebApp.Models.DishModel

GetDish() public method

public GetDish ( int MenuPartId, string RestaurantId, int Id, string lang = DefaultLang, RestaurantModel restaurantModel = null ) : DishModel
MenuPartId int
RestaurantId string
Id int
lang string
restaurantModel Spontaneous.WebApp.Models.RestaurantModel
return Spontaneous.WebApp.Models.DishModel

GetDishBasic() public method

public GetDishBasic ( int menuPartId, string restaurantId, int Id ) : Dish
menuPartId int
restaurantId string
Id int
return Spontaneous.DataModel.Dish

GetDishEntitiesList() public method

public GetDishEntitiesList ( string restId, int menuPartId ) : List
restId string
menuPartId int
return List

GetGeneralDishById() public method

public GetGeneralDishById ( string dishId ) : GeneralDish
dishId string
return Spontaneous.DataModel.GeneralDish

GetIdByMenuPartName() public method

public GetIdByMenuPartName ( string restaurantId, string menuPartName ) : int
restaurantId string
menuPartName string
return int

GetIngredientById() public method

public GetIngredientById ( string id ) : Ingredient
id string
return Spontaneous.DataModel.Ingredient

GetIngredientByNDBNo() public method

public GetIngredientByNDBNo ( int ndbNo ) : Ingredient
ndbNo int
return Spontaneous.DataModel.Ingredient

GetLastMedal() public method

public GetLastMedal ( ) : UserMedalModel
return Spontaneous.WebApp.Models.UserMedalModel

GetMedals() public method

public GetMedals ( ) : List
return List

GetMenuListBasic() public method

public GetMenuListBasic ( string restaurantId ) : List
restaurantId string
return List

GetMenuPart() public method

public GetMenuPart ( int id, string restaurantId, string lang = DefaultLang ) : MenuPartModel
id int
restaurantId string
lang string
return Spontaneous.WebApp.Models.MenuPartModel

GetMenuPartBasic() public method

public GetMenuPartBasic ( int id, string RestaurantId ) : MenuPart
id int
RestaurantId string
return Spontaneous.DataModel.MenuPart

GetPagedRestaurants() public method

public GetPagedRestaurants ( int page, int pageSize, SortByEnum sortedBy ) : PagedList
page int
pageSize int
sortedBy SortByEnum
return PagedList

GetPagedRestaurantsSortedNotByMongo() public method

Same to GetPagedRestaurants but sorting performed not by MongoDB query
public GetPagedRestaurantsSortedNotByMongo ( int page, int pageSize, SortByEnum sortedBy ) : PagedList
page int
pageSize int
sortedBy SortByEnum
return PagedList

GetProductByLastCharsOfBarcode() public method

public GetProductByLastCharsOfBarcode ( string barcode ) : ProductCatalogViewModel
barcode string
return Spontaneous.WebApp.Models.ProductCatalogViewModel

GetRecipeByPartialName() public method

public GetRecipeByPartialName ( string partialName ) : RecipeModel
partialName string
return Spontaneous.WebApp.Models.RecipeModel

GetRestaurantBasicById() public method

public GetRestaurantBasicById ( string id ) : RestaurantBasicData
id string
return Spontaneous.DataModel.RestaurantBasicData

GetRestaurantBasicByIdFromBackup() public method

public GetRestaurantBasicByIdFromBackup ( string id ) : RestaurantBasicData
id string
return Spontaneous.DataModel.RestaurantBasicData

GetRestaurantBasicByName() public method

public GetRestaurantBasicByName ( string name ) : RestaurantBasicData
name string
return Spontaneous.DataModel.RestaurantBasicData

GetRestaurantById() public method

public GetRestaurantById ( string id, string lang = DefaultLang ) : RestaurantModel
id string
lang string
return Spontaneous.WebApp.Models.RestaurantModel

GetRestaurantByName() public method

public GetRestaurantByName ( string name ) : RestaurantModel
name string
return Spontaneous.WebApp.Models.RestaurantModel

GetTotalPoints() public method

public GetTotalPoints ( ) : int
return int

GetUserLastMeal() public method

public GetUserLastMeal ( ) : Meal
return Spontaneous.DataModel.Meal

GetUserLastMealViewModel() public method

public GetUserLastMealViewModel ( ) : MealViewModel
return Spontaneous.WebApp.Models.MealViewModel

GoogleTranslate() public method

public GoogleTranslate ( string Text, string targetlan ) : string
Text string
targetlan string
return string

IdsListToRestaurantListEntity() public method

public IdsListToRestaurantListEntity ( List list ) : List
list List
return List

IngredientSearch() public method

public IngredientSearch ( System.Web.Security.MembershipUser currentUser, Location userLocation, int searchCount, string searchText ) : List
currentUser System.Web.Security.MembershipUser
userLocation Spontaneous.DataModel.Location
searchCount int
searchText string
return List

MedalsNotificationCheck() public method

public MedalsNotificationCheck ( ) : bool
return bool

MenuClone() public method

public MenuClone ( MenuCopyModel menuCopy ) : void
menuCopy Spontaneous.WebApp.Models.MenuCopyModel
return void

MenuCloneFromRestaurant() public method

public MenuCloneFromRestaurant ( string CopyFromId, string CopyToId ) : void
CopyFromId string
CopyToId string
return void

PrintCompareListCounts() public method

Print to log compareList
public PrintCompareListCounts ( RestaurantsCompareList compareList ) : void
compareList Spontaneous.DataModel.RestaurantsCompareList
return void

SaveUserActivity() public method

public SaveUserActivity ( UserActivity userActivity ) : void
userActivity Spontaneous.DataModel.UserActivity
return void

Search() public method

Returns most relevant items (Restaurants and menu items from database). Ordered by distance from the searchable item.
public Search ( System.Web.Security.MembershipUser currentUser, Location userLocation, int searchCount, string searchText, double maxDistance ) : IList
currentUser System.Web.Security.MembershipUser /// ///
userLocation Spontaneous.DataModel.Location /// ///
searchCount int
searchText string /// ///
maxDistance double
return IList

SearchGeneralDish() public method

public SearchGeneralDish ( System.Web.Security.MembershipUser currentUser, Location userLocation, int searchCount, string searchText ) : List
currentUser System.Web.Security.MembershipUser
userLocation Spontaneous.DataModel.Location
searchCount int
searchText string
return List

SearchNearest() public method

public SearchNearest ( System.Web.Security.MembershipUser currentUser, Location userLocation, int searchCount, double maxDistance ) : IList
currentUser System.Web.Security.MembershipUser
userLocation Spontaneous.DataModel.Location
searchCount int
maxDistance double
return IList

SearchNearestService() public method

Will use this function to find similar restaurants in DB, while import new restaurants
public SearchNearestService ( Location location, int searchCount, double maxDistance ) : IList
location Spontaneous.DataModel.Location
searchCount int
maxDistance double
return IList

ServiceLayerImpl() public method

public ServiceLayerImpl ( ) : System
return System

ServiceLayerImpl() public method

public ServiceLayerImpl ( UserProfileFacade userProfilefacade ) : System
userProfilefacade UserProfileFacade
return System

ToStringRestaurantsList() public method

public ToStringRestaurantsList ( List restaurantsBasicList ) : List
restaurantsBasicList List
return List

TranslateDish() public method

public TranslateDish ( Dish dish, string fromLang, string targetlang ) : Dish
dish Spontaneous.DataModel.Dish
fromLang string
targetlang string
return Spontaneous.DataModel.Dish

TranslateDish() public method

public TranslateDish ( string restId, int menuPartId, int dishId, string fromLang, string targetlang ) : Dish
restId string
menuPartId int
dishId int
fromLang string
targetlang string
return Spontaneous.DataModel.Dish

TranslateMenuPart() public method

public TranslateMenuPart ( MenuPart menuPart, string fromLang, string targetlang, bool withMenu ) : MenuPart
menuPart Spontaneous.DataModel.MenuPart
fromLang string
targetlang string
withMenu bool
return Spontaneous.DataModel.MenuPart

TranslateMenuPart() public method

public TranslateMenuPart ( MenuPartModel menuPartModel, string fromLang, string targetlang, bool withMenu ) : MenuPart
menuPartModel Spontaneous.WebApp.Models.MenuPartModel
fromLang string
targetlang string
withMenu bool
return Spontaneous.DataModel.MenuPart

TranslateMenuParts() public method

public TranslateMenuParts ( List menuParts, string fromLang, string targetlang, bool withMenu ) : List
menuParts List
fromLang string
targetlang string
withMenu bool
return List

TranslateRestaurant() public method

public TranslateRestaurant ( RestaurantBasicData rest, string fromLang, string targetlang, bool withMenu ) : RestaurantBasicData
rest Spontaneous.DataModel.RestaurantBasicData
fromLang string
targetlang string
withMenu bool
return Spontaneous.DataModel.RestaurantBasicData

TranslateRestaurant() public method

public TranslateRestaurant ( string restId, string fromLang, string targetlang, bool withMenu ) : RestaurantBasicData
restId string
fromLang string
targetlang string
withMenu bool
return Spontaneous.DataModel.RestaurantBasicData

TurnOffMedalFlag() public method

public TurnOffMedalFlag ( ) : bool
return bool

UpdateCarbsInLastMeal() public method

public UpdateCarbsInLastMeal ( string restaurnatId, int menuPartId, int dishId, double totalCarbohydrate ) : bool
restaurnatId string
menuPartId int
dishId int
totalCarbohydrate double
return bool

UpdateCompareResult() public method

If find new restaurants, add them to DB, if already exists compare attributes and update if necessary
public UpdateCompareResult ( RestaurantsCompareList compareList ) : void
compareList Spontaneous.DataModel.RestaurantsCompareList
return void

UpdateCoupon() public method

public UpdateCoupon ( CouponType coupon ) : void
coupon Spontaneous.DataModel.CouponType
return void

UpdateCoupon() public method

public UpdateCoupon ( CouponTypeModel couponModel ) : void
couponModel Spontaneous.WebApp.Models.CouponTypeModel
return void

UpdateDbFromRestaurantOsmData() public method

Should add new restaurant if not exists or add new data to existing restaurant
public UpdateDbFromRestaurantOsmData ( ObjectId osmRestId ) : void
osmRestId ObjectId
return void

UpdateDbFromRestaurantOsmData() public method

Should add new restaurant if not exists or add new data to existing restaurant
public UpdateDbFromRestaurantOsmData ( ObjectId osmRestId, ObjectId similarRestId ) : void
osmRestId ObjectId /// Id of RestaurantOSM ///
similarRestId ObjectId /// Id of existing similar restaurant in main DB ///
return void

UpdateDish() public method

Only for update dish image functions and Localized translateions
public UpdateDish ( Dish dish, string restaurantId, int menuPartId ) : void
dish Spontaneous.DataModel.Dish
restaurantId string
menuPartId int
return void

UpdateDish() public method

public UpdateDish ( DishModel dishModel ) : void
dishModel Spontaneous.WebApp.Models.DishModel
return void

UpdateDishAndCarbs() public method

public UpdateDishAndCarbs ( DishModel Dish ) : void
Dish Spontaneous.WebApp.Models.DishModel
return void

UpdateDishCarbs() public method

Updates dish carbohidrates, writes to user history
public UpdateDishCarbs ( IPrincipal user, string restournatId, int menuPartId, int dishId, double totalCarbohydrate ) : bool
user IPrincipal
restournatId string
menuPartId int
dishId int
totalCarbohydrate double
return bool

UpdateGeneralDish() public method

public UpdateGeneralDish ( GeneralDish generalDish ) : void
generalDish Spontaneous.DataModel.GeneralDish
return void

UpdateIngredient() public method

public UpdateIngredient ( Ingredient ingredient ) : void
ingredient Spontaneous.DataModel.Ingredient
return void

UpdateMenuPart() public method

public UpdateMenuPart ( MenuPartModel MenuPart ) : void
MenuPart Spontaneous.WebApp.Models.MenuPartModel
return void

UpdatePostMealSugar() public method

public UpdatePostMealSugar ( int sugarLevel ) : void
sugarLevel int
return void

UpdatePreMealSugar() public method

public UpdatePreMealSugar ( int sugarLevel, int targetSugar ) : void
sugarLevel int
targetSugar int
return void

UpdateRestaurant() public method

public UpdateRestaurant ( RestaurantBasicData restaurant ) : void
restaurant Spontaneous.DataModel.RestaurantBasicData
return void

UpdateRestaurant() public method

public UpdateRestaurant ( RestaurantModel restaurantmodel ) : void
restaurantmodel Spontaneous.WebApp.Models.RestaurantModel
return void

UserLastMealCompleteRequirement() public method

public UserLastMealCompleteRequirement ( ) : bool
return bool

UserUpdateRestaurant() public method

public UserUpdateRestaurant ( RestaurantModel restaurantmodel ) : void
restaurantmodel Spontaneous.WebApp.Models.RestaurantModel
return void

VerifyUserLastMeal() public method

public VerifyUserLastMeal ( ) : double
return double