ToString() public method

public ToString ( ) : string
return string
Ejemplo n.º 1
0
 public ActionResult AddRestaurant(RestaurantModel rest)
 {
     log.InfoFormat("[AddRestaurant] rest={0}", rest.ToString());
     var id = m_serviceLayer.AddRestaurantToDB(rest);
     return Content(id, "text/plain");
 }
Ejemplo n.º 2
0
 public ActionResult UpdateRestaurantInfo(RestaurantModel rest)
 {
     log.InfoFormat("[UpdateRestaurantInfo] rest={0}", rest.ToString());
     m_serviceLayer.UserUpdateRestaurant(rest);
     return Content("success", "text/plain");
 }
Ejemplo n.º 3
0
        public void UserUpdateRestaurant(RestaurantModel restaurantmodel)
        {
            log.DebugFormat("[UserEditRestaurant(RestaurantModel)] RestaurantModel={0}.", restaurantmodel.ToString());
            RestaurantModel tempRest = GetRestaurantById(restaurantmodel.Id);
            tempRest.Name = restaurantmodel.Name;
            tempRest.Description = restaurantmodel.Description;
            tempRest.Adress.City = restaurantmodel.Adress.City;
            tempRest.Adress.Street = restaurantmodel.Adress.Street;
            tempRest.Adress.BuildingNum = restaurantmodel.Adress.BuildingNum;
            tempRest.Adress.Description = restaurantmodel.Adress.Description;
            tempRest.Phone = restaurantmodel.Phone;

            RestaurantBasicData rest = tempRest.ToRestaurantBasicModel();
            rest.Menu = GetRestaurantBasicById(restaurantmodel.Id).Menu;
            UpdateRestaurant(rest);
            //UpdateRestaurant(tempRest);

            //SaveUserActivity(new UserActivity()
            //{
            //    Type = "UpdateRestaurant",
            //    RestaurantID = restaurantmodel.Id,
            //    Location = tempRest.Location.toLoaction()
            //});
        }
Ejemplo n.º 4
0
 public void UpdateRestaurant(RestaurantModel restaurantmodel)
 {
     log.DebugFormat("[UpdateRestaurant(RestaurantModel)] RestaurantModel={0}.", restaurantmodel.ToString());
     restaurantmodel.UpdatedAt = DateTime.UtcNow;
     RestaurantBasicData restData = restaurantmodel.ToRestaurantBasicModel();
     RestaurantBasicData previousRest = GetRestaurantBasicById(restaurantmodel.Id);
     if (previousRest.Image != null && (previousRest.LogoUrl == restData.LogoUrl || previousRest.LogoUrl == null || previousRest.LogoUrl == "" || restData.LogoUrl == null))
     {
         restData.Image = previousRest.Image;
     }
     UpdateRestaurant(restData);
 }
Ejemplo n.º 5
0
 public string AddRestaurantToDB(RestaurantModel restaurantmodel)
 {
     log.DebugFormat("[AddRestaurantToDB] restaurantmodel={0}.", restaurantmodel.ToString());
     using (Restaurants restaurantsDb = new Restaurants())
     {
         MongoEntityRepositoryBase<RestaurantBasicData> basicData =
                       new MongoEntityRepositoryBase<RestaurantBasicData>(restaurantsDb.DB);
         RestaurantBasicData tempRest = new RestaurantBasicData()
         {
             //Id = ObjectId.Parse(restaurantmodel.Id),
             Name = restaurantmodel.Name,
             Description = restaurantmodel.Description,
             LogoUrl = (restaurantmodel.LogoUrl != null) ? restaurantmodel.LogoUrl : "",
             Menu = restaurantmodel.Menu.ToMenuBasicModel(),
             Adress = restaurantmodel.Adress,
             ItemLocation = (restaurantmodel.Location != null) ? restaurantmodel.Location.toLoaction() : null,
             Phone = restaurantmodel.Phone,
             CreatedAt = DateTime.UtcNow,
             UpdatedAt = DateTime.UtcNow
         };
         basicData.Add(tempRest);
         if (tempRest.LogoUrl != "" && tempRest.Image == null)
         {
             ImageServices m_imageService = new ImageServices();
             m_imageService.UploadImageToRestaurant(tempRest, tempRest.LogoUrl);
         }
         if (m_userProfile.AppName != ApplicationName.BackOffice)
         {
             SaveUserActivity(new AddRestaurantActivity()
             {
                 RestaurantID = tempRest.Id.ToString(),
                 LocationAdd = tempRest.ItemLocation,
                 ActivityLocation = tempRest.ItemLocation
             });
         }
         return tempRest.Id.ToString();
     }
 }
Ejemplo n.º 6
0
        public string AddRestaurantToDB(RestaurantModel restaurantmodel)
        {
            log.DebugFormat("[AddRestaurantToDB] restaurantmodel={0}.", restaurantmodel.ToString());
            using (Restaurants restaurantsDb = new Restaurants())
            {
                MongoEntityRepositoryBase<RestaurantBasicData> basicData =
                              new MongoEntityRepositoryBase<RestaurantBasicData>(restaurantsDb.DB);
                RestaurantBasicData tempRest = new RestaurantBasicData()
                {
                    //Id = ObjectId.Parse(restaurantmodel.Id),
                    Name = restaurantmodel.Name,
                    Description = restaurantmodel.Description,
                    LogoUrl = (restaurantmodel.LogoUrl != null) ? restaurantmodel.LogoUrl : "",
                    Menu = restaurantmodel.Menu.ToMenuBasicModel(),
                    Adress = restaurantmodel.Adress,
                    ItemLocation = (restaurantmodel.Location != null) ? restaurantmodel.Location.toLoaction() : null,
                    Phone = restaurantmodel.Phone,
                    CreatedAt = DateTime.UtcNow,
                    UpdatedAt = DateTime.UtcNow
                };
                basicData.Add(tempRest);

                SaveUserActivity(new AddRestaurantActivity()
                {
                    RestaurantID = tempRest.Id.ToString(),
                    Location = tempRest.ItemLocation
                });
                return tempRest.Id.ToString();
            }
        }