//public JsonResult UpdateUserProfile(UserModel model) //{ // ViewBag.SelectedTab = SelectedAdminTab.Users; // return Json(_userManager.UpdateUserProfile(model)); //} public ActionResult _AddDishPartial() { AddDishForMotherModel AddDishModel = new AddDishForMotherModel(); AddDishModel.DishList = _SelectListManager.GetDishList(); return(PartialView("Partials/_AddDishPartial", AddDishModel)); }
ActionOutput IUserManager.AddDishForMother(AddDishForMotherModel model) { var GetMotherID = Context.MotherTbls.Where(a => a.UserId == model.MotherID).FirstOrDefault().Id; var ExistingDish = Context.MotherDishes.Where(a => a.MotherId == GetMotherID && a.DishId == model.DishId && a.IsDeleted == false ).FirstOrDefault(); if (ExistingDish != null) { return(new ActionOutput { Status = ActionStatus.Error, Message = "Dish Already Exists." }); } string FileName = ""; if (model.DishImage != null) { FileName = UtilitiesHelp.SavePostedFile(AppFolderName.DishImage, model.DishImage); } var MotherDish = new MotherDish { MotherId = GetMotherID, DishId = model.DishId, Image = FileName, Limit = 100, Price = 200, CreatedOn = DateTime.Now, IsDeleted = false, IsMainDish = false, IsSignatureDish = false }; Context.MotherDishes.Add(MotherDish); Context.SaveChanges(); // return new ActionOutput // { // Status = ActionStatus.Error, // Message = "This Part already exists." // }; return(new ActionOutput { Status = ActionStatus.Successfull, Message = "Dish Added Successfully." }); }
public JsonResult AddDishForMother(AddDishForMotherModel model) { ViewBag.SelectedTab = SelectedAdminTab.Users; return(JsonResult(_userManager.AddDishForMother(model))); }