public DbResponse AssignCatalogMultiple(BrandAssignMultipleModel model, string userName) { try { var registrationId = _db.Registration.GetRegID_ByUserName(userName); if (registrationId == 0) { return(new DbResponse(false, "Invalid User")); } model.AssignedByRegistrationId = registrationId; _db.Brand.AssignCatalogMultiple(model); _db.SaveChanges(); return(new DbResponse(true, "Success")); } catch (Exception e) { return(new DbResponse(false, e.Message)); } }
public IActionResult Assign(BrandAssignMultipleModel model) { var response = _brand.AssignCatalogMultiple(model, User.Identity.Name); return(Json(response)); }