/// <summary> /// 增加 /// </summary> /// <param name="model"></param> /// <returns></returns> public async Task <Result <SecondLevel> > addSecondLevelDir(SecondLevel model) { Result <SecondLevel> result = new Result <SecondLevel>(); using (DirDbContext context = new DirDbContext()) { try { var data = context.secondLevels.FirstOrDefault(x => x.title == model.title); if (data != null) { result.addError($"目录名{model.title}已经存在"); } else { result.data = context.secondLevels.Add(model); await context.SaveChangesAsync(); } } catch (Exception err) { result.addError(err.Message); } } return(result); }
/// <summary> /// 修改 /// </summary> /// <param name="model"></param> /// <returns></returns> public async Task <Result <SecondLevel> > updateSecondLevelDir(SecondLevel model) { Result <SecondLevel> result = new Result <SecondLevel>(); try { using (DirDbContext context = new DirDbContext()) { var data = context.secondLevels.Where(x => x.activityFlag == 1 && x.id == model.id).FirstOrDefault(); if (data != null) { data.orderId = model.orderId; data.title = model.title; data.open = model.open; data.url = model.url; data.firstLevelId = model.firstLevelId; data.lastUpdatedBy = model.lastUpdatedBy; data.lastUpdatedDate = model.lastUpdatedDate; } var count = await context.SaveChangesAsync(); } } catch (Exception err) { result.addError(err.Message); } return(result); }
public ActionResult DeleteConfirmed(int id) { SecondLevel secondLevel = db.SecondLevels.Find(id); db.SecondLevels.Remove(secondLevel); db.SaveChanges(); return(RedirectToAction("Index")); }
public void SetNegativePointsPerMissedAppleForLevel_WhenInvoked() { //Arrange int negativePointsPerMissedApple = 55; ILevel secondLevel = new SecondLevel(); //Act & Assert Assert.AreEqual(negativePointsPerMissedApple, secondLevel.NegativePointsPerMissedApple); }
public void SetApplesTargetCountForLevel_WhenInvoked() { //Arrange int applesTargetCount = 5; ILevel secondLevel = new SecondLevel(); //Act & Assert Assert.AreEqual(applesTargetCount, secondLevel.ApplesTarget); }
public void SetInitialSnakeLengthForLevel_WhenInvoked() { //Arrange int snakeSecondLevelLength = 10; ILevel secondLevel = new SecondLevel(); //Act & Assert Assert.AreEqual(snakeSecondLevelLength, secondLevel.InitialSnakeLevelLength); }
public void SetCorrectSlowActionTime_WhenInvoked() { //Arrange int secondLevelSlowActionGameInMilliseconds = 40; ILevel secondLevel = new SecondLevel(); //Act & Assert Assert.AreEqual(secondLevelSlowActionGameInMilliseconds, secondLevel.SlowActionGame); }
public ActionResult Edit([Bind(Include = "Id,Ticket_Id")] SecondLevel secondLevel) { if (ModelState.IsValid) { db.Entry(secondLevel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Ticket_Id = new SelectList(db.Incidents, "Id", "Descrition", secondLevel.Ticket_Id); return(View(secondLevel)); }
// Use this for initialization void Start() { chatInputRect = new Rect(chatInputPosition.x, chatInputPosition.y, chatInputSize.x, chatInputSize.y); chatOutputRect = new Rect(chatOutputPosition.x, chatOutputPosition.y, chatOutputSize.x, chatOutputSize.y); entireChatArea = new Rect(chatInputPosition.x, chatInputPosition.y, Mathf.Max(chatInputSize.x, chatOutputSize.x), chatInputSize.y + chatOutputSize.y); //messageWindow = new MessageWindow(chatOutputSize, chatterSkin); messageWindow = ScriptableObject.CreateInstance <MessageWindow>(); messageWindow.setMessageWindow(chatOutputSize, chatterSkin); manager = GameObject.Find("_Manager").GetComponent <SecondLevel>(); }
public ActionResult Create([Bind(Include = "Id,Ticket_Id")] SecondLevel secondLevel) { if (ModelState.IsValid) { db.SecondLevels.Add(secondLevel); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Ticket_Id = new SelectList(db.Incidents, "Id", "Descrition", secondLevel.Ticket_Id); return(View(secondLevel)); }
// GET: SecondLevels/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SecondLevel secondLevel = db.SecondLevels.Find(id); if (secondLevel == null) { return(HttpNotFound()); } return(View(secondLevel)); }
/// <summary> /// 增加 /// </summary> /// <param name="model"></param> /// <returns></returns> public async Task <Result <SecondLevel> > addSecondLevelDir(SecondLevelDirModel model, string userName) { SecondLevel data = new SecondLevel { createdBy = userName, firstLevelId = model.firstLevelID, open = model.open, title = model.title, url = model.url, orderId = model.orderId }; return(await dao.addSecondLevelDir(data)); }
// GET: SecondLevels/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SecondLevel secondLevel = db.SecondLevels.Find(id); if (secondLevel == null) { return(HttpNotFound()); } ViewBag.Ticket_Id = new SelectList(db.Incidents, "Id", "Descrition", secondLevel.Ticket_Id); return(View(secondLevel)); }
/// <summary> /// 修改 /// </summary> /// <param name="model"></param> /// <returns></returns> public async Task <Result <SecondLevel> > updateSecondLevelDir(SecondLevelDirModel model, string userName) { SecondLevel data = new SecondLevel { id = model.id, lastUpdatedBy = userName, lastUpdatedDate = DateTime.Now, firstLevelId = model.firstLevelID, open = model.open, title = model.title, url = model.url, orderId = model.orderId }; return(await dao.updateSecondLevelDir(data)); }
void startLevel2() { if (_hasStarted == true) { hideMenu(); menuPress.Play(); switchMenu = 0; currentLevel = 2; _level2 = new SecondLevel(); AddChild(_level2); _hud = new HUD(_level2); AddChild(_hud); _level2.Translate(0, 100); _hud.Translate(5, 5); } }
public static void Do() { SecondLevel.Do(); }
public static string GetContent() { return("First Level Content. " + SecondLevel.GetContent()); }
// Use this for initialization void Start() { chatInputRect = new Rect(chatInputPosition.x, chatInputPosition.y, chatInputSize.x, chatInputSize.y); chatOutputRect = new Rect(chatOutputPosition.x, chatOutputPosition.y, chatOutputSize.x, chatOutputSize.y); entireChatArea = new Rect(chatInputPosition.x, chatInputPosition.y, Mathf.Max(chatInputSize.x, chatOutputSize.x), chatInputSize.y + chatOutputSize.y); //messageWindow = new MessageWindow(chatOutputSize, chatterSkin); messageWindow = ScriptableObject.CreateInstance<MessageWindow>(); messageWindow.setMessageWindow(chatOutputSize, chatterSkin); manager = GameObject.Find("_Manager").GetComponent<SecondLevel>(); }