public ActionResult ItemsTypePartialDelete(System.String Code) { var model = new object[0]; if (Code != null) { try { // Insert here a code to delete the item from your model ItemTypeList.DeleteItemType(Code); } catch (Exception e) { ViewData["EditError"] = e.Message; } } return(PartialView("_ItemsTypePartial", ItemTypeList.GetData())); }
private void UpdateDataView() { string sSql = string.Empty; string filter = txtFilter.Text; if (filter != string.Empty) { string cleanFilter = filter.Replace("'", "''").ToLower(); cleanFilter = cleanFilter.Replace("[", "[[]"); cleanFilter = cleanFilter.Replace("_", "[_]"); cleanFilter = cleanFilter.Replace("%", "[%]"); sSql = " LOWER(ItemTypeName) like '%" + cleanFilter + "%' "; } using (ItemTypeList itemTypes = ItemType.GetAll(sSql)) { if (itemTypes != null) { if (itemTypes.Count > 0) { dg.DataSource = itemTypes; Utils.InitGridSort(ref dg); dg.DataBind(); dg.Visible = true; lbNoresults.Visible = false; } else { if (txtFilter.Text.Length > 0) { lbNoresults.Text = "No record match your search (" + txtFilter.Text + ")"; } lbNoresults.Visible = true; dg.Visible = false; } } } panelGrid.Visible = true; lbTitle.Text = "Item types list"; }
public ActionResult ItemsTypePartialUpdate(MVC.Areas.Item.Models.APIItemType item) { var model = new object[0]; if (ModelState.IsValid) { try { // Insert here a code to update the item in your model ItemTypeList.UpdateItemType(item); } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = "Please, correct all errors."; } return(PartialView("_ItemsTypePartial", ItemTypeList.GetData())); }
private void AddRequiredGroupItem(ItemTypeList itemType, string group, string name) { if (itemType == ItemTypeList.AgendaItem) { BuilderMgr.ClickAddAgendaItem(); BuilderMgr.AGMgr.SetName(name); BuilderMgr.AGMgr.SetType(AgendaItemManager.AgendaItemType.CheckBox); BuilderMgr.AGMgr.SetVisibilityOption(true, CFManagerBase.VisibilityOption.Required); UIUtil.DefaultProvider.ExpandAdvanced(); BuilderMgr.AGMgr.SetGroupName(group); BuilderMgr.AGMgr.ClickSaveItem(); } else { switch (itemType) { case ItemTypeList.PersonalInfo: BuilderMgr.ClickAddPICustomField(); break; case ItemTypeList.Travel: BuilderMgr.ClickAddTravelCustomField(); break; case ItemTypeList.Lodging: BuilderMgr.ClickAddLodgingCustomField(); break; case ItemTypeList.Preferences: BuilderMgr.ClickAddPreferencesCustomField(); break; } BuilderMgr.CFMgr.SetName(name); BuilderMgr.CFMgr.SetType(CustomFieldManager.CustomFieldType.CheckBox); BuilderMgr.CFMgr.SetVisibilityOption(true, CFManagerBase.VisibilityOption.Required); UIUtil.DefaultProvider.ExpandAdvanced(); BuilderMgr.CFMgr.SetGroupName(group); BuilderMgr.CFMgr.SaveAndClose(); } }
public ActionResult ItemsTypePartial() { var model = new object[0]; return(PartialView("_ItemsTypePartial", ItemTypeList.GetData())); }
public static bool GetQualifiesForArmorBonus(Character c, Item additionalItem) { // Easier to check if there is a DIS qualifying item than // to ensure than every item matches what we expect. ItemTypeList list = new ItemTypeList(); list.Add(ItemType.Cloth); list.Add(ItemType.Leather); list.Add(ItemType.Mail); if (additionalItem != null && list.Contains(additionalItem.Type)) return false; else if ((c.Chest != null && list.Contains(c.Chest.Type)) || (c.Feet != null && list.Contains(c.Feet.Type)) || (c.Hands != null && list.Contains(c.Hands.Type)) || (c.Head != null && list.Contains(c.Head.Type)) || (c.Legs != null && list.Contains(c.Legs.Type)) || (c.Neck != null && list.Contains(c.Neck.Type)) || (c.Shoulders != null && list.Contains(c.Shoulders.Type)) || (c.Waist != null && list.Contains(c.Waist.Type)) || (c.Wrist != null && list.Contains(c.Wrist.Type)) ) return false; else return true; }