public void OnLoad() { Variables.Hero = ObjectManager.LocalHero; this.pause = Variables.Hero.ClassID != ClassID.CDOTA_Unit_Hero_Invoker; if (this.pause) { return; } Variables.MenuManager = new MenuManager(Me.Name); this.coldSnap = new ColdSnap(); this.alacrity = new Alacrity(); this.chaosMeteor = new ChaosMeteor(); this.deafeningBlast = new DeafeningBlast(); this.forgeSpirit = new ForgeSpirit(); this.ghostWalk = new GhostWalk(); this.iceWall = new IceWall(); this.sunStrike = new SunStrike(); this.tornado = new Tornado(); this.emp = new EMP(); Variables.Quas = Me.Spellbook.SpellQ; Variables.Wex = Me.Spellbook.SpellW; Variables.Exort = Me.Spellbook.SpellE; Variables.Invoke = Me.Spellbook.SpellR; Variables.MenuManager.Menu.AddToMainMenu(); Variables.EnemyTeam = Me.GetEnemyTeam(); this.targetFind = new TargetFind(); Game.PrintMessage( "Invoker" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version + " loaded", MessageType.LogMessage); }
public void Application_PostAuthenticateRequest (object sender, EventArgs e) { HttpCookie cookie = Request.Cookies["cookieempleado"]; if (cookie != null) { String datoscookie = cookie.Value; FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(datoscookie); String idempleado = ticket.Name; String oficio = ticket.UserData; ModeloEmpleados modelo = new ModeloEmpleados(); EMP emp = modelo.BuscarEmpleado(int.Parse(idempleado)); //IDENTIDAD GenericIdentity identidad = new GenericIdentity(emp.APELLIDO); //ROLES U OFICIOS DEL EMPLEADO List <String> oficios = new List <string>() { oficio }; EmpleadoPrincipal empleado = new EmpleadoPrincipal(identidad, oficios); empleado.Apellido = emp.APELLIDO; empleado.Oficio = emp.OFICIO; empleado.FechaAlta = emp.FECHA_ALT.GetValueOrDefault(); empleado.NumeroEmpleado = emp.EMP_NO; //ALMACENAMOS EL USUARIO PRINCIPAL EN LA SESION HttpContext.Current.User = empleado; } }
public Result <EMP> Save(EMP emp) { var result = new Result <EMP>(); try { var objToSave = context.EMPs.FirstOrDefault(e => e.id == emp.id); //insert if (objToSave == null) { objToSave = new EMP(); context.EMPs.Add(objToSave); } objToSave.fname = emp.fname; objToSave.lname = emp.lname; objToSave.dob = emp.dob; context.SaveChanges(); } catch (Exception exception) { result.HasError = true; result.Message = exception.Message; } return(result); }
private void addClick(object sender, RoutedEventArgs e) { int maxID = 0; db.EMPs.ToList().ForEach(p => { if (p.EMPNO > maxID) { maxID = p.EMPNO; } }); int newID = maxID + 1; var newEmp = new EMP { EMPNO = newID, ENAME = FirstNameTextBox.Text, JOB = JobTextBox.Text, DEPTNO = 10, SAL = 1000 }; AddEmp(newEmp); }
public List <EMP> GEtdb() { List <EMP> DBase = new List <EMP>(); MySqlConnection con = new MySqlConnection(oradb); string query = "Select * from test"; MySqlCommand cmd = new MySqlCommand(query); //cmd.CommandText = "Select * from test"; cmd.Connection = con; con.Open(); MySqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { EMP emp = new EMP(); emp.Name = Convert.ToString(reader["Name"]); DBase.Add(emp); } return(DBase); }
private void SaveChangesButton_Click(object sender, RoutedEventArgs e) { try { string Name = NameTextBox.Text; string Job = JobTextBox.Text; EMP tmpEmp = EmployerDataGrid.SelectedItem as EMP; ListOfEmp.Remove(tmpEmp); tmpEmp = _service.UpdateEmployee(tmpEmp.EMPNO, NameTextBox.Text, JobTextBox.Text); if (tmpEmp != null) { ListOfEmp.Add(_service.UpdateEmployee(tmpEmp.EMPNO, NameTextBox.Text, JobTextBox.Text)); EmployerDataGrid.ItemsSource = ListOfEmp; } NameTextBox.Text = ""; JobTextBox.Text = ""; } catch (Exception) { MessageBox.Show("Wprowadzone dane niepoprawne"); NameTextBox.Text = ""; JobTextBox.Text = ""; } }
public ActionResult Detalles(int?empno) { EMP empleado = modelo.BuscarEmpleado(empno.GetValueOrDefault()); ViewBag.Mensaje = "controler detalles"; return(View("_VistaDetalles", empleado)); }
// GET: Details public ActionResult Index(int id) { EMPModelView empl = new EMPModelView(); EMP employee = empl.EmployeeDetails(id); return(View(employee)); }
private void Button_Dodaj(object sender, RoutedEventArgs e) { ListaPrecownikuw = new ObservableCollection <EMP>(_service.GetPracowniki()); DataGridPracownik.ItemsSource = ListaPrecownikuw; if (TextBoxEmp.Text.Length < 100 && TextBoxJob.Text.Length < 100 && !string.IsNullOrEmpty(TextBoxEmp.Text) && !string.IsNullOrEmpty(TextBoxJob.Text) && ComboBoxDname.Text != "Select dzial") { var newEmp = new EMP { EMPNO = _service.GetLastEmpno(), ENAME = TextBoxEmp.Text, JOB = TextBoxJob.Text, DEPTNO = _service.GetDname(ComboBoxDname.Text) }; _service.AddPracownik(newEmp); ListaPrecownikuw.Add(newEmp); TextBoxEmp.Clear(); TextBoxJob.Clear(); ComboBoxDname.Text = "Select dzial"; } else { TextBoxEmp.Clear(); TextBoxJob.Clear(); string error = "Nieprawidlowe dane"; string ception = "Warning"; MessageBoxButton warning = MessageBoxButton.OKCancel; MessageBoxImage image = MessageBoxImage.Warning; MessageBox.Show(error, ception, warning, image); } }
public string createEmployee(string employeeName) { string result = ""; if (employeeName != "") { EMP newEmployee = new EMP(employeeName); graphClient.Cypher .Merge("(emp:EMP {name: {name}})") .OnCreate() .Set("emp = {newEmployee}") .WithParams(new { name = newEmployee.getName(), newEmployee }) .ExecuteWithoutResults(); result = "The employee has been created."; return(result); } else { result = "The employee need a name."; return(result); } }
public ActionResult Add(EMP emp1) { objemp.EMPs.Add(emp1); objemp.SaveChanges(); return(RedirectToAction("Index", "Home")); }
private void EmployerDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { EMP tmpEmp = EmployerDataGrid.SelectedItem as EMP; NameTextBox.Text = tmpEmp.ENAME; JobTextBox.Text = tmpEmp.JOB; }
public ActionResult Index(EMP emp) { if (ModelState.IsValid) { EMPModelView empl = new EMPModelView(); empl.AddNewEmployee(emp); //////////////////Dept Number Drop Down////////////////// var list = new List <DeptDropDown>(); OracleConnection con = new OracleConnection(oradb); OracleCommand cmd = new OracleCommand(); cmd.CommandText = "Select d.deptno,d.dname From dept d"; cmd.Connection = con; con.Open(); OracleDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { list.Add(new DeptDropDown { Deptid = reader.GetInt16(0), Dname = reader.GetString(1) }); } var model = new DeptModellist(); ViewBag.drop = new SelectList(list, "deptid", "dname"); //////////////////Dept Number Drop Down////////////////// return(RedirectToAction("index", "Home")); } return(View()); }
private void AddButton_Click(object sender, RoutedEventArgs e) { var tmpName = NameTextBox.Text; var tmpJob = JobTextBox.Text; if (!string.IsNullOrEmpty(tmpName) && !string.IsNullOrEmpty(tmpJob) && DepartmentComboBox.SelectedItem != null) { if (tmpName.Length <= 10 && tmpJob.Length <= 9) { var tmpDept = ((DEPT)DepartmentComboBox.SelectedItem); var newEmp = new EMP { EMPNO = _service.GetHighestId() + 1, ENAME = tmpName, JOB = tmpJob, DEPT = tmpDept }; _service.AddEmp(newEmp); EmpsDataGrid.ItemsSource = _service.GetEmps(); ClearFields(); } else { MessageBox.Show("Wpisano za dużo znaków", "EmpsWindow", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } else { MessageBox.Show("Co najmniej jedno pole jest puste", "EmpsWindow", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
public ActionResult Edit(EMP emp1) { if (ModelState.IsValid == true) { var row = objemp.EMPs.Where(model => model.RID == emp1.RID).FirstOrDefault(); row.FIRSTNAME = emp1.FIRSTNAME; row.LASTNAME = emp1.LASTNAME; row.EMPCODE = emp1.EMPCODE; row.POSITION = emp1.POSITION; row.OFFICE = emp1.OFFICE; //objemp.Entry(objemp).State = System.Data.Entity.EntityState.Modified; int a = objemp.SaveChanges(); if (a > 0) { TempData["updatemsg"] = "<script>alert('Update Record Completed') </script>"; return(RedirectToAction("Index", "Home")); } else { TempData["updatemsg"] = "<script>alert('Update Record Failed.') </script>"; } } return(View()); }
private void AddEmployeeButton_Click(object sender, RoutedEventArgs e) { var Ename = EnameTextBox.Text; var Job = JobTextBox.Text; var Dept = DnameComboBox.SelectedValue; if (Ename == null || Job == null || Ename == "" || Job == "" || Dept == null) { MessageBox.Show("Nie wszystkie pola zostały wypełnione!"); return; } var NewEmp = new EMP { ENAME = Ename, JOB = Job, DEPT = (DEPT)Dept }; var isNewEmpAdded = EfServiceDb.addEmp(NewEmp); if (isNewEmpAdded) { EmployeeList.Add(NewEmp); } else { MessageBox.Show("Nie udało się dodać nowego studenta."); } }
public ToEMPMetBlastRefMetBlastEMP(Hero me, Key key) : base(me, key) { this._tornado = new Tornado(me, () => 0); this._emp1 = new EMP(me, this.EMPDelay1); this._meteor1 = new Meteor(me, this.MeteorDelay1); this._deafeningBlast1 = new DeafeningBlast(me, this.BlastDelay1); this._refresher = new Refresher(me); this._meteor2 = new Meteor(me); this._deafeningBlast2 = new DeafeningBlast(me); this._emp2 = new EMP(me); this._sunstrike = new Sunstrike(me); this._coldSnap = new ColdSnap(me); // _sunstrike2.PositionChange = ... this.AbilitySequence = new List <ISequenceEntry> { new AwaitBlinkOrMove(me, () => this.EngageRange), this._tornado, new AwaitModifier("modifier_invoker_tornado", 3000), new AwaitBlinkOrMove(me, () => (int)this._meteor1.Ability.CastRange), this._emp1, this._meteor1, this._deafeningBlast1, this._refresher, this._meteor2, this._deafeningBlast2, this._emp2, this._coldSnap // sunstrike? }; }
private async void btnLogin_Click(object sender, EventArgs e) { String Username, Password; bool LoginRes; Username = txtUserName.Text.ToString(); Password = txtPassWord.Text.ToString(); try { LoginRes = await ControlerMethods.LoginAsync(Username, Password); if (LoginRes) { EMP emp = await ControlerMethods.GetEmpAsync(Username); FrmEmpMain frmEmpMain = new FrmEmpMain(emp); frmEmpMain.Show(); exitApp = false; this.Close(); } else { MessageBox .Show("خواهشمند است اطلاعات را با دقت وارد نمایید ", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); txtPassWord.Text = ""; txtPassWord.Text = ""; } } catch { MessageBox .Show("لطفا دوباره امتحان کنید ", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public ActionResult DeleteConfirmed(int id) { EMP eMP = db.EMPs.Find(id); db.EMPs.Remove(eMP); db.SaveChanges(); return(RedirectToAction("Index")); }
public void EMPMe(float[] stats, bool foil) //(float aff, float where) { if (emp == null) { emp = gameObject.AddComponent <EMP>() as EMP; } // Debug.Log("Hitme initializing EMP\n"); emp.Init(stats, enemy_tech, foil); }
public ActionResult Delete(string id) { int n = Convert.ToInt32(id); EMP emp = _dbContext.EMPs.Find(n); _dbContext.EMPs.Remove(emp); _dbContext.SaveChanges(); return(RedirectToAction("Index")); }
public override void InitScreen(ScreenType screenType) { Texture2D image = GameContent.GameAssets.Images.NonPlayingObjects.Planet; Texture2D EMP = GameContent.GameAssets.Images.SecondaryWeapon[SecondaryWeaponType.EMP, TextureDisplayType.ShopDisplay]; Texture2D RayGun = GameContent.GameAssets.Images.SecondaryWeapon[SecondaryWeaponType.ShrinkRay, TextureDisplayType.ShopDisplay]; Texture2D Bomb = GameContent.GameAssets.Images.SecondaryWeapon[SecondaryWeaponType.SpaceMine, TextureDisplayType.ShopDisplay]; SpaceBucksAmount = new TextSprite(Sprites.SpriteBatch, Vector2.Zero, GameContent.GameAssets.Fonts.NormalText, string.Format("You have {0} credits", StateManager.SpaceBucks), Color.White); SpaceBucksAmount.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width / 2 - SpaceBucksAmount.Width, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * .1f); AdditionalSprites.Add(SpaceBucksAmount); SpriteFont font = GameContent.GameAssets.Fonts.NormalText; //EMP EMP weapon1 = new EMP(EMP, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.6f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.1f), Sprites.SpriteBatch); TextSprite text1 = new TextSprite(Sprites.SpriteBatch, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.01f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.1f), font, "\n\nAn electro magnetic pulse. \nThis device disables all \nnearby enemy ships \nwithin your ship's range. \n\ncost: 1000 credits", Color.White); weapon1.Scale = new Vector2(0.5f, 0.5f); itemsShown.Add(weapon1); //Ray Gun ShrinkRay weapon2 = new ShrinkRay(RayGun, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.60f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.2f), Sprites.SpriteBatch); weapon2.Scale = new Vector2(0.5f, 0.5f); itemsShown.Add(weapon2); //Space Mine SpaceMine weapon3 = new SpaceMine(Bomb, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.69f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.3f), Sprites.SpriteBatch); weapon3.Scale = new Vector2(2f, 2f); itemsShown.Add(weapon3); TextSprite text2 = new TextSprite(Sprites.SpriteBatch, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.01f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.1f), font, "\n\nThis weapon causes the targeted enemy\n to shrink losing 33% of their health. \nThis does not affect bosses.\n\ncost: 2000 credits", Color.White); TextSprite text3 = new TextSprite(Sprites.SpriteBatch, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.01f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.1f), font, "\n\nYou place this mine anywhere in space \nand when an enemy crashes into it the mine \nexplodes \n\ncost: 500 credits.", Color.White); items.Add(new KeyValuePair <Sprite, TextSprite>(weapon2, text2)); items.Add(new KeyValuePair <Sprite, TextSprite>(weapon3, text3)); ChangeItem += new EventHandler(WeaponSelectScreen_ChangeItem); items.Add(new KeyValuePair <Sprite, TextSprite>(weapon1, text1)); base.InitScreen(screenType); acceptLabel.Text = "Buy"; //In clicked code this.nextButtonClicked += new EventHandler(WeaponSelectScreen_nextButtonClicked); }
public List <EMP> GEtdb() { List <EMP> DBase = new List <EMP>(); OracleConnection con = new OracleConnection(oradb); OracleCommand cmd = new OracleCommand(); cmd.CommandText = "Select * from emp"; cmd.Connection = con; con.Open(); OracleDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { EMP emp = new EMP(); emp.EMPNO = Convert.ToInt16(reader["EMPNO"]); emp.ENAME = reader["ENAME"].ToString(); emp.JOB = reader["JOB"].ToString(); if (reader["MGR"] != DBNull.Value) { emp.MGR = Convert.ToInt16(reader["MGR"]); } if (reader["HIREDATE"] != DBNull.Value) { emp.HIREDATE = Convert.ToDateTime(reader["HIREDATE"]); } if (reader["SAL"] != DBNull.Value) { emp.SAL = Convert.ToInt16(reader["SAL"]); } if (reader["COMM"] != DBNull.Value) { emp.COMM = Convert.ToInt16(reader["COMM"]); } if (reader["DEPTNO"] != DBNull.Value) { emp.DEPTNO = Convert.ToInt16(reader["DEPTNO"]); } DBase.Add(emp); } return(DBase); }
static void Main(string[] args) { Programmer p = new Programmer(); EMP e = p as EMP; if (e != null) { System.Console.WriteLine(e.ToString()); } }
private async void button1_Click_1(object sender, EventArgs e) { EMP eMP = new EMP(); eMP.Company = "46005"; eMP.FirstName = "Ali"; eMP.LastName = "Mobini"; eMP.HireDate = DateTime.Now; eMP.Title = "admin"; label1.Text = await ControlerMethods.SetEmp(eMP); }
public ActionResult Index(EMP emp) { if (ModelState.IsValid) { EMPModelView empl = new EMPModelView(); empl.updateemp(emp); return(RedirectToAction("index", "Home")); } return(View()); }
public ActionResult Edit([Bind(Include = "EmpID,Ename,JOB,Salary,DeptID")] EMP eMP) { if (ModelState.IsValid) { db.Entry(eMP).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DeptID = new SelectList(db.DEPTs, "DeptID", "Dname", eMP.DeptID); return(View(eMP)); }
// GET: Emp public ActionResult Delete(EMP emp2) { using (MyDatabaseEntities deleteDb = new MyDatabaseEntities()) { var del1 = deleteDb.EMPs.Where(s => s.Id == emp2.Id).FirstOrDefault(); //Removing record by Id deleteDb.EMPs.Remove(del1); //Saving the record deleteDb.SaveChanges(); return(RedirectToAction("Index1", "Emp")); } }
public string ActualizaEmpleado(int id_tip, string nom, string ape, string tel, string dir, string usu, string con, DateTime fech, bool est, int id) { if (nom != "") { EMP.sp_Actualiza_Empleado(id_tip, id, nom, ape, tel, dir, fech, est, usu, con); return("Sea ha actualizado Los datos del empleado"); } else { return("Error, no ha sido posible la actualizacion"); } }
// POST: odata/EMP public IHttpActionResult Post(EMP EMP) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.EMP.Add(EMP); db.SaveChanges(); return(Created(EMP)); }
public ActionResult ResetPassword(EMP.Models.Account.ResetPasswordModel model) { try { if(ModelState.IsValid) { BLLAccess _bllAccess = new BLLAccess(); _bllAccess.idno = model.IDNO; if(_bllAccess.ResetAccessPass(model.Password, User.IDNO)) { TempData["resetPassword_result"] = "Password was successfully reset."; } else { TempData["resetPassword_result"] = "An error has occurred."; } } return View(); } catch (Exception e) { ModelState.AddModelError("", e.Message); return View(); } }
//bool bought = false; public override void InitScreen(ScreenType screenType) { Shop.PurchaseScreenSelected += new EventHandler(Shop_PurchaseScreenSelected); Texture2D image = GameContent.Assets.Images.NonPlayingObjects.Planet; Texture2D EMP = GameContent.Assets.Images.SecondaryWeapon[SecondaryWeaponType.EMP, TextureDisplayType.ShopDisplay]; Texture2D RayGun = GameContent.Assets.Images.SecondaryWeapon[SecondaryWeaponType.ShrinkRay, TextureDisplayType.ShopDisplay]; Texture2D Bomb = GameContent.Assets.Images.SecondaryWeapon[SecondaryWeaponType.SpaceMine, TextureDisplayType.ShopDisplay]; Texture2D HealthPack = GameContent.Assets.Images.Equipment[EquipmentType.HealthPack, TextureDisplayType.ShopDisplay]; SpaceBucksAmount = new TextSprite(Sprites.SpriteBatch, Vector2.Zero, GameContent.Assets.Fonts.NormalText, string.Format("You have {0} credits", StateManager.SpaceBucks), Color.White); //SpaceBucksAmount.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width / 2 - SpaceBucksAmount.Width, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * .1f); ItemAmount = new TextSprite(Sprites.SpriteBatch, Vector2.Zero, GameContent.Assets.Fonts.NormalText, string.Format("You have x{0} EMPs", StateManager.PowerUps[2].Count), Color.White); ItemAmount.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width / 2 - SpaceBucksAmount.Width, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * .15f); AdditionalSprites.Add(SpaceBucksAmount); AdditionalSprites.Add(ItemAmount); SpriteFont font = GameContent.Assets.Fonts.NormalText; //EMP EMP weapon1 = new EMP(EMP, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.75f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.3f), Sprites.SpriteBatch); TextSprite text1 = new TextSprite(Sprites.SpriteBatch, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.01f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.1f), font, "\n\nAn electro magnetic pulse. \nThis device disables all \nnearby enemy ships \nwithin your ship's range. \n\ncost: 1000 credits", Color.White); weapon1.Scale = new Vector2(0.5f, 0.5f); itemsShown.Add(weapon1); //Ray Gun ShrinkRay weapon2 = new ShrinkRay(RayGun, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.64f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.2f), Sprites.SpriteBatch); weapon2.Scale = new Vector2(0.5f, 0.5f); itemsShown.Add(weapon2); //Space Mine SpaceMine weapon3 = new SpaceMine(Bomb, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.69f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.3f), Sprites.SpriteBatch); weapon3.Scale = new Vector2(2f, 2f); itemsShown.Add(weapon3); TextSprite text2 = new TextSprite(Sprites.SpriteBatch, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.01f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.1f), font, "\n\nThis weapon causes the targeted enemy\nto shrink losing 33% of their health. \nThis does not affect bosses.\n\ncost: 2000 credits", Color.White); TextSprite text3 = new TextSprite(Sprites.SpriteBatch, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.01f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.1f), font, "\n\nYou place this mine anywhere in space \nand when an enemy crashes into it the mine \nexplodes \n\ncost: 500 credits.", Color.White); items.Add(new KeyValuePair<Sprite, TextSprite>(weapon2, text2)); items.Add(new KeyValuePair<Sprite, TextSprite>(weapon3, text3)); //HealthPack HealthPack weapon4 = new HealthPack(HealthPack, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.74f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.3f), Sprites.SpriteBatch); TextSprite text4 = new TextSprite(Sprites.SpriteBatch, new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.1f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 1.5f), font, "\n\n\nThis power up regenerates\nyour health up\nby 50%\n\nCost: " + weapon4.Cost, Color.White); text4.Position = new Vector2(Sprites.SpriteBatch.GraphicsDevice.Viewport.Width * 0.01f, Sprites.SpriteBatch.GraphicsDevice.Viewport.Height * 0.05f); weapon4.Scale = new Vector2(0.5f, 0.5f); items.Add(new KeyValuePair<Sprite, TextSprite>(weapon4, text4)); itemsShown.Add(weapon4); ChangeItem += new EventHandler(WeaponSelectScreen_ChangeItem); items.Add(new KeyValuePair<Sprite, TextSprite>(weapon1, text1)); base.InitScreen(screenType); acceptLabel.Text = "Buy"; //In clicked code this.nextButtonClicked += new EventHandler(WeaponSelectScreen_nextButtonClicked); }
public ActionResult ChangePassword(EMP.Models.Account.ChangePasswordModel model) { try { BLLAccess _bllAccess = new BLLAccess(); _bllAccess.idno = User.IDNO; int _status = _bllAccess.UpdateAccessPass(model.OldPassword, User.PasswordHash, User.PasswordSalt, model.NewPassword, User.IDNO); if (_status == 1) { return RedirectToAction("Logout", "Account"); } if (_status == 0) { ModelState.AddModelError("", "Old password is incorrect. Please try again."); } return View(); } catch (Exception e) { ModelState.AddModelError("", e.Message); return View(); } }