/// Checks if the folder exists or not. /// <param name="type"></param> /// <param name="path">Parent folder path</param> /// <param name="folderName">Name of the folder to search</param> /// <returns>True if found, else false.</returns> public bool CheckExist(ItemTypeEnum type, string path, string folderName) { var tempPath = Path.Combine(path, folderName).Replace(@"\", "/"); // Condition criteria. // Condition criteria. var condition = new SearchCondition { Condition = ConditionEnum.Contains, ConditionSpecified = true, Name = "Name", Value = "" }; var conditions = new SearchCondition[1]; conditions[0] = condition; var returnedItems = this._rs.FindItems(path, BooleanOperatorEnum.Or, conditions); // Iterate thro' each report properties to get the path. foreach (var item in returnedItems) { if (item.Type == type) { if (item.Path.Trim().ToLower() == tempPath.Trim().ToLower()) { return true; } } } return false; }
public PartialViewResult AddComment(Guid itemId, ItemTypeEnum itemType, Guid? parentCommentId, string commentText) { if (!string.IsNullOrEmpty(commentText) && User.UserId != null) { BaseItemModel data = null; Guid newItemId = DataService.AddComment(itemId, (Guid)User.UserId, parentCommentId, commentText, itemType); _mailService.NewComment(newItemId); switch (itemType) { case ItemTypeEnum.Author: data = DataService.GetAuthor(itemId, User.UserId); break; case ItemTypeEnum.Book: data = DataService.GetBook(itemId, User.UserId); break; case ItemTypeEnum.Serie: data = DataService.GetSerie(itemId, User.UserId); break; case ItemTypeEnum.Review: data = DataService.GetReview(itemId, User.UserId); break; } return PartialView("~/Views/Partial/Comments.cshtml", data); } return null; }
private static CatalogItemType DetermineCatalogItemType(ItemTypeEnum itemTypeEnum) { switch (itemTypeEnum) { case ItemTypeEnum.Report: return CatalogItemType.Report; case ItemTypeEnum.Folder: return CatalogItemType.Folder; default: throw new Exception(); } }
public static List <ItemRecord> GetItemsByType(ItemTypeEnum type) { return(Items.FindAll(x => x.Type == type)); }
public int GetTypeIndex(ItemTypeEnum type) { int typeIndex; switch (type) { case ItemTypeEnum.Folder: typeIndex = 0; break; case ItemTypeEnum.Report: typeIndex = 1; break; case ItemTypeEnum.Resource: typeIndex = 2; break; case ItemTypeEnum.LinkedReport: typeIndex = 3; break; case ItemTypeEnum.DataSource: typeIndex = 4; break; default: throw new Exception(string.Format(CultureInfo.InvariantCulture, Resources.Resources.NoTypeInformation + type)); } return typeIndex; }
public ActionResult MyThings(ItemTypeEnum itemType) { UserIncomesModel model = DataService.GetUserIncomes((Guid)User.UserId, itemType); return(View(model)); }
/// <summary> /// Checks if the folder exists or not. /// </summary> /// <param name="path">Parent folder path</param> /// <param name="folderName">Name of the folder to search</param> /// <returns>True if found, else false.</returns> private bool CheckExist(ItemTypeEnum type, string path, string folderName) { string fullPath = path + folderName; // Condition criteria. SearchCondition[] conditions; // Condition criteria. SearchCondition condition = new SearchCondition(); condition.Condition = ConditionEnum.Contains; condition.ConditionSpecified = true; condition.Name = "Name"; switch (type) { case ItemTypeEnum.Unknown: break; case ItemTypeEnum.Folder: condition.Value = folderName; break; case ItemTypeEnum.Report: break; case ItemTypeEnum.Resource: break; case ItemTypeEnum.LinkedReport: break; case ItemTypeEnum.DataSource: path += folderName.Substring(0, folderName.LastIndexOf('/')); condition.Value = folderName.Substring(folderName.LastIndexOf('/') + 1); break; case ItemTypeEnum.Model: break; default: break; } conditions = new SearchCondition[1]; conditions[0] = condition; this.ReturnedItems = ReportingService.FindItems(path, BooleanOperatorEnum.Or, conditions); // Iterate thro' each report properties to get the path. foreach (CatalogItem item in ReturnedItems) { if (item.Type == type) { if (item.Path == fullPath) return true; } } return false; }
public PartialViewResult SetRating(Guid itemId, ItemTypeEnum itemType, short ratingValue) { BaseItemModel model = GetNewItemByType(itemType); model.Id = itemId; model.Rating = DoSetRating(itemId, (Guid)User.UserId, itemType, ratingValue); return PartialView("~/Views/Partial/Rating.cshtml", model); }
public static AvailableListing CreateAvailableListing(IPrincipal user, string itemDescription, ItemCategoryEnum itemCategory, ItemTypeEnum itemType, decimal quantityRequired, string uom, DateTime?availableFrom, DateTime?availableTo, ItemConditionEnum itemCondition, DateTime?displayUntilDate, DateTime?sellByDate, DateTime?useByDate, bool?deliveryAvailable, ItemRequiredListingStatusEnum listingStatus) { ApplicationDbContext db = new ApplicationDbContext(); AvailableListing newAvailableListing = CreateAvailableListing(db, user, itemDescription, itemCategory, itemType, quantityRequired, uom, availableFrom, availableTo, itemCondition, displayUntilDate, sellByDate, useByDate, deliveryAvailable, listingStatus); db.Dispose(); return(newAvailableListing); }
public static ItemRecord[] GetItems(ItemTypeEnum type) { return(Items.FindAll(x => x.TypeEnum == type).ToArray()); }
public ItemTypeAttribute(ItemTypeEnum itemType) { ItemType = itemType; }
//returns the image index for the corresponding Items. int GetItemTypeImage(ItemTypeEnum itemType) { switch (itemType) { case ItemTypeEnum.DataSource: return 0; case ItemTypeEnum.Folder: return 1; case ItemTypeEnum.LinkedReport: return 2; case ItemTypeEnum.Model: return 3; case ItemTypeEnum.Report: return 4; case ItemTypeEnum.Resource: return 5; default: return 5; } }
public ActionResult Incomes(ItemTypeEnum viewType) { var model = DataService.GetUnprocessedIncomes(viewType); return View(model); }
/// <summary> /// Get Relevant percentage based on ItemType /// </summary> /// <remarks> /// Uses first found booking item / constituent that has the item type specified /// </remarks> /// <param name="bookingItems">Collection of BookingItems</param> /// <param name="bookingConstituents">booking constituents for all items sent in</param> /// <param name="itemType">ItemTypeEnum</param> /// <returns>relevant percentage of the BookingItem type</returns> public virtual decimal GetRelevantPercentageByItemType(List<BookingItem> bookingItems, List<BookingConstituent> bookingConstituents, ItemTypeEnum itemType) { Helper.ArgumentNotNull(bookingItems, "bookingItems"); // find booking item of the item type. var financialBookingItem = bookingItems.Find(b => b.ItemType == itemType); // not found, return 0 if (financialBookingItem == null) { return default(decimal); } // booking item found so get the cost booking constituents List<BookingConstituent> costBookingConstituents = bookingConstituents.Where(bc => bc.ItemId == financialBookingItem.Id).ToList(); // get first one that has a relevant percentage var costBookingConstituent = costBookingConstituents.FirstOrDefault(bc => bc.RelevantPercentage.HasValue); return costBookingConstituent != null && costBookingConstituent.RelevantPercentage.HasValue ? costBookingConstituent.RelevantPercentage.Value : default(decimal); }
/// <summary> /// Get ItemType code appending comma separator /// </summary> /// <param name="itemTypeEnum">ItemTypeEnum</param> /// <param name="separator">code separator</param> /// <returns></returns> private static string GetItemTypeCode(ItemTypeEnum itemTypeEnum, string separator) { return string.Concat(itemTypeEnum.GetCode(), separator); }
public IEnumerable<LuceneResultModel> GetSearchResults(string searchQuery, ItemTypeEnum? itemType = null) { CheckDirectoryExists(); using (Directory directory = GetLuceneDirectory()) { using (Analyzer analyzer = GetAnalyzer()) { using (IndexReader indexReader = IndexReader.Open(directory, true)) { using (Searcher indexSearch = new IndexSearcher(indexReader)) { searchQuery = EscapeString(searchQuery.Trim()); //string queryText = ""; //bool firstIteration = true; //foreach (string word in searchQuery.Trim().Split(' ')) //{ // if (firstIteration) // queryText += word; // else // queryText += " AND " + word; // firstIteration = false; //} searchQuery = EscapeString(searchQuery.Trim()); var query = new BooleanQuery(); foreach (string word in searchQuery.Trim().Split(' ')) { query.Add(new WildcardQuery(new Term("Title", string.Format("*{0}*", word.Trim().ToLower()))), Occur.MUST); } //var queryParser = new QueryParser(Version.LUCENE_30, "Title", analyzer); //var query = queryParser.Parse(queryText); //bQuery.Add(query, Occur.MUST); if (itemType != null) { var queryParser = new QueryParser(Version.LUCENE_30, "Type", analyzer); query.Add(queryParser.Parse(Convert.ToString((int)itemType)), Occur.MUST); } TopDocs resultDocs = indexSearch.Search(query, indexReader.MaxDoc); return resultDocs.ScoreDocs.Select(a => new { a.Score, a.Doc }) .Select(a => new { a.Score, Doc = indexSearch.Doc(a.Doc) }) .Select(a => new LuceneResultModel { Id = new Guid(a.Doc.Get("Id")), Type = (ItemTypeEnum)Convert.ToInt16(a.Doc.Get("Type")), Score = a.Score }).ToList(); } } } } }
public override List <CatalogItem> GetItems(string folderName, ItemTypeEnum type) { List <CatalogItem> _items = new List <CatalogItem>(); string targetFolder = this.basePath + @"\Resources\"; if (type == ItemTypeEnum.Folder || type == ItemTypeEnum.Report) { targetFolder = targetFolder + @"Report\"; if (!(string.IsNullOrEmpty(folderName) || folderName.Trim() == "/")) { targetFolder = targetFolder + folderName; } } if (type == ItemTypeEnum.DataSet) { foreach (var file in Directory.GetFiles(targetFolder + "DataSet")) { CatalogItem catalogItem = new CatalogItem(); catalogItem.Name = Path.GetFileNameWithoutExtension(file); catalogItem.Type = ItemTypeEnum.DataSet; catalogItem.Id = Regex.Replace(catalogItem.Name, @"[^0-9a-zA-Z]+", "_"); _items.Add(catalogItem); } } else if (type == ItemTypeEnum.DataSource) { foreach (var file in Directory.GetFiles(targetFolder + "DataSource")) { CatalogItem catalogItem = new CatalogItem(); catalogItem.Name = Path.GetFileNameWithoutExtension(file); catalogItem.Type = ItemTypeEnum.DataSource; catalogItem.Id = Regex.Replace(catalogItem.Name, @"[^0-9a-zA-Z]+", "_"); _items.Add(catalogItem); } } else if (type == ItemTypeEnum.Folder) { foreach (var file in Directory.GetDirectories(targetFolder)) { CatalogItem catalogItem = new CatalogItem(); catalogItem.Name = Path.GetFileNameWithoutExtension(file); catalogItem.Type = ItemTypeEnum.Folder; catalogItem.Id = Regex.Replace(catalogItem.Name, @"[^0-9a-zA-Z]+", "_"); _items.Add(catalogItem); } } else if (type == ItemTypeEnum.Report) { string reportTypeExt = this.reportType == "RDLC" ? ".rdlc" : ".rdl"; foreach (var file in Directory.GetFiles(targetFolder, "*" + reportTypeExt)) { CatalogItem catalogItem = new CatalogItem(); catalogItem.Name = Path.GetFileName(file); catalogItem.Type = ItemTypeEnum.Report; catalogItem.Id = Regex.Replace(catalogItem.Name, @"[^0-9a-zA-Z]+", "_"); _items.Add(catalogItem); } } return(_items); }
/// <summary> /// Initializes a new instance of the <see cref="CatalogItem" /> class. /// </summary> /// <param name="catalogItemId">Unique catalog Item id.</param> /// <param name="isArchived">Returns true if the item is archived.</param> /// <param name="groups">Collection of groups associated with this item.</param> /// <param name="metafields">Collection of metafields.</param> /// <param name="itemType">Type of item (Product, Modifier, etc) (required).</param> /// <param name="sku">Stock Keeping Unit (SKU) (required).</param> /// <param name="name">Item name (required).</param> /// <param name="description">Item description.</param> /// <param name="price">Item price (required).</param> /// <param name="imageFileName">Image File Name.</param> /// <param name="alcohol">item contains alcohol.</param> public CatalogItem(string catalogItemId = default(string), bool?isArchived = default(bool?), List <CatalogGroupReference> groups = default(List <CatalogGroupReference>), List <Metafield> metafields = default(List <Metafield>), ItemTypeEnum itemType = default(ItemTypeEnum), string sku = default(string), string name = default(string), string description = default(string), double?price = default(double?), string imageFileName = default(string), bool?alcohol = default(bool?)) { // to ensure "itemType" is required (not null) if (itemType == null) { throw new InvalidDataException("itemType is a required property for CatalogItem and cannot be null"); } else { this.ItemType = itemType; } // to ensure "sku" is required (not null) if (sku == null) { throw new InvalidDataException("sku is a required property for CatalogItem and cannot be null"); } else { this.Sku = sku; } // to ensure "name" is required (not null) if (name == null) { throw new InvalidDataException("name is a required property for CatalogItem and cannot be null"); } else { this.Name = name; } // to ensure "price" is required (not null) if (price == null) { throw new InvalidDataException("price is a required property for CatalogItem and cannot be null"); } else { this.Price = price; } this.CatalogItemId = catalogItemId; this.IsArchived = isArchived; this.Groups = groups; this.Metafields = metafields; this.Description = description; this.ImageFileName = imageFileName; this.Alcohol = alcohol; }
public static ItemTypeEnum GetItemOffset(ItemTypeSpriteEnum itemTypeSpriteEnum) { ItemTypeEnum itemType = (ItemTypeEnum)Enum.Parse(typeof(ItemTypeEnum), itemTypeSpriteEnum.ToString()); return(itemType); }
/// <summary> /// 创建新增料品服务的DTO /// </summary> /// <param name="_itemModule"></param> /// <returns></returns> private ISVItem.ItemMasterDTO CreateItemMasterDTO(ISVItem.ItemMasterDTO _dtoItemModule, ItemMasterCustData _itemData, ContextInfo _cxtInfo) { ISVItem.ItemMasterDTO dtoItemNew = new ISVItem.ItemMasterDTO(); dtoItemNew.Org = new CommonArchiveDataDTO();//组织 Organization beOrg = Organization.FindByCode(_cxtInfo.OrgCode); dtoItemNew.Org.ID = beOrg.ID; dtoItemNew.Org.Code = beOrg.Code; dtoItemNew.Org.Name = beOrg.Name; if (!string.IsNullOrEmpty(_itemData.ItemCode)) { dtoItemNew.Code = _itemData.ItemCode;//料号 } dtoItemNew.SPECS = _itemData.Specs; //规格 dtoItemNew.ItemFormAttribute = ItemTypeAttributeEnum.GetFromName(_itemData.ItemFormAttribute); //料品形态属性 //if (ItemTypeAttributeEnum.GetFromName(_itemData.ItemFormAttribute) == ItemTypeAttributeEnum.PurchasePart) //{ // dtoItemNew.IsBOMEnable = false;//可BOM----采购件,不支持(委外)可BOM母件设定。 //} //else //{ dtoItemNew.IsBOMEnable = _dtoItemModule.IsBOMEnable; //可BOM //} dtoItemNew.ItemForm = ItemTypeEnum.GetFromValue(_itemData.ItemForm); //料品形态 //不进行料品版本的业务处理 dtoItemNew.IsVersionQtyControl = false; dtoItemNew.ItemMasterVersions = null;//默认不提供物料版本 dtoItemNew.Version = string.Empty; dtoItemNew.VersionID = 0L; StringBuilder strbCombName = new StringBuilder(); strbCombName.AppendFormat("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{11}|{12}|{13}|{14}|{15}", string.IsNullOrEmpty(_itemData.ItemName) ? "0" : _itemData.ItemName, string.IsNullOrEmpty(_itemData.Specs) ? "0" : _itemData.Specs, string.IsNullOrEmpty(_itemData.ItemProperty1) ? "0" : _itemData.ItemProperty1, string.IsNullOrEmpty(_itemData.ItemProperty2) ? "0" : _itemData.ItemProperty2, string.IsNullOrEmpty(_itemData.ItemProperty3) ? "0" : _itemData.ItemProperty3, string.IsNullOrEmpty(_itemData.ItemProperty4) ? "0" : _itemData.ItemProperty4, string.IsNullOrEmpty(_itemData.ItemProperty5) ? "0" : _itemData.ItemProperty5, string.IsNullOrEmpty(_itemData.ItemProperty6) ? "0" : _itemData.ItemProperty6, string.IsNullOrEmpty(_itemData.ItemProperty7) ? "0" : _itemData.ItemProperty7, string.IsNullOrEmpty(_itemData.ItemProperty8) ? "0" : _itemData.ItemProperty8, string.IsNullOrEmpty(_itemData.ItemProperty9) ? "0" : _itemData.ItemProperty9, string.IsNullOrEmpty(_itemData.ItemProperty10) ? "0" : _itemData.ItemProperty10, string.IsNullOrEmpty(_itemData.ItemProperty11) ? "0" : _itemData.ItemProperty11, string.IsNullOrEmpty(_itemData.ItemProperty12) ? "0" : _itemData.ItemProperty12, string.IsNullOrEmpty(_itemData.ItemProperty13) ? "0" : _itemData.ItemProperty13, string.IsNullOrEmpty(_itemData.ItemProperty14) ? "0" : _itemData.ItemProperty14); dtoItemNew.Name = strbCombName.ToString(); //dtoItemNew.Name = _itemData.ItemName;//测试 User beUser = User.Finder.FindByID(_cxtInfo.UserID); dtoItemNew.AliasName = string.Empty; //别名 dtoItemNew.CreatedBy = beUser.Name; //创建人 dtoItemNew.CreatedOn = DateTime.Now.Date; dtoItemNew.ModifiedBy = beUser.Name; //修改人 dtoItemNew.ModifiedOn = DateTime.Now.Date; dtoItemNew.IsMultyUOM = _dtoItemModule.IsMultyUOM; //多单位 dtoItemNew.IsDualUOM = _dtoItemModule.IsDualUOM; //双单位 UOM beUOM = UOM.FindByCode(_itemData.UOMCode); CommonArchiveDataDTO dtoUOM = new CommonArchiveDataDTO(); //单位 dtoUOM.Code = beUOM.Code; dtoUOM.ID = beUOM.ID; dtoUOM.Name = beUOM.Name; dtoItemNew.InventoryUOM = dtoUOM; //库存主单位 dtoItemNew.InventorySecondUOM = dtoUOM; //库存单位 dtoItemNew.BulkUom = dtoUOM; //体积单位 dtoItemNew.CostUOM = dtoUOM; //成本单位 dtoItemNew.ManufactureUOM = dtoUOM; //生产单位 dtoItemNew.MaterialOutUOM = dtoUOM; //领料单位 dtoItemNew.PurchaseUOM = dtoUOM; //采购单位 dtoItemNew.PriceUOM = dtoUOM; //计价单位 dtoItemNew.SalesUOM = dtoUOM; //销售单位 dtoItemNew.WeightUom = dtoUOM; //重量单位 Effective beEffective = new Effective(); beEffective.IsEffective = _itemData.Effective; beEffective.EffectiveDate = DateTime.Now.Date; // _dtoItemModule.Effective.EffectiveDate; beEffective.DisableDate = DateTime.Parse("9999-12-31"); // _dtoItemModule.Effective.DisableDate; dtoItemNew.Effective = beEffective; //生效性 #region dtoItemNew.DescFlexField;扩展字段 DescFlexSegments segments = new DescFlexSegments(); segments.SetValue("PrivateDescSeg5", _itemData.ItemDescSeg5); segments.SetValue("PrivateDescSeg6", _itemData.ItemDescSeg6); segments.SetValue("PrivateDescSeg7", _itemData.ItemDescSeg7); segments.SetValue("PrivateDescSeg8", _itemData.ItemDescSeg8); segments.SetValue("PrivateDescSeg9", _itemData.ItemDescSeg9); segments.SetValue("PrivateDescSeg10", _itemData.ItemDescSeg10); dtoItemNew.DescFlexField = segments; #endregion #region 模板物料赋值 dtoItemNew.AssetCategory = _dtoItemModule.AssetCategory; //财务分类 dtoItemNew.BoundedCategory = _dtoItemModule.BoundedCategory; //保税品类别 dtoItemNew.BoundedCountTaxRate = _dtoItemModule.BoundedCountTaxRate; //保税应补税率 dtoItemNew.BoundedCountToLerance = _dtoItemModule.BoundedCountToLerance; //保税盘差率 dtoItemNew.BoundedTaxNO = _dtoItemModule.BoundedTaxNO; //料品税则号 dtoItemNew.CatalogNO = _dtoItemModule.CatalogNO; //目录编号 dtoItemNew.ConverRatioRule = _dtoItemModule.ConverRatioRule; //转换率策略 dtoItemNew.CostCategory = _dtoItemModule.CostCategory; //成本分类 dtoItemNew.CostCurrency = _dtoItemModule.CostCurrency; //成本币种 dtoItemNew.CreditCategory = _dtoItemModule.CreditCategory; //信用分类 dtoItemNew.CustomNumber = _dtoItemModule.CustomNumber; //海关编码 dtoItemNew.CustomTaxRate = _dtoItemModule.CustomTaxRate; //海关增税率 dtoItemNew.DrawbackRate = _dtoItemModule.DrawbackRate; //退税率 dtoItemNew.EndGrade = _dtoItemModule.EndGrade; //结束等级 dtoItemNew.EndPotency = _dtoItemModule.EndPotency; //结束成分 dtoItemNew.EntranceInfo = _dtoItemModule.EntranceInfo; //进出口信息 dtoItemNew.InspectionInfo = _dtoItemModule.InspectionInfo; //料品质量相关信息 dtoItemNew.InternalTransCost = _dtoItemModule.InternalTransCost; //内部转移成本 dtoItemNew.InventoryInfo = _dtoItemModule.InventoryInfo; //料品库存相关信息 dtoItemNew.InventoryUOMGroup = _dtoItemModule.InventoryUOMGroup; //库存主单位计量单位组 dtoItemNew.IsBounded = _dtoItemModule.IsBounded; //保税品 dtoItemNew.IsBuildEnable = _dtoItemModule.IsBuildEnable; //可生产 dtoItemNew.IsCanFlowStat = _dtoItemModule.IsCanFlowStat; //可流向统计 dtoItemNew.IsDualQuantity = _dtoItemModule.IsDualQuantity; //双数量 dtoItemNew.IsGradeControl = _dtoItemModule.IsGradeControl; //等级控制 dtoItemNew.IsIncludedCostCa = _dtoItemModule.IsIncludedCostCa; //成本卷算 dtoItemNew.IsIncludedStockAsset = _dtoItemModule.IsIncludedStockAsset; //存货资产 dtoItemNew.IsInventoryEnable = _dtoItemModule.IsInventoryEnable; //可库存交易 dtoItemNew.IsMRPEnable = _dtoItemModule.IsMRPEnable; //可MRP dtoItemNew.IsNeedLicence = _dtoItemModule.IsNeedLicence; //需许可证 dtoItemNew.IsOutsideOperationEnable = _dtoItemModule.IsOutsideOperationEnable; //可委外 dtoItemNew.IsPotencyControl = _dtoItemModule.IsPotencyControl; //成分控制 dtoItemNew.IsPurchaseEnable = _dtoItemModule.IsPurchaseEnable; //可采购 dtoItemNew.IsSalesEnable = _dtoItemModule.IsSalesEnable; //可销售 dtoItemNew.IsSpecialItem = _dtoItemModule.IsSpecialItem; //专用料 dtoItemNew.IsTrademark = _dtoItemModule.IsTrademark; //厂牌管理 dtoItemNew.IsVarRatio = _dtoItemModule.IsVarRatio; //固定转换率 //dtoItemNew.IsVersionQtyControl = _dtoItemModule.IsVersionQtyControl;//版本数量控制 dtoItemNew.IsVMIEnable = _dtoItemModule.IsVMIEnable; //VMI标志 dtoItemNew.ItemBulk = _dtoItemModule.ItemBulk; //库存单位体积 //dtoItemNew.ItemForm = _dtoItemModule.ItemForm;//料品形态 dtoItemNew.ItemTradeMarkInfos = _dtoItemModule.ItemTradeMarkInfos; //料品厂牌信息 //dtoItemNew.MainItemCategory = _dtoItemModule.MainItemCategory;//主分类 dtoItemNew.MainItemCategory = new CommonArchiveDataDTO(); dtoItemNew.MainItemCategory.Code = _itemData.MainCategoryCode; dtoItemNew.MfgInfo = _dtoItemModule.MfgInfo; //料品生产相关信息 //MRPPlanningType 计划方法 dtoItemNew.MrpInfo = _dtoItemModule.MrpInfo; //料品MRP相关信息 dtoItemNew.MrpInfo.MRPPlanningType = _dtoItemModule.MrpInfo.MRPPlanningType; //计划方法 dtoItemNew.MRPCategory = _dtoItemModule.MRPCategory; //MRP分类 dtoItemNew.NeedInspect = _dtoItemModule.NeedInspect; //需商检 dtoItemNew.PlanCost = _dtoItemModule.PlanCost; //计划价 dtoItemNew.PriceCategory = _dtoItemModule.PriceCategory; //价格分类 dtoItemNew.ProductionCategory = _dtoItemModule.ProductionCategory; //生产分类 dtoItemNew.PurchaseCategory = _dtoItemModule.PurchaseCategory; //采购分类 dtoItemNew.PurchaseInfo = _dtoItemModule.PurchaseInfo; //料品采购相关信息 dtoItemNew.RecentlyCost = _dtoItemModule.RecentlyCost; //最新成本 dtoItemNew.RefrenceCost = _dtoItemModule.RefrenceCost; //参考成本 dtoItemNew.SaleCategory = _dtoItemModule.SaleCategory; //销售分类 dtoItemNew.SaleInfo = _dtoItemModule.SaleInfo; //料品销售相关信息 dtoItemNew.SaleInfo.ItemForInvoice = new CommonArchiveDataDTO(); dtoItemNew.SaleInfo.NameForInvoice = strbCombName.ToString(); dtoItemNew.StandardBatchQty = _dtoItemModule.StandardBatchQty; //标准批量 dtoItemNew.StandardCost = _dtoItemModule.StandardCost; //标准成本 dtoItemNew.StandardGrade = _dtoItemModule.StandardGrade; //标准等级 dtoItemNew.StandardPotency = _dtoItemModule.StandardPotency; //标准成分 dtoItemNew.StartGrade = _dtoItemModule.StartGrade; //起始等级 dtoItemNew.StartPotency = _dtoItemModule.StartPotency; //起始成分 dtoItemNew.State = _dtoItemModule.State; //料品状态 dtoItemNew.StateTime = _dtoItemModule.StateTime; //状态提交日期 dtoItemNew.StateUser = _dtoItemModule.StateUser; //提交人 dtoItemNew.Status = _dtoItemModule.Status; //状态码 dtoItemNew.StatusLastModify = DateTime.Now.Date; //状态日期 dtoItemNew.StockCategory = _dtoItemModule.StockCategory; //库存分类 dtoItemNew.TradeMark = _dtoItemModule.TradeMark; //厂牌 dtoItemNew.Weight = _dtoItemModule.Weight; //库存单位重量 #endregion return(dtoItemNew); }
public void RemoveComment(Guid itemId, ItemTypeEnum itemType) { if (User.UserId != null) { DataService.DeleteComment(itemId); } }
/// <summary> /// 创建修改料品服务的DTO /// </summary> /// <param name="_itemModule"></param> /// <returns></returns> private ISVItem.ItemMasterDTO ModifyItemMasterDTO(ItemMaster _itemExists, ItemMasterCustData _itemData, ContextInfo _cxtInfo, bool _isNewVersion) { ISVItem.BatchQueryItemByDTOSRV srvQueryItemDTO = new ISVItem.BatchQueryItemByDTOSRV(); List <ISVItem.QueryItemDTO> lstQueryDTO = new List <ISVItem.QueryItemDTO>(); ISVItem.QueryItemDTO dtoExists = new ISVItem.QueryItemDTO(); dtoExists.ItemMaster = new CommonArchiveDataDTO(); dtoExists.ItemMaster.ID = _itemExists.ID; lstQueryDTO.Add(dtoExists); srvQueryItemDTO.QueryItemDTOs = lstQueryDTO; List <ISVItem.ItemMasterDTO> lstItemMasterDTO = srvQueryItemDTO.Do(); ISVItem.ItemMasterDTO dtoItemModify = null; if (lstItemMasterDTO != null && lstItemMasterDTO.Count > 0) { dtoItemModify = lstItemMasterDTO[0]; dtoItemModify.SPECS = _itemData.Specs;//规格 if (!string.IsNullOrEmpty(_itemData.ItemForm)) { dtoItemModify.ItemForm = ItemTypeEnum.GetFromValue(_itemData.ItemForm); //料品形态 } dtoItemModify.ItemFormAttribute = ItemTypeAttributeEnum.GetFromName(_itemData.ItemFormAttribute); //料品形态属性 User beUser = User.Finder.FindByID(_cxtInfo.UserID); dtoItemModify.ModifiedBy = beUser.Name;//修改人 dtoItemModify.ModifiedOn = DateTime.Now.Date; dtoItemModify.Effective.IsEffective = _itemData.Effective; //若单位为提供,则沿用原单位 CommonArchiveDataDTO dtoUOM = new CommonArchiveDataDTO(); if (String.IsNullOrEmpty(_itemData.UOMCode)) { dtoUOM.Code = _itemExists.InventoryUOM.Code; dtoUOM.ID = _itemExists.InventoryUOM.ID; dtoUOM.Name = _itemExists.InventoryUOM.Name; } else { UOM beUOM = UOM.FindByCode(_itemData.UOMCode); dtoUOM.Code = beUOM.Code; dtoUOM.ID = beUOM.ID; dtoUOM.Name = beUOM.Name; } dtoItemModify.InventoryUOM = dtoUOM; //库存主单位 dtoItemModify.InventorySecondUOM = dtoUOM; //库存单位 dtoItemModify.BulkUom = dtoUOM; //体积单位 dtoItemModify.CostUOM = dtoUOM; //成本单位 dtoItemModify.ManufactureUOM = dtoUOM; //生产单位 dtoItemModify.MaterialOutUOM = dtoUOM; //领料单位 dtoItemModify.PurchaseUOM = dtoUOM; //采购单位 dtoItemModify.PriceUOM = dtoUOM; //计价单位 dtoItemModify.SalesUOM = dtoUOM; //销售单位 dtoItemModify.WeightUom = dtoUOM; //重量单位 StringBuilder strbCombName = new StringBuilder(); strbCombName.AppendFormat("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{11}|{12}|{13}|{14}|{15}", string.IsNullOrEmpty(_itemData.ItemName) ? "0" : _itemData.ItemName, string.IsNullOrEmpty(_itemData.Specs) ? "0" : _itemData.Specs, string.IsNullOrEmpty(_itemData.ItemProperty1) ? "0" : _itemData.ItemProperty1, string.IsNullOrEmpty(_itemData.ItemProperty2) ? "0" : _itemData.ItemProperty2, string.IsNullOrEmpty(_itemData.ItemProperty3) ? "0" : _itemData.ItemProperty3, string.IsNullOrEmpty(_itemData.ItemProperty4) ? "0" : _itemData.ItemProperty4, string.IsNullOrEmpty(_itemData.ItemProperty5) ? "0" : _itemData.ItemProperty5, string.IsNullOrEmpty(_itemData.ItemProperty6) ? "0" : _itemData.ItemProperty6, string.IsNullOrEmpty(_itemData.ItemProperty7) ? "0" : _itemData.ItemProperty7, string.IsNullOrEmpty(_itemData.ItemProperty8) ? "0" : _itemData.ItemProperty8, string.IsNullOrEmpty(_itemData.ItemProperty9) ? "0" : _itemData.ItemProperty9, string.IsNullOrEmpty(_itemData.ItemProperty10) ? "0" : _itemData.ItemProperty10, string.IsNullOrEmpty(_itemData.ItemProperty11) ? "0" : _itemData.ItemProperty11, string.IsNullOrEmpty(_itemData.ItemProperty12) ? "0" : _itemData.ItemProperty12, string.IsNullOrEmpty(_itemData.ItemProperty13) ? "0" : _itemData.ItemProperty13, string.IsNullOrEmpty(_itemData.ItemProperty14) ? "0" : _itemData.ItemProperty14); dtoItemModify.Name = strbCombName.ToString(); //dtoItemModify.Name = _itemData.ItemName;//测试 #region DescFlexField;扩展字段 DescFlexSegments segments = dtoItemModify.DescFlexField; segments.SetValue("PrivateDescSeg5", _itemData.ItemDescSeg5); segments.SetValue("PrivateDescSeg6", _itemData.ItemDescSeg6); segments.SetValue("PrivateDescSeg7", _itemData.ItemDescSeg7); segments.SetValue("PrivateDescSeg8", _itemData.ItemDescSeg8); segments.SetValue("PrivateDescSeg9", _itemData.ItemDescSeg9); segments.SetValue("PrivateDescSeg10", _itemData.ItemDescSeg10); #endregion //无料品版本处理 } return(dtoItemModify); }
private BaseItemModel GetNewItemByType(ItemTypeEnum itemType) { BaseItemModel result = null; switch (itemType) { case ItemTypeEnum.Author: result = new AuthorItemModel(); break; case ItemTypeEnum.Book: result = new BookItemModel(); break; case ItemTypeEnum.Serie: result = new SerieItemModel(); break; case ItemTypeEnum.Review: result = new ReviewItemModel(); break; } return result; }
public Weapon(int damage, WeaponEnum weaponType, int id, string name, ItemTypeEnum itemType, ItemQuality quality, string des, int capa, int buy, int sale, string sprite) : base(id, name, itemType, quality, des, capa, buy, sale, sprite) { this.Damage = damage; this.WeaponType = weaponType; }
public CatalogItemBuilder WithType(ItemTypeEnum type) { _type = type; return this; }
/// <summary> /// Initializes a new instance of the <see cref="CatalogItemReference" /> class. /// </summary> /// <param name="item">Details of the referenced {Flipdish.PublicModels.V1.Catalog.Items.CatalogItem}.</param> /// <param name="catalogItemId">Identifier of the CatalogItemId to use as SubProduct (required).</param> /// <param name="itemType">Type of the SupProduct (required).</param> /// <param name="preselectedQuantity">Quantity of the modifier that will be set when the parent product is placed in the basket.</param> public CatalogItemReference(CatalogItem item = default(CatalogItem), string catalogItemId = default(string), ItemTypeEnum itemType = default(ItemTypeEnum), int? preselectedQuantity = default(int?)) { // to ensure "catalogItemId" is required (not null) if (catalogItemId == null) { throw new InvalidDataException("catalogItemId is a required property for CatalogItemReference and cannot be null"); } else { this.CatalogItemId = catalogItemId; } // to ensure "itemType" is required (not null) if (itemType == null) { throw new InvalidDataException("itemType is a required property for CatalogItemReference and cannot be null"); } else { this.ItemType = itemType; } this.Item = item; this.PreselectedQuantity = preselectedQuantity; }
public List <BidHouseItem> GetBidHouseItems(ItemTypeEnum type, int maxItemLevel) => m_bidHouseItems.Where(x => x.Template.TypeId == (int)type && x.Template.Level <= maxItemLevel && !x.Sold) .GroupBy(x => x.Template.Id).Select(x => x.First()).ToList();
public Item(string itemId, ItemTypeEnum itemType) { ItemId = itemId; ItemType = itemType; }
public Consumable(int hp, int mp, int id, string name, ItemTypeEnum itemType, ItemQuality quality, string des, int capa, int buy, int sale, string sprite) : base(id, name, itemType, quality, des, capa, buy, sale, sprite) { this.Hp = hp; this.Mp = mp; }
public ModuleVMBase(Messenger messenger, SecondaryTile secondaryTile, ItemTypeEnum itemType) : this(messenger) { SecTile = secondaryTile; StartTileAdded = SecondaryTile.Exists(SecTile.TileId) ? true : false; ItemType = itemType; }
public override List <CatalogItem> GetItems(string folderName, ItemTypeEnum type) { List <CatalogItem> _items = new List <CatalogItem>(); string targetFolder = HttpContext.Current.Server.MapPath("~/") + @"Resources\demos\"; if (type == ItemTypeEnum.Folder || type == ItemTypeEnum.Report) { targetFolder = targetFolder + @"Report\"; if (!(string.IsNullOrEmpty(folderName) || folderName.Trim() == "/")) { targetFolder = targetFolder + folderName; } } if (type == ItemTypeEnum.DataSet) { foreach (var file in Directory.GetFiles(targetFolder + "DataSet")) { CatalogItem catalogItem = new CatalogItem(); catalogItem.Name = Path.GetFileNameWithoutExtension(file); catalogItem.Type = ItemTypeEnum.DataSet; catalogItem.Id = Regex.Replace(catalogItem.Name, @"[^0-9a-zA-Z]+", "_"); _items.Add(catalogItem); } } else if (type == ItemTypeEnum.DataSource) { foreach (var file in Directory.GetFiles(targetFolder + "DataSource")) { CatalogItem catalogItem = new CatalogItem(); catalogItem.Name = Path.GetFileNameWithoutExtension(file); catalogItem.Type = ItemTypeEnum.DataSource; catalogItem.Id = Regex.Replace(catalogItem.Name, @"[^0-9a-zA-Z]+", "_"); _items.Add(catalogItem); } } else if (type == ItemTypeEnum.Folder) { foreach (var file in Directory.GetDirectories(targetFolder)) { CatalogItem catalogItem = new CatalogItem(); catalogItem.Name = Path.GetFileNameWithoutExtension(file); catalogItem.Type = ItemTypeEnum.Folder; catalogItem.Id = Regex.Replace(catalogItem.Name, @"[^0-9a-zA-Z]+", "_"); _items.Add(catalogItem); } } else if (type == ItemTypeEnum.Report) { foreach (var file in Directory.GetFiles(targetFolder, "*.rdl")) { CatalogItem catalogItem = new CatalogItem(); catalogItem.Name = Path.GetFileNameWithoutExtension(file); catalogItem.Type = ItemTypeEnum.Report; catalogItem.Id = Regex.Replace(catalogItem.Name, @"[^0-9a-zA-Z]+", "_"); _items.Add(catalogItem); } } return(_items); }
public string CmdEnum1(ItemTypeEnum itemType) { return($"{itemType}"); }
public ItemType(ItemTypeEnum id, string name, string description) { this.Id = id; this.Name = name; this.Description = description; }
void grabObjt(ItemsSO _Scriptable) { itemType = _Scriptable.itemType; consumableType = _Scriptable.consumableType; activeName = _Scriptable.activeItemName; if (itemType == ItemTypeEnum.CacWeapon) { attackCaC.DamageCaC = _Scriptable.damageCac; attackCaC.impactTime = _Scriptable.ImpactTime; attackCaC.attackIntervale = _Scriptable.cooldownCac; imgCacWepon.sprite = _Scriptable.Artwork; imgCacWepon.rectTransform.sizeDelta = new Vector2(imgCacWepon.preferredWidth, imgCacWepon.preferredHeight); isUsed = true; } if (itemType == ItemTypeEnum.DistanceWeapon) { attackDist.DamageDist = _Scriptable.damageDistance; attackDist.bulletPrefab = _Scriptable.bulletPrefab; attackDist.shootIntervale = _Scriptable.weaponCooldownDistance; imgDistWeapon.sprite = _Scriptable.Artwork; imgDistWeapon.rectTransform.sizeDelta = new Vector2(imgDistWeapon.preferredWidth * 2, imgDistWeapon.preferredHeight * 2); isUsed = true; } if (itemType == ItemTypeEnum.ActiveItem) { activeObject.sprite = _Scriptable.Artwork; activeObject.rectTransform.sizeDelta = new Vector2(activeObject.preferredWidth * 2, activeObject.preferredHeight * 2); numberOfCharges = _Scriptable.numberOfCharges; chargeScript.chargesColor(); if (_Scriptable.colorBomb == true) { ColorBomb = true; musicBox = false; mirror = false; MGSBox = false; map = false; iceFlower = false; fatherWatch = false; chrono = false; spinach = false; Debug.Log("ColorBomb Taken"); } if (_Scriptable.chrono == true) { chrono = true; ColorBomb = false; musicBox = false; mirror = false; MGSBox = false; map = false; iceFlower = false; fatherWatch = false; spinach = false; } if (_Scriptable.fatherWatch == true) { ColorBomb = false; fatherWatch = true; musicBox = false; mirror = false; MGSBox = false; map = false; iceFlower = false; chrono = false; spinach = false; } if (_Scriptable.iceFlower == true) { ColorBomb = false; iceFlower = true; musicBox = false; mirror = false; MGSBox = false; map = false; fatherWatch = false; chrono = false; spinach = false; } if (_Scriptable.map == true) { ColorBomb = false; map = true; musicBox = false; mirror = false; MGSBox = false; iceFlower = false; fatherWatch = false; chrono = false; spinach = false; } if (_Scriptable.MGSBox == true) { ColorBomb = false; MGSBox = true; musicBox = false; mirror = false; map = false; iceFlower = false; fatherWatch = false; chrono = false; spinach = false; Debug.Log("CapeTaken"); } if (_Scriptable.mirror == true) { ColorBomb = false; mirror = true; musicBox = false; MGSBox = false; map = false; iceFlower = false; fatherWatch = false; chrono = false; spinach = false; } if (_Scriptable.musicBox == true) { ColorBomb = false; musicBox = true; mirror = false; MGSBox = false; map = false; iceFlower = false; fatherWatch = false; chrono = false; spinach = false; } if (_Scriptable.spinach == true) { spinach = true; ColorBomb = false; musicBox = false; mirror = false; MGSBox = false; map = false; iceFlower = false; fatherWatch = false; chrono = false; Debug.Log("Potiondeforce Taken"); } isUsed = true; } else if (itemType == ItemTypeEnum.Consumables) { if (consumableType == ConsumablesTypesEnum.Heal && health.PlayerLife != health.maxPlayerLife && _Scriptable.IsPermanent == false) { health.PlayerLife += _Scriptable.healingPoints; isUsed = true; } else if (consumableType == ConsumablesTypesEnum.Heal && _Scriptable.IsPermanent == true) { health.maxPlayerLife += _Scriptable.healingPoints; health.PlayerLife += _Scriptable.healingPoints; passiveObject[imgIndex].sprite = _Scriptable.Artwork; passiveObject[imgIndex].rectTransform.sizeDelta = new Vector2(passiveObject[imgIndex].preferredWidth * 2, passiveObject[imgIndex].preferredHeight * 2); imgIndex++; isUsed = true; } else if (consumableType == ConsumablesTypesEnum.Speed && _Scriptable.IsPermanent == false) { controller.moveSpeed *= _Scriptable.speedMultiplication; isUsed = true; } else if (consumableType == ConsumablesTypesEnum.Speed && _Scriptable.IsPermanent == true) { controller.moveSpeed *= _Scriptable.speedMultiplication; passiveObject[imgIndex].sprite = _Scriptable.Artwork; passiveObject[imgIndex].rectTransform.sizeDelta = new Vector2(passiveObject[imgIndex].preferredWidth * 2, passiveObject[imgIndex].preferredHeight * 2); imgIndex++; isUsed = true; } else if (consumableType == ConsumablesTypesEnum.Strengh && _Scriptable.IsPermanent == false) { attackCaC.DamageCaC *= _Scriptable.damageMultiplication; attackDist.DamageDist *= _Scriptable.damageMultiplication; isUsed = true; } else if (consumableType == ConsumablesTypesEnum.Strengh && _Scriptable.IsPermanent == true) { attackCaC.DamageCaC *= _Scriptable.damageMultiplication; attackDist.DamageDist *= _Scriptable.damageMultiplication; passiveObject[imgIndex].sprite = _Scriptable.Artwork; passiveObject[imgIndex].rectTransform.sizeDelta = new Vector2(passiveObject[imgIndex].preferredWidth * 2, passiveObject[imgIndex].preferredHeight * 2); imgIndex++; isUsed = true; } else if (consumableType == ConsumablesTypesEnum.Coin) { currentCoins += _Scriptable.coinValue; FindObjectOfType <AudioManager>().Play("LootGold"); isUsed = true; } } }
public List <IShoppingCart> GetShoppingCart(string sessionid, ItemTypeEnum iType, UserType uType) { ShoppingCartManager shoppingMag = new ShoppingCartManager(); return(shoppingMag.GetShoppingCart(sessionid, iType, uType)); }
public ItemUseAttribute(ItemTypeEnum type) { this.ItemType = type; }
public static ItemRecord RandomItem(ItemTypeEnum type) { return(GetItems(type).Random()); }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <returns></returns> public static ItemSlotEnum GetSlotByType(ItemTypeEnum type) { switch (type) { case ItemTypeEnum.TYPE_TRANSFORM: return(ItemSlotEnum.SLOT_BOOST_MUTATION); case ItemTypeEnum.TYPE_PERSO_SUIVEUR: return(ItemSlotEnum.SLOT_BOOST_FOLLOWER); case ItemTypeEnum.TYPE_BENEDICTION: return(ItemSlotEnum.SLOT_BOOST_BENEDICTION | ItemSlotEnum.SLOT_BOOST_BENEDICTION_1); case ItemTypeEnum.TYPE_MALEDICTION: return(ItemSlotEnum.SLOT_BOOST_MALEDICTION | ItemSlotEnum.SLOT_BOOST_MALEDICTION_1); case ItemTypeEnum.TYPE_RP_BUFF: return(ItemSlotEnum.SLOT_BOOST_ROLEPLAY_BUFF); case ItemTypeEnum.TYPE_BOOST_FOOD: return(ItemSlotEnum.SLOT_BOOST_FOOD); case ItemTypeEnum.TYPE_AMULETTE: return(ItemSlotEnum.SLOT_AMULET); case ItemTypeEnum.TYPE_ARC: case ItemTypeEnum.TYPE_BAGUETTE: case ItemTypeEnum.TYPE_BATON: case ItemTypeEnum.TYPE_DAGUES: case ItemTypeEnum.TYPE_EPEE: case ItemTypeEnum.TYPE_MARTEAU: case ItemTypeEnum.TYPE_PELLE: case ItemTypeEnum.TYPE_HACHE: case ItemTypeEnum.TYPE_OUTIL: case ItemTypeEnum.TYPE_PIOCHE: case ItemTypeEnum.TYPE_FAUX: case ItemTypeEnum.TYPE_PIERRE_AME: return(ItemSlotEnum.SLOT_WEAPON); case ItemTypeEnum.TYPE_ANNEAU: return(ItemSlotEnum.SLOT_RIGHT_RING | ItemSlotEnum.SLOT_LEFT_RING); case ItemTypeEnum.TYPE_CEINTURE: return(ItemSlotEnum.SLOT_BELT); case ItemTypeEnum.TYPE_BOTTES: return(ItemSlotEnum.SLOT_BOOTS); case ItemTypeEnum.TYPE_COIFFE: return(ItemSlotEnum.SLOT_HAT); case ItemTypeEnum.TYPE_CAPE: return(ItemSlotEnum.SLOT_CAPE); case ItemTypeEnum.TYPE_FAMILIER: return(ItemSlotEnum.SLOT_PET); case ItemTypeEnum.TYPE_DOFUS: return(ItemSlotEnum.SLOT_DOFUS_1 | ItemSlotEnum.SLOT_DOFUS_2 | ItemSlotEnum.SLOT_DOFUS_3 | ItemSlotEnum.SLOT_DOFUS_4 | ItemSlotEnum.SLOT_DOFUS_5 | ItemSlotEnum.SLOT_DOFUS_6); case ItemTypeEnum.TYPE_BOUCLIER: return(ItemSlotEnum.SLOT_SHIELD); } return(ItemSlotEnum.SLOT_INVENTORY); }
public static bool CanPlaceInSlot(ItemTypeEnum Type, ItemSlotEnum Slot) { switch (Type) { case ItemTypeEnum.ITEM_TYPE_AMULETTE: if (Slot == ItemSlotEnum.SLOT_AMULETTE) { return(true); } break; case ItemTypeEnum.ITEM_TYPE_ARC: case ItemTypeEnum.ITEM_TYPE_BAGUETTE: case ItemTypeEnum.ITEM_TYPE_BATON: case ItemTypeEnum.ITEM_TYPE_DAGUES: case ItemTypeEnum.ITEM_TYPE_EPEE: case ItemTypeEnum.ITEM_TYPE_MARTEAU: case ItemTypeEnum.ITEM_TYPE_PELLE: case ItemTypeEnum.ITEM_TYPE_HACHE: case ItemTypeEnum.ITEM_TYPE_OUTIL: case ItemTypeEnum.ITEM_TYPE_PIOCHE: case ItemTypeEnum.ITEM_TYPE_FAUX: case ItemTypeEnum.ITEM_TYPE_PIERRE_AME: if (Slot == ItemSlotEnum.SLOT_ARME) { return(true); } break; case ItemTypeEnum.ITEM_TYPE_ANNEAU: if (Slot == ItemSlotEnum.SLOT_ANNEAU_D || Slot == ItemSlotEnum.SLOT_ANNEAU_G) { return(true); } break; case ItemTypeEnum.ITEM_TYPE_CEINTURE: if (Slot == ItemSlotEnum.SLOT_CEINTURE) { return(true); } break; case ItemTypeEnum.ITEM_TYPE_BOTTES: if (Slot == ItemSlotEnum.SLOT_BOTTES) { return(true); } break; case ItemTypeEnum.ITEM_TYPE_COIFFE: if (Slot == ItemSlotEnum.SLOT_COIFFE) { return(true); } break; case ItemTypeEnum.ITEM_TYPE_CAPE: if (Slot == ItemSlotEnum.SLOT_CAPE) { return(true); } break; case ItemTypeEnum.ITEM_TYPE_FAMILIER: if (Slot == ItemSlotEnum.SLOT_FAMILIER) { return(true); } break; case ItemTypeEnum.ITEM_TYPE_DOFUS: if (Slot == ItemSlotEnum.SLOT_DOFUS_1 || Slot == ItemSlotEnum.SLOT_DOFUS_2 || Slot == ItemSlotEnum.SLOT_DOFUS_3 || Slot == ItemSlotEnum.SLOT_DOFUS_4 || Slot == ItemSlotEnum.SLOT_DOFUS_5 || Slot == ItemSlotEnum.SLOT_DOFUS_6) { return(true); } break; case ItemTypeEnum.ITEM_TYPE_BOUCLIER: if (Slot == ItemSlotEnum.SLOT_BOUCLIER) { return(true); } break; } return(false); }
/// <summary> /// Checks if an item of the specified type exists at path. /// </summary> /// <param name="reportingService">The reporting service.</param> /// <param name="path">The path.</param> /// <param name="itemType">Type of the item.</param> /// <returns></returns> /// <exception cref="System.ArgumentNullException">reportingService</exception> private static bool ItemExists(ReportingService2005 reportingService, string path, ItemTypeEnum itemType) { if (reportingService == null) throw new ArgumentNullException("reportingService"); ItemTypeEnum actualItemType = reportingService.GetItemType(path); if (itemType == actualItemType) return true; else return false; }
public static AvailableListing CreateAvailableListing(ApplicationDbContext db, IPrincipal user, string itemDescription, ItemCategoryEnum itemCategory, ItemTypeEnum itemType, decimal quantityRequired, string uom, DateTime?availableFrom, DateTime?availableTo, ItemConditionEnum itemCondition, DateTime?displayUntilDate, DateTime?sellByDate, DateTime?useByDate, bool?deliveryAvailable, ItemRequiredListingStatusEnum listingStatus) { BranchUser branchUser = BranchUserHelpers.GetBranchUserCurrentForUser(db, user); Branch branch = BranchHelpers.GetBranch(db, branchUser.BranchId); AvailableListing AvailableListing = new AvailableListing() { ListingId = Guid.NewGuid(), ItemDescription = itemDescription, ItemCategory = itemCategory, ItemType = itemType, QuantityRequired = quantityRequired, QuantityFulfilled = 0, QuantityOutstanding = quantityRequired, UoM = uom, AvailableFrom = availableFrom, AvailableTo = availableTo, ItemCondition = itemCondition, DisplayUntilDate = displayUntilDate, SellByDate = sellByDate, UseByDate = useByDate, DeliveryAvailable = deliveryAvailable ?? false, ListingBranchPostcode = branch.AddressPostcode, ListingOriginatorAppUserId = branchUser.UserId, ListingOriginatorBranchId = branchUser.BranchId, ListingOriginatorCompanyId = branchUser.CompanyId, ListingOriginatorDateTime = DateTime.Now, ListingStatus = ItemRequiredListingStatusEnum.Open }; db.AvailableListings.Add(AvailableListing); db.SaveChanges(); return(AvailableListing); }
public PageViewAttribute(ItemTypeEnum itemType = ItemTypeEnum.Book, string foreighIdName = "id") { _itemType = itemType; _foreighIdName = foreighIdName; }
public double SetItemRating(Guid itemId, ItemTypeEnum itemType, short ratingValue) { var result = DoSetRating(itemId, (Guid)User.UserId, itemType, ratingValue); return result.Value; }
public static RequirementListing CreateRequirementListing(IPrincipal user, string itemDescription, ItemCategoryEnum itemCategory, ItemTypeEnum itemType, decimal quantityRequired, string uom, DateTime?requiredFrom, DateTime?requiredTo, bool acceptDamagedItems, bool acceptOutOfDateItems, bool collectionAvailable, ItemRequiredListingStatusEnum listingStatus, Guid?selectedCampaignId) { ApplicationDbContext db = new ApplicationDbContext(); RequirementListing newRequirementListing = CreateRequirementListing(db, user, itemDescription, itemCategory, itemType, quantityRequired, uom, requiredFrom, requiredTo, acceptDamagedItems, acceptOutOfDateItems, collectionAvailable, listingStatus, selectedCampaignId); db.Dispose(); return(newRequirementListing); }
private RatingModel DoSetRating(Guid itemId, Guid userId, ItemTypeEnum itemType, short ratingValue) { var result = DataService.SetRating(itemId, userId, ratingValue, itemType); if (itemType == ItemTypeEnum.Book) { DataService.SetUserStatToBook(itemId, (Guid)User.UserId, UserStatStateEnum.Read); _socialService.RateBook((Guid)User.UserId, Request.Url.GetRootUrl() + Url.Action("Book", "Catalogue", new { id = itemId }), ratingValue); } return result; }
public static RequirementListing CreateRequirementListing(ApplicationDbContext db, IPrincipal user, string itemDescription, ItemCategoryEnum itemCategory, ItemTypeEnum itemType, decimal quantityRequired, string uom, DateTime?requiredFrom, DateTime?requiredTo, bool acceptDamagedItems, bool acceptOutOfDateItems, bool collectionAvailable, ItemRequiredListingStatusEnum listingStatus, Guid?selectedCampaignId) { BranchUser branchUser = BranchUserHelpers.GetBranchUserCurrentForUser(db, user); Branch branch = BranchHelpers.GetBranch(db, branchUser.BranchId); RequirementListing requirementListing = new RequirementListing() { ListingId = Guid.NewGuid(), ItemDescription = itemDescription, ItemCategory = itemCategory, ItemType = itemType, QuantityRequired = quantityRequired, QuantityFulfilled = 0, QuantityOutstanding = quantityRequired, UoM = uom, RequiredFrom = requiredFrom, RequiredTo = requiredTo, AcceptDamagedItems = acceptDamagedItems, AcceptOutOfDateItems = acceptOutOfDateItems, CollectionAvailable = collectionAvailable, ListingBranchPostcode = branch.AddressPostcode, ListingOriginatorAppUserId = branchUser.UserId, ListingOriginatorBranchId = branchUser.BranchId, ListingOriginatorCompanyId = branchUser.CompanyId, ListingOriginatorDateTime = DateTime.Now, ListingStatus = ItemRequiredListingStatusEnum.Open, CampaignId = selectedCampaignId }; db.RequirementListings.Add(requirementListing); db.SaveChanges(); return(requirementListing); }
/// <summary> /// Helper that takes in a ItemTypeEnum to return the default base version of that type /// </summary> /// <param name="type"></param> public static ItemModel DefaultItem(ItemTypeEnum type) { switch (type) { case ItemTypeEnum.Earplugs: return(DefaultEarplugs()); case ItemTypeEnum.Earmuffs: return(DefaultEarmuffs()); case ItemTypeEnum.NoiseCancelingHeadphones: return(DefaultNoiseCancelingHeadphones()); case ItemTypeEnum.Microphone: return(DefaultMicrophone()); case ItemTypeEnum.Coffee: return(DefaultCoffee()); case ItemTypeEnum.EnergyDrink: return(DefaultEnergyDrink()); case ItemTypeEnum.Metronome: return(DefaultMetronome()); case ItemTypeEnum.TuningFork: return(DefaultTuningFork()); case ItemTypeEnum.BandTshirt: return(DefaultBandTShirt()); case ItemTypeEnum.BandHoodie: return(DefaultBandHoodie()); case ItemTypeEnum.CoolOutfit: return(DefaultCoolOutfit()); case ItemTypeEnum.Ring: return(DefaultRing()); case ItemTypeEnum.MoodRing: return(DefaultMoodRing()); case ItemTypeEnum.TemporaryTattoo: return(DefaultTemporaryTattoo()); case ItemTypeEnum.AthleticSocks: return(DefaultAthleticSocks()); case ItemTypeEnum.LuckySocks: return(DefaultLuckySocks()); case ItemTypeEnum.ComfySneakers: return(DefaultComfySneakers()); case ItemTypeEnum.BunnySlippers: return(DefaultBunnySlippers()); case ItemTypeEnum.Triangle: return(DefaultTriangle()); case ItemTypeEnum.PrankDoorbell: return(DefaultPrankDoorbell()); case ItemTypeEnum.WhoopeeCushion: return(DefaultWhoopeeCushion()); case ItemTypeEnum.Vuvuzela: return(DefaultVuvuzela()); case ItemTypeEnum.Ocarina: return(DefaultOcarina()); case ItemTypeEnum.Bagpipe: return(DefaultBagpipe()); case ItemTypeEnum.Banjo: return(DefaultBanjo()); case ItemTypeEnum.Keytar: return(DefaultKeytar()); case ItemTypeEnum.GoldenRecorder: return(DefaultGoldenRecorder()); case ItemTypeEnum.RockOck: return(DefaultRockOck()); case ItemTypeEnum.Glockenspiel: return(DefaultGlockenspiel()); case ItemTypeEnum.Theremin: return(DefaultTheremin()); case ItemTypeEnum.DidgeridooOfDestruction: return(DefaultDidgeridooOfDestruction()); default: return(DefaultEarplugs()); } }
public ItemGenerationAttribute(ItemTypeEnum type) { this.Type = type; }
public ActionResult MyThings(ItemTypeEnum itemType) { UserIncomesModel model = DataService.GetUserIncomes((Guid)User.UserId, itemType); return View(model); }
public IList<SearchSuggestionApiModel> GetSearchSuggestions(string searchText, int expectedRowsCount, ItemTypeEnum? itemType = null) { using (Entities context = GetContext()) { List<LuceneResultModel> results = SearchService.GetSearchResults(searchText, itemType) .OrderByDescending(t => t.Score) .Take(expectedRowsCount).ToList(); List<Guid> mix; if (itemType == ItemTypeEnum.Serie) { mix = results.Where(r => r.Type == ItemTypeEnum.Serie).Select(r => r.Id).ToList(); IQueryable<Serie> serieQuery = context.Series.Where(ar => mix.Contains(ar.SerieId)); List<SerieItemModel> series = GetSearchSuggestionSeriesQuery(serieQuery).ToList(); List<SearchSuggestionApiModel> seriesResult = series.Select(a => new SearchSuggestionApiModel { Id = a.Id.ToString(), Type = ItemTypeEnum.Author, Title = a.Name, Rating = a.Rating.Value, HasImage = a.HasImage, Score = results.Where(r => r.Id == a.Id).Select(r => r.Score).FirstOrDefault() }).ToList(); return seriesResult.OrderByDescending(a => a.Score).ToList(); } mix = results.Where(r => r.Type == ItemTypeEnum.Book).Select(r => r.Id).ToList(); IQueryable<Book> booksQuery = context.Books.Where(br => mix.Contains(br.BookId)); List<BookItemModel> books = GetSearchSuggestionBooksQuery(booksQuery).ToList(); List<SearchSuggestionApiModel> booksResult = books.Select(b => new SearchSuggestionApiModel { Id = b.Id.ToString(), Type = ItemTypeEnum.Book, Title = b.Name, Authors = b.Authors.Select(a => a.Name), Rating = b.Rating.Value, HasImage = b.HasImage, Score = results.Where(r => r.Id == b.Id).Select(r => r.Score).FirstOrDefault() }).ToList(); mix = results.Where(r => r.Type == ItemTypeEnum.Author).Select(r => r.Id).ToList(); IQueryable<Author> authorsQuery = context.Authors.Where(ar => mix.Contains(ar.AuthorId)); List<AuthorItemModel> authors = GetSearchSuggestionAuthorsQuery(authorsQuery).ToList(); List<SearchSuggestionApiModel> authorsResult = authors.Select(a => new SearchSuggestionApiModel { Id = a.Id.ToString(), Type = ItemTypeEnum.Author, Title = a.Name, BornYear = a.BornYear, DeathYear = a.DeathYear, Rating = a.Rating.Value, HasImage = a.HasImage, Score = results.Where(r => r.Id == a.Id).Select(r => r.Score).FirstOrDefault() }).ToList(); IEnumerable<SearchSuggestionApiModel> result = authorsResult .Union(booksResult); result = result.OrderByDescending(a => a.Score); return result.ToList(); } }