public void Init() { MANAGER.AddEnemyToList(this); AttackRange = attackRange; Speed = speed; IdleRange = idleRange; AttackCD = attackCD; AttackDuration = attackDuration; PassiveRange = passiveRange; BaseHealth = health; Level = level; Team = 1; BaseDamage = baseDamage; DamagePerLevel = damagePerLevel; BaseArmor = baseArmor; ArmorPerLevel = armorPerLevel; HealthPerLevel = healthPerLevel; UpdateStats(); GameObject DamageHit = new GameObject("HitPoints"); DamageHit.transform.SetParent(GameObject.Find("Canvas").transform); HealthTextEnnemy Script = DamageHit.AddComponent <HealthTextEnnemy>(); Script.Init(transform); GetComponent <NavMeshAgent>().speed = GetSpeed; }
///////////////////// #region pageload protected void Page_Load(object sender, EventArgs e) { ///////////////////// #region userId_Verify if (Session["User"] == null) { userId = 0; } else { userId = (int)(Session["User"]); } #endregion ///////////////////// string treceita = Convert.ToString(Session["tipodereceita"]); string textsearh = Convert.ToString(Session["textsearch"]); MANAGER m = new MANAGER(); DataSet ds = m.GetDataSBAR(treceita, textsearh); GridView1.DataSource = ds; GridView1.DataBind(); Repeater1.DataSource = ds; Repeater1.DataBind(); }
///////////////////// #region pesquisar_receitas protected void btnhomesearch_Click(object sender, EventArgs e) { Session["tipodereceita"] = dropdownhome.SelectedItem.Text; Session["textsearch"] = searchhome.Text; if (Session["User"] == null) { Response.Redirect("Receitaporpesquisa.aspx"); } else { if ((string)Session["tipodereceita"] == "Nome") { int userS = (int)Session["User"]; string userST = searchhome.Text; string userSTT = dropdownhome.SelectedItem.Text; MANAGER m = new MANAGER(); m.InserirLastSearch(userS, userST, userSTT); Response.Redirect("Receitaporpesquisa.aspx"); } else { Response.Redirect("Receitaporpesquisa.aspx"); } } }
/// <summary> /// Возвратить наименование элемента списка (специальная вкладка) /// </summary> /// <param name="modeManager">Тип вкладки</param> /// <param name="modeComponent">Режим компонентов ТЭЦ</param> /// <returns>Строка - подпись для элемента списка</returns> public string getNameAdminValues(MANAGER modeManager, MODE_TECCOMPONENT modeComponent) { string[] arNameAdminValues = { "НСС" /*TEC*/, "Диспетчер" /*GTP*/, "НСС" /*PC*/, "НСС" /*TG*/ }; string prefix = ((modeManager == MANAGER.DISP) || (modeManager == MANAGER.NSS)) ? @"ПБР" : (modeManager == MANAGER.ALARM) ? @"Сигн." : @"Неизвестно"; return(prefix + @" - " + arNameAdminValues[(int)modeComponent]); }
/// <summary> /// Возвратить наименование элемента списка (специальная вкладка) /// </summary> /// <param name="modeManager">Тип вкладки</param> /// <param name="modeComponent">Режим компонентов ТЭЦ</param> /// <returns>Строка - подпись для элемента списка</returns> public string getNameAdminValues(MANAGER modeManager, MODE_TECCOMPONENT modeComponent) { string[] arNameAdminValues = { "НСС" /*TEC*/, "Диспетчер" /*GTP*/, "НСС" /*PC*/, "НСС" /*TG*/ }; string prefix = new List <MANAGER>() { MANAGER.NSS, MANAGER.DISP, MANAGER.LK, MANAGER.TEPLOSET }.Contains(modeManager) == true ? HAdmin.PBR_PREFIX : (modeManager == MANAGER.ALARM) ? @"Сигн." : @"Неизвестно"; switch (modeManager) { case MANAGER.LK: prefix += @" - ЛК"; break; case MANAGER.TEPLOSET: prefix += @" - Теплосеть"; break; default: prefix += @" - " + arNameAdminValues[(int)modeComponent]; break; } return(prefix); }
public virtual void PassiveAction() { float distance = Vector3.Distance(MANAGER.GetPlayerPos, transform.position); if (distance >= IdleRange) { AIState = IDLE; return; } if (distance < PassiveRange && MANAGER.CanGetAgressive(5)) { AIState = AGRESSIVE; return; } else if (distance < PassiveRange) { PositionGoal = (transform.position - MANAGER.GetPlayerPos).normalized * PassiveRange; NavMeshAgent agent = GetComponent <NavMeshAgent>(); agent.SetDestination(PositionGoal); //GetAwwaysFromPlayer } else if (GetComponent <NavMeshAgent>().isStopped) { PositionGoal = (Random.insideUnitSphere + MANAGER.GetPlayerPos).normalized * PassiveRange; PositionGoal.y = 0; NavMeshAgent agent = GetComponent <NavMeshAgent>(); agent.SetDestination(PositionGoal); //Move ARROUND HIM } }
public ActionResult DeleteConfirmed(int id) { MANAGER mANAGER = db.MANAGERs.Find(id); db.MANAGERs.Remove(mANAGER); db.SaveChanges(); return(RedirectToAction("Index")); }
public void iInitialize() { EventSystem = MANAGER.CheckScriptAvailability <EventSystem>("EventSystem", DefaultEventSystemPrefab); MinimapCamera = MANAGER.CheckScriptAvailability <Camera>("MinimapCamera", DefaultMinimapCameraPrefab); Minimap = MANAGER.CheckScriptAvailability <Minimap>("MinimapCanvas", DefaultMinimapPrefab); }
public override void CheckDeath(Entity Attacker) { if (Health <= 0) { Attacker.OnKill(this); MANAGER.RemoveEnemyToList(this); Destroy(gameObject); } }
public ActionResult Edit([Bind(Include = "id,username,password,role")] MANAGER mANAGER) { if (ModelState.IsValid) { db.Entry(mANAGER).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mANAGER)); }
public ActionResult Create([Bind(Include = "id,username,password,role")] MANAGER mANAGER) { if (ModelState.IsValid) { db.MANAGERs.Add(mANAGER); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(mANAGER)); }
private void button1_Click(object sender, EventArgs e) { MANAGER M = new MANAGER(); if (textBox1.Text == M.username && textBox2.Text == M.password) { admincontrols ac = new admincontrols(); ac.Show(); } else { MessageBox.Show("ACCESS DENIED"); } }
// GET: Admin/MANAGER/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MANAGER mANAGER = db.MANAGERs.Find(id); if (mANAGER == null) { return(HttpNotFound()); } return(View(mANAGER)); }
///////////////////// #region atribuição_Sources public void Refreshdata() { m = new MANAGER(); m.listadeIngredientes(); foreach (INGREDIENT Ingrediente in m.listadeIngredientes()) { if (!cboxPIngredienteuban.Items.Contains(Ingrediente.IngredienteNome)) { cboxPIngredienteuban.Items.Add(Ingrediente.IngredienteNome); } } cboxPCcomment.DataSource = m.listadeCMA(); cboxCommentUBAN.DataSource = m.listadeCMB(); cboxcommentUA.DataSource = m.listadeCMUA(); cboxUserBanPU.DataSource = m.listadeUSERSbanidos(); cboxUserubanPU.DataSource = m.listadeUSERS(); cboxnaoaprovadas.DataSource = m.listadeRECEITASUA(); cboxPRruban.DataSource = m.listadeRECEITASA(); cboxPRrBAN.DataSource = m.listadeRECEITASB(); }
///////////////////// #region pageload protected void Page_Load(object sender, EventArgs e) { ///////////////////// #region userId_Verify if (Session["User"] == null) { userId = 0; } else { userId = (int)(Session["User"]); } #endregion ///////////////////// MANAGER m = new MANAGER(); DataSet ds = m.GetData(); GridView1.DataSource = ds; GridView1.DataBind(); Repeater1.DataSource = ds; Repeater1.DataBind(); }
/// <summary> /// Возвратить наименование элемента списка (специальная вкладка) /// </summary> /// <param name="modeManager">Тип вкладки</param> /// <param name="modeComponent">Режим компонентов ТЭЦ</param> /// <returns>Строка - подпись для элемента списка</returns> public string getNameAdminValues(MANAGER modeManager, MODE_TECCOMPONENT modeComponent) { string[] arNameAdminValues = { "НСС" /*TEC*/, "Диспетчер" /*GTP*/, "НСС" /*PC*/, "НСС" /*TG*/ }; string prefix = ((modeManager == MANAGER.DISP) || (modeManager == MANAGER.NSS) || (modeManager == MANAGER.LK) || (modeManager == MANAGER.TEPLOSET)) ? @"ПБР" : (modeManager == MANAGER.ALARM) ? @"Сигн." : @"Неизвестно"; switch (modeManager) { case MANAGER.LK: prefix += @" - ЛК"; break; case MANAGER.TEPLOSET: prefix += @" - Теплосеть"; break; default: prefix += @" - " + arNameAdminValues[(int)modeComponent]; break; } return(prefix); }
public static bool Insert(String encrypted, String name) { //Khởi tạo một đối tượng ACCOUNT bool flag = true; _db = new FoodStoreEntities(); try { var manager = new MANAGER(); manager.ID = GetMaxId(); manager.Name = name; manager.Encrypted = encrypted; _db.MANAGERs.AddObject(manager); _db.SaveChanges(); } catch (Exception) { flag = false; throw; } return flag; }
///////////////////// #region page_Load protected void Page_Load(object sender, EventArgs e) { ///////////////////// #region UserId_Verify userId = (int)(Session["User"]); if (userId == 0) { Response.Redirect("LOGIN_REGISTAR.aspx"); } #endregion ///////////////////// #region Verificação_de_sessão if (Session["User"] == null) { Response.Redirect("HomePage.aspx"); } #endregion ///////////////////// #region Dal_Manager /////////////////DAL MANAGER///////////////////// MANAGER M = new MANAGER(); //////////////////////////////////////////////// #endregion ////////////////////////////////////////// #region Popular_Dropdown_Lista_Ingredientes if (ingredientelista.Items.Count == 0) { foreach (INGREDIENT Ingrediente in M.listadeIngredientes()) { ingredientelista.Items.Add(Ingrediente.IngredienteNome); } } #endregion ////////////////////////////////////////// #region Popular_Dropdown_Lista_Categorias if (receitaCategoria.Items.Count == 0) { foreach (CATEGORIA Categoria in M.listadecategorias()) { receitaCategoria.Items.Add(Categoria.CategoriaNome); } } #endregion ////////////////////////////////////////// #region Popular_Dropdown_Lista_Dificuldade if (receitaDificuldade.Items.Count == 0) { foreach (DIFICULDADE dificuldade in M.listadedificuldades()) { receitaDificuldade.Items.Add(dificuldade.DificuldadeNome); } } #endregion ////////////////////////////////////////// #region Popular_Dropdown_Lista_Unidade if (ingredienteunidade.Items.Count == 0) { foreach (UNIDADE Unidade in M.listadeUnidades()) { ingredienteunidade.Items.Add(Unidade.UnidadeNome); } } #endregion ////////////////////////////////////////// }
public void AddToMANAGER(MANAGER mANAGER) { base.AddObject("MANAGER", mANAGER); }
public static MANAGER CreateMANAGER(int ID, string nAME, string pASSWORD) { MANAGER mANAGER = new MANAGER(); mANAGER.ID = ID; mANAGER.NAME = nAME; mANAGER.PASSWORD = pASSWORD; return mANAGER; }
protected void Page_Load(object sender, EventArgs e) { try { string account = Request.Params.Get("account"); string password = Request.Params.Get("password"); if (account == null || password == null) { return; } MANAGER manager; try { manager = ManagerAccess.GetManagerByName(account); } catch { Response.Write("连接错误,请重新试"); Response.End(); return; } if (manager != null) { Response.Write("该账号已经存在"); Response.End(); } MANAGER newManager = new MANAGER(); newManager.NAME = account; newManager.PASSWORD = password; int permissionNum = int.Parse(Request.Params.Get("permission")); newManager.MNGR_TYPE = int.Parse(Request.Params.Get("type")); if (ManagerAccess.AddManager(newManager)) { try { newManager = ManagerAccess.GetManagerByName(account); PERMISSION[] allPermission = ManagerAccess.GetAllPermissions(); for (int i = 0; permissionNum != 0; i++) { if ((permissionNum & (1 << i)) != 0) { ManagerAccess.GrantPermissionToManager(newManager.ID, allPermission[i].ID); permissionNum -= (1 << i); } } } catch { Response.Write("权限添加失败"); Response.End(); } Response.Write("success"); Response.End(); } else { Response.Write("新建管理员失败,请重试"); Response.End(); } } catch { } }
// insert user public int InsertUser(MANAGER user) { db.MANAGERs.Add(user); db.SaveChanges(); return(user.id); }
///////////////////// #region pageload protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { IDreceita = Request.QueryString["IDreceita"]; ///////////////////// #region userId_Verify if (Session["User"] == null) { userId = 0; } else { userId = (int)(Session["User"]); } ValidateVoto(); VotoMedia(); ValidateFAV(); #endregion ///////////////////// #region ObterReceita_TodoinDALv2.0 string ligacao = ConfigurationManager.ConnectionStrings["WebsiteReceitasDBcnstr"].ConnectionString; ReceitaID = 0; #region receberReceita using (SqlConnection con = new SqlConnection(ligacao)) { SqlCommand cmd = new SqlCommand("ObterReceitaEscolhida", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@IDreceita", IDreceita); con.Open(); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { receitanome.Text = reader["Receita"].ToString(); ReceitaDescricao.Text = reader["Descrição"].ToString(); receitaAutor.Text = reader["Autor"].ToString(); receitaCategoria.Text = reader["Categoria"].ToString(); receitaDificuldade.Text = reader["Dificuldade"].ToString(); receitaDuracao.Text = reader["Duração"].ToString(); ReceitaID = Int32.Parse(reader["ID"].ToString()); byte[] byteData = (byte[])reader["Imagem"]; imagemreceita.ImageUrl = "data:image;base64," + Convert.ToBase64String(byteData); } } } ///////////////////// #region desespero puro MANAGER m = new MANAGER(); DataSet ds = m.GetDataING(ReceitaID); DataSet dsCM = m.GetDataCM(ReceitaID); GridView1.DataSource = ds; GridView1.DataBind(); Repeater1.DataSource = ds; Repeater1.DataBind(); GridView2.DataSource = dsCM; GridView2.DataBind(); Repeater2.DataSource = dsCM; Repeater2.DataBind(); ////////// O QUE ESTOU EU A FAZER COM A MINHA VIDA? ////////// #endregion ///////////////////// #endregion ///////////////////// #endregion ///////////////////// #region votodisplay if (Convert.ToDouble(votoNum) > 0 && Convert.ToDouble(votoNum) <= 1) { ratingimagem.ImageUrl = "~/RESOURCES/IMAGES/RATING/1.png"; } else if (Convert.ToDouble(votoNum) > 1 && Convert.ToDouble(votoNum) <= 2) { ratingimagem.ImageUrl = "~/RESOURCES/IMAGES/RATING/2.png"; } else if (Convert.ToDouble(votoNum) > 2 && Convert.ToDouble(votoNum) <= 3) { ratingimagem.ImageUrl = "~/RESOURCES/IMAGES/RATING/3.png"; } else if (Convert.ToDouble(votoNum) > 3 && Convert.ToDouble(votoNum) <= 4) { ratingimagem.ImageUrl = "~/RESOURCES/IMAGES/RATING/4.png"; } else if (Convert.ToDouble(votoNum) > 4 && Convert.ToDouble(votoNum) <= 5) { ratingimagem.ImageUrl = "~/RESOURCES/IMAGES/RATING/5.png"; } #endregion ///////////////////// } else { IDreceita = Request.QueryString["IDreceita"]; ReceitaID = Convert.ToInt32(IDreceita); if (Session["User"] == null) { userId = 0; } else { userId = (int)(Session["User"]); } ValidateVoto(); ValidateFAV(); } }