public static frmItems.EditorType getEditorType(ItemSubCategory itemSubCategory) { switch (itemSubCategory) { case ItemSubCategory.Ammo: return(frmItems.EditorType.Items_Ammo); case ItemSubCategory.Beam_Weapon: return(frmItems.EditorType.Items_Beam); case ItemSubCategory.Device: return(frmItems.EditorType.Items_Device); case ItemSubCategory.Engine: return(frmItems.EditorType.Items_Engine); case ItemSubCategory.Missile_Launcher: return(frmItems.EditorType.Items_Missile); case ItemSubCategory.Projectile_Launcher: return(frmItems.EditorType.Items_Projectile); case ItemSubCategory.Reactor: return(frmItems.EditorType.Items_Reactor); case ItemSubCategory.Shield: return(frmItems.EditorType.Items_Shield); } return(frmItems.EditorType.Items); }
public override int GetHashCode() { int hash = 1; if (ItemId != 0L) { hash ^= ItemId.GetHashCode(); } if (ItemSubCategory != 0) { hash ^= ItemSubCategory.GetHashCode(); } if (ItemImageName.Length != 0) { hash ^= ItemImageName.GetHashCode(); } if (ItemFrame != 0) { hash ^= ItemFrame.GetHashCode(); } if (ItemType != 0) { hash ^= ItemType.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
protected void dgItemSubCategory_ItemCommand(object source, DataGridCommandEventArgs e) { ItemSubCategory itemSubCategory = new ItemSubCategory(); if (e.CommandName == "AddNew") { try { DropDownList ddlItemCategory = e.Item.FindControl("ddlItemCategory") as DropDownList; itemSubCategory.ItemCategory = _presenter.GetItemCategoryById(Convert.ToInt32(ddlItemCategory.SelectedValue)); TextBox txtFName = e.Item.FindControl("txtFName") as TextBox; itemSubCategory.Name = txtFName.Text; TextBox txtFCode = e.Item.FindControl("txtFCode") as TextBox; itemSubCategory.Code = txtFCode.Text; SaveItemSubCategory(itemSubCategory); dgItemSubCategory.EditItemIndex = -1; BindItemSubCategory(); } catch (Exception ex) { Master.ShowMessage(new AppMessage("Error: Unable to Add Item Sub Category " + ex.Message, RMessageType.Error)); ExceptionUtility.LogException(ex, ex.Source); ExceptionUtility.NotifySystemOps(ex, _presenter.CurrentUser().FullName); } } }
public ActionResult DeleteConfirmed(int id) { ItemSubCategory itemSubCategory = db.ItemSubCategories.Find(id); db.ItemSubCategories.Remove(itemSubCategory); db.SaveChanges(); return(RedirectToAction("Index")); }
protected void dgItemSubCategory_SelectedIndexChanged(object sender, EventArgs e) { int ItemSubCategoryID = (int)dgItemSubCategory.DataKeys[dgItemSubCategory.SelectedIndex]; Session["ItemSubCategoryID"] = ItemSubCategoryID; dgItemSubCategory.SelectedItemStyle.BackColor = System.Drawing.Color.BurlyWood; categoryDiv.Visible = true; _ItemSubCategory = _presenter.GetItemSubCategoryById(ItemSubCategoryID); Session["ItemSubCategory"] = _ItemSubCategory; }
public ActionResult Edit([Bind(Include = "Id,catName,MId")] ItemSubCategory itemSubCategory) { if (ModelState.IsValid) { db.Entry(itemSubCategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MId = new SelectList(db.ItemMainCategories, "Id", "catName", itemSubCategory.MId); return(View(itemSubCategory)); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { this._presenter.OnViewInitialized(); BindItemSubCategory(); } this._presenter.OnViewLoaded(); _ItemSubCategory = Session["ItemSubCategory"] as ItemSubCategory; }
// GET: ItemSubCategories/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ItemSubCategory itemSubCategory = db.ItemSubCategories.Find(id); if (itemSubCategory == null) { return(HttpNotFound()); } return(View(itemSubCategory)); }
// GET: ItemSubCategories/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ItemSubCategory itemSubCategory = db.ItemSubCategories.Find(id); if (itemSubCategory == null) { return(HttpNotFound()); } ViewBag.MId = new SelectList(db.ItemMainCategories, "Id", "catName", itemSubCategory.MId); return(View(itemSubCategory)); }
// GET: ItemSubCategories/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ItemSubCategory itemSubCategory = db.ItemSubCategories.Find(id); if (itemSubCategory == null) { return(HttpNotFound()); } db.ItemSubCategories.Remove(itemSubCategory); db.SaveChanges(); return(RedirectToAction("Index")); }
protected void dgItemSubCategory_DeleteCommand(object source, DataGridCommandEventArgs e) { int id = (int)dgItemSubCategory.DataKeys[e.Item.ItemIndex]; ItemSubCategory ItemSubCategory = _presenter.GetItemSubCategoryById(id); try { _presenter.DeleteItemSubCategory(ItemSubCategory); BindItemSubCategory(); Master.ShowMessage(new AppMessage("Item Sub Category was removed successfully", RMessageType.Info)); } catch (Exception ex) { Master.ShowMessage(new AppMessage("Error: Unable to delete Item Sub Category. " + ex.Message, RMessageType.Error)); } }
private void SaveItemSubCategory(ItemSubCategory ItemSubCategory) { try { if (ItemSubCategory.Id <= 0) { _presenter.SaveOrUpdateItemSubCategory(ItemSubCategory); Master.ShowMessage(new AppMessage("Item Sub Category saved", RMessageType.Info)); } else { _presenter.SaveOrUpdateItemSubCategory(ItemSubCategory); Master.ShowMessage(new AppMessage("Item Sub Category Updated", RMessageType.Info)); } } catch (Exception ex) { Master.ShowMessage(new AppMessage(ex.Message, RMessageType.Error)); ExceptionUtility.LogException(ex, ex.Source); ExceptionUtility.NotifySystemOps(ex, _presenter.CurrentUser().FullName); } }
public void CreateItemCatgory(ItemSubCategory itemSubCategory) { _ItemSubCategoryRepository.Add(itemSubCategory); _UnitOfWork.Commit(); }
public static string SubCategoryLookup(ItemSubCategory SubCat) { return SubCat.ToString().Replace('_',' '); }
protected void Page_Load(object sender, EventArgs e) { db = new MooglenomicsDatabaseDataContext(); //itemsList = db.Items.Where(p => p.isUntradeable == false).OrderBy(p => p.ItemSubCategory.ItemCategory.ItemCategoryID).ThenBy(p => p.ItemSubCategory.ItemSubCat_ID).ToList(); HttpCookie hc = MoogleCookieHelper.GetCookie(Request); if (hc != null) { currentUser = db.Users.SingleOrDefault(i => i.UserID.ToString().Equals(hc["userID"])); } if (currentUser == null) { Response.Redirect("Login.aspx"); } if (!IsPostBack) { string catID = Request.QueryString["cat"]; string subcatID = Request.QueryString["subcat"]; string itemID = Request.QueryString["item"]; if (itemID != null) { Load_Item(itemID); } Subcategory_DropDownList.Items.Clear(); Category_DropDownList.Items.Clear(); Subcategory_DropDownList.Items.Add("All"); Category_DropDownList.Items.Add("All"); int iCat = 0; List<ItemCategory> icList = db.ItemCategories.ToList(); foreach (ItemCategory ic in icList) { iCat++; Category_DropDownList.Items.Add(ic.CategoryName); if (catID != null && ic.ItemCategoryID.ToString().Equals(catID)) { Category_DropDownList.SelectedIndex = iCat; itemCategory = ic; List<ItemSubCategory> iscList = ic.ItemSubCategories.ToList(); foreach (ItemSubCategory isc in iscList) { Subcategory_DropDownList.Items.Add(isc.Name); if (subcatID != null && isc.ItemSubCat_ID.ToString().Equals(subcatID)) { itemSubcategory = isc; } } } } ItemList_Filter(); } }
public void DeleteItemSubCategory(ItemSubCategory ItemSubCategory) { _controller.DeleteEntity(ItemSubCategory); }
public void UpdateItemCatgory(ItemSubCategory itemSubCategory) { _ItemSubCategoryRepository.Update(itemSubCategory); _UnitOfWork.Commit(); }
public static frmItems.EditorType getEditorType(ItemSubCategory itemSubCategory) { switch (itemSubCategory) { case ItemSubCategory.Ammo: return frmItems.EditorType.Items_Ammo; case ItemSubCategory.Beam_Weapon: return frmItems.EditorType.Items_Beam; case ItemSubCategory.Device: return frmItems.EditorType.Items_Device; case ItemSubCategory.Engine: return frmItems.EditorType.Items_Engine; case ItemSubCategory.Missile_Launcher: return frmItems.EditorType.Items_Missile; case ItemSubCategory.Projectile_Launcher: return frmItems.EditorType.Items_Projectile; case ItemSubCategory.Reactor: return frmItems.EditorType.Items_Reactor; case ItemSubCategory.Shield: return frmItems.EditorType.Items_Shield; } return frmItems.EditorType.Items; }
public void SaveOrUpdateItemSubCategory(ItemSubCategory ItemSubCategory) { _controller.SaveOrUpdateEntity(ItemSubCategory); }
public static string SubCategoryLookup(ItemSubCategory SubCat) { return(SubCat.ToString().Replace('_', ' ')); }
public static ItemCategory ToItemCategory(this ItemSubCategory sub) { switch (sub) { case ItemSubCategory.OtherUnknown: // Default case ItemSubCategory.OtherQuestItem: // itm.location.* (Low Priority) case ItemSubCategory.OtherLockbox: // itm.loot.lockbox.* case ItemSubCategory.OtherCustomization: // Contains Slot: EquipHumanOutfit case ItemSubCategory.OtherGift: // GiftType != None (High Priority) case ItemSubCategory.OtherCurrency: // itm.loot.token.* case ItemSubCategory.OtherMount: // itm.mount.* case ItemSubCategory.OtherPet: // itm.pet.* return(ItemCategory.Other); case ItemSubCategory.EquipmentLightArmor: // ArmorSpec == Light case ItemSubCategory.EquipmentMediumArmor: // ArmorSpec == Medium case ItemSubCategory.EquipmentHeavyArmor: // ArmorSpec == Heavy case ItemSubCategory.EquipmentDroidPart: // Slots Contains any droid slots (higher priority than EquipmentHeavyArmor) case ItemSubCategory.EquipmentEar: // Slots Contains EquipHumanEar case ItemSubCategory.EquipmentImplant: // Slots Contains EquipHumanImplant case ItemSubCategory.EquipmentRelic: // Slots Contains EquipHumanRelic case ItemSubCategory.EquipmentFocus: // ArmorSpec == Focus case ItemSubCategory.EquipmentGenerator: // ArmorSpec == Generator case ItemSubCategory.EquipmentShield: // ArmorSpec == Shield OR ArmorSpec == ShieldForce case ItemSubCategory.EquipmentSpace: // itm.space.* return(ItemCategory.Equipment); case ItemSubCategory.WeaponBlasterPistol: // WeaponSpec == Pistol case ItemSubCategory.WeaponBlasterRifle: // WeaponSpec == Rifle case ItemSubCategory.WeaponSniperRifle: // WeaponSpec == SniperRifle case ItemSubCategory.WeaponAssaultCannon: // WeaponSpec == AssaultCannon case ItemSubCategory.WeaponLightsaber: // WeaponSpec == Lightsaber case ItemSubCategory.WeaponPolesaber: // WeaponSpec == Polesaber case ItemSubCategory.WeaponVibroblade: // WeaponSpec == Vibroblade case ItemSubCategory.WeaponVibroknife: // WeaponSpec == Vibroknife case ItemSubCategory.WeaponShotgun: // WeaponSpec == Shotgun case ItemSubCategory.WeaponElectrostaff: // WeaponSpec == Electrostaff case ItemSubCategory.WeaponTrainingSaber: // WeaponSpec == TrainingSaber return(ItemCategory.Weapon); case ItemSubCategory.CraftingMaterial: // itm.mat.* case ItemSubCategory.CraftingSchematic: // itm.schem.* return(ItemCategory.Crafting); case ItemSubCategory.ConsumableAdrenal: // itm.potion.adrenal.* case ItemSubCategory.ConsumableMedpac: // itm.potion.medpac.* case ItemSubCategory.ConsumableStim: // itm.potion.stimpack.* case ItemSubCategory.ConsumableFood: // itm.potion.food.* case ItemSubCategory.ConsumablePvp: // itm.potion.pvp.* case ItemSubCategory.ConsumableGrenade: // itm.grenade.* return(ItemCategory.Consumable); case ItemSubCategory.ItemModColorCrystal: // EnhancementType == ColorCrystal case ItemSubCategory.ItemModArmoring: // EnhancementType == Harness case ItemSubCategory.ItemModAugment: // EnhancementType == Modulator case ItemSubCategory.ItemModMod: // EnhancementType == Overlay case ItemSubCategory.ItemModEnhancement: // EnhancementType == Support case ItemSubCategory.ItemModBarrel: // EnhancementType == Barrel case ItemSubCategory.ItemModHilt: // EnhancementType == PowerCrystal return(ItemCategory.ItemMod); default: return(ItemCategory.Other); } }