Beispiel #1
0
 public ChangeOrder(object key, object projectKey, 
     int number) : base(key)
 {
     this.projectKey = projectKey;
     this.number = number;
     this.effectiveDate = DateTime.Now;
     this.contractor = null;
     this.description = string.Empty;
     this.changeType = null;
     this.priceChangeDirection = ChangeDirection.Unchanged;
     this.previousAuthorizedAmount = null;
     this.previousTimeChangedTotal = null;
     this.amountChanged = 0;
     this.timeChangeDirection = ChangeDirection.Unchanged;
     this.timeChanged = 0;
     this.routingItems = new List<RoutingItem>();
     this.status = null;
     this.agencyApprovedDate = null;
     this.dateToField = null;
     this.ownerSignatureDate = null;
     this.architectSignatureDate = null;
     this.contractorSignatureDate = null;
     this.numberSpecification =
         new NumberSpecification<ChangeOrder>();
     this.descriptionSpecification = new DescriptionSpecification<ChangeOrder>();
     this.ValidateInitialization();
 }
 public RequestForInformation(object key, object projectKey, 
     int number) : base(key, projectKey)
 {
     this.number = number;
     this.from = null;
     this.dateReceived = null;
     this.dateRequestedBy = null;
     this.contractor = null;
     this.specSection = null;
     this.question = string.Empty;
     this.description = string.Empty;
     this.contractorProposedSolution = string.Empty;
     this.change = false;
     this.cause = 0;
     this.origin = 0;
     this.status = null;
     this.dateToField = null;
     this.shortAnswer = string.Empty;
     this.longAnswer = string.Empty;
     this.remarks = string.Empty;
     this.numberSpecification = new NumberSpecification<RequestForInformation>();
     this.dateToFieldSpecification = new RequestForInformationDateSpecification();
     this.questionAnswerSpecification = new RequestForInformationQuestionAnswerSpecification();
     this.ValidateInitialization();
 }
Beispiel #3
0
 public Story(string text, int points, ItemStatus status, IEnumerable<Task> tasks, IEnumerable<AcceptanceCriterion> acceptanceCriteria)
 {
     Text = text;
     Points = points;
     Status = status;
     Tasks = tasks;
     AcceptanceCriteria = acceptanceCriteria;
 }
Beispiel #4
0
        internal static ItemStatusEntity ItemStatus(ItemStatus ent)
        {
            ItemStatusEntity data = new ItemStatusEntity();

            data.itemStatusId = ent.Id;
            data.status = ent.Status;
            data.updateTimestamp = ent.UpdateTimestamp;
            data.updatePersonFK = ent.UpdatePersonFK;

            return data;
        }
Beispiel #5
0
        internal static ItemStatus ItemStatus(ItemStatusEntity data)
        {
            ItemStatus ent = new ItemStatus();

            ent.Id = data.itemStatusId;
            ent.Status = data.status;
            ent.UpdateTimestamp = data.updateTimestamp;
            ent.UpdatePersonFK = data.updatePersonFK;

            return ent;
        }
 public ItemViewModel(string description, int quantity, ItemStatus status, Category category)
 {
     this.description = description;
     this.quant = quantity;
     this.status = status;
     if (category == null)
     {
         this.category = new Category() { Title = "No Category", DisplayOrder = -1 };
     }
     else
     {
         this.category = category;
     }
 }
        //        public static string ListKindToString (ListKind kind) {
        //            switch (kind) {
        //            case ListKind.Directory:
        //                return "directory";
        //            case ListKind.File:
        //                return "file";
        //            case ListKind.Symlink:
        //                return "symlink";
        //            }// switch
        //
        //            return string.Empty;
        //        }// ListKindToString
        public static RevisionAction ConvertAction(ItemStatus status)
        {
            switch (status) {
                case ItemStatus.Added:
                    return RevisionAction.Add;
                case ItemStatus.Modified:
                    return RevisionAction.Modify;
                case ItemStatus.Deleted:
                    return RevisionAction.Delete;
                case ItemStatus.Replaced:
                    return RevisionAction.Replace;
            }// switch

            return RevisionAction.Other;
        }
        public static void SaveTransHis(VehicleDataContext dc, ItemInstance ItemIns, DateTime txtime, ItemStatus TransType, int cusPayType, decimal ActualCost, string Modifiefby, string OlderEngine,string from, string to)
        {
            var th = new SaleTransHistory();

            th.ActualCost = ActualCost;
            th.ReferenceOrderId = 0;
            th.FromBranch = from;
            th.ToBranch = to;
            th.ModifiedDate = DateTime.Now;
            th.ItemInstance = ItemIns;
            th.TransactionDate = txtime;
            th.TransactionType = (int)TransType;
            th.ModifiedBy = Modifiefby;
            th.OldEngineNo = (OlderEngine == null) ? null : OlderEngine;

            dc.SaleTransHistories.InsertOnSubmit(th);
        }
Beispiel #9
0
 public void OrderGetAll()
 {
     DataBase dataBase = new DataBase();
     string itemTypeName = Guid.NewGuid().ToString();
     ItemType itemType = new ItemType {Name = itemTypeName,};
     dataBase.ItemTypeInsert(itemType);
     ItemType itemTypeGet = dataBase.ItemTypeGet(itemTypeName);
     Assert.IsNotNull(itemTypeGet);
     string itemName = Guid.NewGuid().ToString();
     Item item = new Item
                 {
                     Name = itemName,
                     ItemTypeId = itemTypeGet.Id,
                 };
     dataBase.ItemInsert(item);
     Item itemGet = dataBase.ItemGet(itemName);
     Assert.IsNotNull(itemGet);
     string itemStatusName = Guid.NewGuid().ToString();
     ItemStatus itemStatus = new ItemStatus {Name = itemStatusName};
     dataBase.ItemStatusInsert(itemStatus);
     ItemStatus itemStatusGet = dataBase.ItemStatusGet(itemStatusName);
     Assert.IsNotNull(itemStatusGet);
     string personInfoName = Guid.NewGuid().ToString();
     string personInfoSurName = Guid.NewGuid().ToString();
     PersonInfo personInfo = new PersonInfo {Name = personInfoName, SurName = personInfoSurName,};
     dataBase.PersonInfoInsert(personInfo);
     PersonInfo personInfoGet = dataBase.PersonInfoGet(personInfoName, personInfoSurName);
     Assert.IsNotNull(personInfoGet);
     Order order = new Order
                   {
                       ItemId = itemGet.Id,
                       Count = 1,
                       ItemStatusId = itemStatusGet.Id,
                       LegalEntity = true,
                       PersonInfoId = personInfoGet.Id,
                       Postage = 0M.DecimalToString(),
                       Price = 1M.DecimalToString(),
                       BankId = -1,
                   };
     int rowsInserted = dataBase.OrderInsert(order);
     Assert.AreEqual(1, rowsInserted);
     List<Order> orders = dataBase.OrderGetAll();
     Assert.IsNotNull(orders);
     Order find = orders.Find(o => o.ItemId == itemGet.Id);
     Assert.IsNotNull(find);
 }
Beispiel #10
0
 public Submittal(object key, SpecificationSection specSection, 
     object projectKey) : base(key, projectKey)
 {
     this.specSection = specSection;
     this.specSectionPrimaryIndex = "01";
     this.specSectionSecondaryIndex = "00";
     this.to = null;
     this.from = null;
     this.dateReceived = null;
     this.contractNumber = string.Empty;
     this.trackingItems = new List<TrackingItem>();
     this.remarks = string.Empty;
     this.action = ActionStatus.NoExceptionTaken;
     this.status = null;
     this.dateToField = null;
     this.remainderLocation = SubmittalRemainderLocation.None;
     this.remainderUnderSubmittalNumber = string.Empty;
     this.otherRemainderLocation = string.Empty;
     this.ValidateInitialization();
 }
        public static ItemInstance UpdateItemInstance(VehicleDataContext dc, string engineNo, ItemStatus action, DateTime adjustDate, int price, int paymentType, string toBranch)
        {
            if (action != ItemStatus.Sold && action != ItemStatus.Moved)
                return null;

            var instance = dc.ItemInstances.SingleOrDefault(i => i.EngineNumber == engineNo);
            if (instance != null)
            {
                if (action == ItemStatus.Sold)
                    instance.Status = (int)ItemStatus.Sold;
                instance.ReleasedDate = adjustDate;
                // Save transaction
                ItemInstanceHelper2.SaveTransHis(dc, instance, adjustDate, action, paymentType, price, UserHelper.Username, null, string.Format("{0}-{1}", UserHelper.DealerCode, instance.BranchCode), toBranch);
                // Save inventory day
                InventoryHelper2.SaveInventoryDay(dc, instance.Item.ItemCode, adjustDate, -1, (int)action, UserHelper.DealerCode, instance.BranchCode);

                if (!string.IsNullOrEmpty(toBranch))
                {
                    ItemInstanceHelper2.SaveTransHis(dc, instance, adjustDate, ItemStatus.Imported, paymentType, price, UserHelper.Username, null, string.Format("{0}-{1}", UserHelper.DealerCode, instance.BranchCode), null);
                    InventoryHelper2.SaveInventoryDay(dc, instance.Item.ItemCode, adjustDate, 1, (int)ItemStatus.Imported, UserHelper.DealerCode, toBranch);
                }
            }
            return instance;
        }
Beispiel #12
0
    public override void UpdateMemory(MemoryGraph memoryGraph, MemoryGraphNode retainedMemory, MemoryCue memCue, float UpdateFrequency)
    {
        ItemCue itemInfo = (ItemCue)memCue;

        status = itemInfo.Status;
        owner = itemInfo.Owner;
        durability = itemInfo.Durability;

        if (durability < 0.0f)
        {
            //Once durability starts to fall, a agent's affinity with an item will also drop.
            memoryGraph.UpdateCueOpinion(retainedMemory.MemoryNode, -UpdateFrequency);
        }

        base.UpdateMemory(memoryGraph, retainedMemory, memCue, UpdateFrequency);

        if (UpdateFrequency <= 0.0f || itemInfo.Owner == null)    //We want to strengthen the memory between the specific item and the place it has been observed.
            return;

        MemoryGraphNode charNode;
        if (memoryGraph.Contains(itemInfo.Owner.UniqueNodeID))
            charNode = memoryGraph.GetNamedNodeFromGraph(itemInfo.Owner.UniqueNodeID);
        else
            charNode = memoryGraph.AddNamedNodeToGraph(new CharacterNode(itemInfo.Owner));

        //First make a connection between the character and the item.
        int index = charNode.Neighbours.IndexOf(retainedMemory);
        if (index == -1)
            memoryGraph.AddDirectedEdge(charNode, retainedMemory, UpdateFrequency, UpdateFrequency);
        else
        {
            //Strengthing the memory based on the length of time it was active in the working set.
            charNode.StrengthenMemory(index, UpdateFrequency);
            //charNode.OpinionStrengths[index] += UpdateFrequency;
        }

        //Then between the item and the character.
        index = retainedMemory.Neighbours.IndexOf(charNode);
        if (index == -1)
            memoryGraph.AddDirectedEdge(retainedMemory, charNode, UpdateFrequency, UpdateFrequency);
        else
        {
            //Strengthing the memory based on the length of time it was active in the working set.
            retainedMemory.StrengthenMemory(index, UpdateFrequency);
            //retainedMemory.OpinionStrengths[index] += UpdateFrequency;
        }
    }
Beispiel #13
0
 public ItemNode(ItemCue itemInfo)
     : base(itemInfo, MemoryType.Item)
 {
     status = itemInfo.Status;
     owner = itemInfo.Owner;
     durability = itemInfo.Durability;
 }
Beispiel #14
0
 public PaintLink(string itemname, ItemStatus itemstatus, Point itemlocate, Pen itemPen, Font itemFont)
 {
     m_itemname = itemname;
     m_itemstatus = itemstatus;
     m_itemlocate = itemlocate;
     m_itemFont = itemFont;
 }
Beispiel #15
0
 public PaintUnit(string itemname, Image itemImage, ItemStatus itemstatus, Point itemlocate,Pen itemPen,Font itemFont)
 {
     m_itemname = itemname;
     m_itemImage = itemImage;
     m_itemstatus = itemstatus;
     m_itemlocate = itemlocate;
     m_itemFont = itemFont;
 }
        /// <summary>
        /// Convert an ItemStatus to a VersionStatus
        /// </summary>
        private VersionStatus ConvertStatus(ItemStatus status)
        {
            switch (status) {
                case ItemStatus.Added:
                    return VersionStatus.Versioned | VersionStatus.ScheduledAdd;
                case ItemStatus.Conflicted:
                    return VersionStatus.Versioned | VersionStatus.Conflicted;
                case ItemStatus.Deleted:
                    return VersionStatus.Versioned | VersionStatus.ScheduledDelete;
                case ItemStatus.Ignored:
                    return VersionStatus.Versioned | VersionStatus.Ignored;
                case ItemStatus.Modified:
                    return VersionStatus.Versioned | VersionStatus.Modified;
                case ItemStatus.Replaced:
                    return VersionStatus.Versioned | VersionStatus.ScheduledReplace;
                case ItemStatus.Unchanged:
                    return VersionStatus.Versioned;
            }

            return VersionStatus.Unversioned;
        }
        private List<ItemStatus> CheckItemStatus(bool forceUpdate)
        {
            var itemList = new List<ItemStatus>();
              foreach (var sec in launcher.GetApplicableSections("SteamWorkshop"))
              {
            var items = sec.GetAll("Item");
            foreach (var item in items)
            {
              if (item.Operator == ":=" || item.Operator == "!=")
              {
            itemList.Clear();
            continue;
              }

              var newStatus = new ItemStatus(item.Value, launcher.WorkshopFolder, forceUpdate);
              var oldStatus = itemList.FirstOrDefault(e => e.FolderName == newStatus.FolderName);
              if (oldStatus != null)
              {
            if (item.Operator == "-=")
              itemList.Remove(oldStatus);
            continue;
              }

              itemList.Add(newStatus);
            }
              }
              return itemList;
        }
Beispiel #18
0
 public static Entity.SaleTransHistory SaveTransHist(VehicleDataContext db, ItemInstance IInst, DateTime tranDate, ItemStatus status, long ActualCost, string dCode, string bCode)
 {
     var transHis = new SaleTransHistory
                        {
                            ActualCost = ActualCost,
                            FromBranch = "",
                            ToBranch = string.Format("{0}-{1}", dCode, bCode),
                            ModifiedDate = DateTime.Now,
                            ItemInstance = IInst,
                            TransactionDate = tranDate,
                            TransactionType = (int) status,
                            ModifiedBy = UserHelper.Username
                        };
     db.SaleTransHistories.InsertOnSubmit(transHis);
     return transHis;
 }
Beispiel #19
0
        /* tntung
         * 30/07/2007
         */
        public TransHis SaveTranHis(Iteminstance ItemIns, DateTime txtime, ItemStatus TransType, int cusPayType, decimal ActualCost, string Modifiefby, string OlderEngine,string from, string to)
        {
            TransHis tshx = new TransHis();

            tshx.Actualcost = ActualCost;
            tshx.Referenceorderid = 0;
            tshx.Frombranch = from;
            tshx.Tobranch = to;
            tshx.Modifieddate = DateTime.Now;
            tshx.Iteminstance = ItemIns;
            tshx.Transactiondate = txtime;
            tshx.Transactiontype = (int)TransType;
            tshx.Modifiedby = Modifiefby;
            tshx.Oldengineno = (OlderEngine == null) ? null : OlderEngine;
            return tshx;
        }
Beispiel #20
0
 public void UpdateItemStatus()
 {
     DataBase dataBase = new DataBase();
     string name = Guid.NewGuid().ToString();
     ItemStatus itemStatus = new ItemStatus
                             {
                                 Name = name,
                                 Description = Guid.NewGuid().ToString(),
                             };
     int rowsInserted = dataBase.ItemStatusInsert(itemStatus);
     Assert.AreEqual(1, rowsInserted);
     List<ItemStatus> list = dataBase.ItemStatusGetAll();
     Assert.IsNotNull(list);
     ItemStatus find = list.Find(i => i.Name == name);
     Assert.IsNotNull(find);
     string newName = Guid.NewGuid().ToString();
     find.Name = newName;
     int rowsUpdated = dataBase.ItemStatusUpdate(find);
     Assert.AreEqual(1, rowsUpdated);
     ItemStatus updatedItemStatus = dataBase.ItemStatusGet(find.Id);
     Assert.AreEqual(newName, updatedItemStatus.Name);
     Assert.AreEqual(itemStatus.Description, updatedItemStatus.Description);
 }
Beispiel #21
0
 private static string SetUserItem(UserItemInfo userItem, string userID, ItemBaseInfo itemInfo, ItemStatus itemStatus, short itemLv)
 {
     string uitemID = System.Guid.NewGuid().ToString();
     userItem.UserItemID = uitemID;
     userItem.ItemID = itemInfo.ItemID;
     userItem.ItemStatus = itemStatus;
     userItem.GeneralID = itemStatus == ItemStatus.YongBing ? UserGeneral.MainID : 0;
     userItem.ItemLv = itemLv;
     userItem.ItemType = itemInfo.ItemType;
     return uitemID;
 }
Beispiel #22
0
        /// <summary>
        /// 传入仓库或取出物品后合并物品
        /// </summary>
        public static void MergerUserItem(string userID, string userItemID, ItemStatus itemStatus)
        {
            var package = UserItemPackage.Get(userID);
            UserItemInfo userItem = package.ItemPackage.Find(m => !m.IsRemove && string.Equals(m.UserItemID, userItemID));
            if (userItem != null)
            {
                ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(userItem.ItemID);
                if (itemInfo == null) return;
                if (userItem.Num == itemInfo.PackMaxNum)
                {
                    userItem.ItemStatus = itemStatus;
                    package.SaveItem(userItem);
                }
                else
                {
                    int itemNum = userItem.Num;
                    var itemArray = package.ItemPackage.FindAll(u => !u.IsRemove && u.ItemID == userItem.ItemID && u.ItemStatus.Equals(itemStatus));
                    foreach (var item in itemArray)
                    {
                        if (item.Num < itemInfo.PackMaxNum)
                        {

                            int subNum = MathUtils.Subtraction(itemInfo.PackMaxNum, item.Num, 0);
                            item.Num = MathUtils.Addition(item.Num, itemNum, itemInfo.PackMaxNum);
                            itemNum = MathUtils.Subtraction(itemNum, subNum, 0);
                            package.SaveItem(item);
                            //item.Update();
                        }
                    }
                    if (itemNum > 0)
                    {
                        userItem.Num = itemNum;
                        userItem.ItemStatus = itemStatus;
                        package.SaveItem(userItem);
                    }
                    else
                    {
                        AddItemLog(userID, userItem.ItemID, itemNum, userItem.ItemLv, 7, userItemID);

                        package.RemoveItem(userItem);
                    }
                }
            }
        }
Beispiel #23
0
        /// <summary>
        /// 增加物品
        /// </summary>
        public static void AddUserItem(string userID, int itemID, int itemNum, ItemStatus itemStatus, short itemLv, List<UniversalInfo> universalInfoList = null)
        {
            // 增加玩家集邮册
            AddUserAlbum(userID,itemID);

            var chatService = new TjxChatService();
            GameUser user = new GameDataCacheSet<GameUser>().FindKey(userID);

            ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(itemID);
            if (user == null || itemInfo == null)
            {
                return;
            }
            AddUniversalInfo(universalInfoList, itemInfo, itemNum);

            if (itemInfo.ItemType == ItemType.DaoJu && itemInfo.PropType == 17)
            {
                for (int i = 0; i < itemNum; i++)
                {

                    if (!PackIsFull(userID, BackpackType.HunJi, 1))
                    {

                        AddUserAbility(itemInfo.EffectNum, userID.ToInt(), 0, 0);
                    }
                }

            }
            else
            {
                if (itemInfo.ItemType == ItemType.DaoJu && itemInfo.PropType == 20)
                {
                    AddGeneralSoul(userID, itemInfo.ItemID, itemNum);

                }
                else
                {
                    int gridMaxNum = 0;
                    if (itemInfo.ItemType == ItemType.ZhuangBei)
                    {
                        gridMaxNum = GetPackTypePositionNum(BackpackType.ZhuangBei, userID);
                    }
                    else
                    {
                        gridMaxNum = GetPackTypePositionNum(BackpackType.BeiBao, userID);
                    }
                    int packNum = itemNum / itemInfo.PackMaxNum;
                    int num = itemNum % itemInfo.PackMaxNum;
                    ////判断背包是否有空位
                    //bool isOut = false;
                    //if (itemStatus == ItemStatus.BeiBao)
                    //{
                    //    isOut = CheckItemOut(user, itemStatus);
                    //}

                    var package = UserItemPackage.Get(userID);
                    var itemList = package.ItemPackage.FindAll(m => !m.IsRemove && m.ItemStatus.Equals(ItemStatus.BeiBao));
                    //背包中是否有余
                    var packItemList = package.ItemPackage.FindAll(
                        m => !m.IsRemove && m.ItemStatus.Equals(itemStatus) &&
                             m.ItemID == itemID &&
                             m.Num < itemInfo.PackMaxNum);

                    //当前空位
                    int currGridNum = gridMaxNum - itemList.Count;
                    // if ((isOut && packItemList.Count == 0) || currGridNum < packNum)
                    if (packItemList.Count == 0 && currGridNum <= 0)
                    {
                        AddItemLog(userID, itemID, itemNum, 1, 0, null);
                        chatService.SystemSendWhisper(user, string.Format("掉落物品{0}*{1}", itemInfo.ItemName, itemNum));
                        return;
                    }
                    currGridNum = MathUtils.Subtraction(currGridNum, packNum, 0);

                    for (int i = 0; i < packNum; i++)
                    {
                        //增加整包
                        UserItemInfo userItem = new UserItemInfo();
                        string uitemID = SetUserItem(userItem, userID, itemInfo, itemStatus, itemLv);
                        userItem.Num = itemInfo.PackMaxNum;

                        package.SaveItem(userItem);
                        AddItemLog(userID, itemID, userItem.Num, userItem.ItemLv, 1, uitemID);
                    }
                    //背包中是否有余
                    foreach (var item in packItemList)
                    {
                        if (num == 0) break;

                        int gridNum = itemInfo.PackMaxNum - item.Num;
                        int tempNum = gridNum > num ? num : gridNum;

                        item.Num = MathUtils.Addition(item.Num, tempNum, itemInfo.PackMaxNum);

                        package.SaveItem(item);
                        num = num > tempNum ? num - tempNum : 0;
                    }
                    //数据是否有余
                    if (num > 0)
                    {
                        if (currGridNum <= 0)
                        {
                            AddItemLog(userID, itemInfo.ItemID, num, 1, 0, null);
                            chatService.SystemSendWhisper(user, string.Format("掉落物品{0}*{1}", itemInfo.ItemName, num));
                        }
                        else
                        {
                            var userItem = new UserItemInfo();
                            string uitemID = SetUserItem(userItem, userID, itemInfo, itemStatus, itemLv);
                            userItem.Num = num;
                            package.SaveItem(userItem);

                            AddItemLog(userID, itemID, userItem.Num, userItem.ItemLv, 1, uitemID);
                        }
                    }
                }
            }
        }
 public new void Initialize(String name, Vector2 position, int textureIndex)
 {
     currentDrawIndex = textureIndex;
     itemStatus = ItemStatus.OnFloor;
     base.Initialize(name, position);
 }
Beispiel #25
0
 public void InsertItemStatus()
 {
     DataBase dataBase = new DataBase();
     string itemStatusName = Guid.NewGuid().ToString();
     ItemStatus itemStatus = new ItemStatus {Name = itemStatusName, Description = "Description",};
     int rowsInserted = dataBase.ItemStatusInsert(itemStatus);
     Assert.AreEqual(1, rowsInserted, "Item status not inserted!");
 }
 public void UpdateOrderItemStatus(long orderId, long dishId, long providerId, ItemStatus targetStatus)
 {
     dbContext.ExecuteNonQuery("UpdateOrderItemStatus", Timeout, new[]
     {
         new SqlParameter("@orderId", SqlDbType.BigInt){ Value = orderId},
         new SqlParameter("@dishId", SqlDbType.BigInt){ Value = dishId},
         new SqlParameter("@providerId", SqlDbType.BigInt){ Value = providerId},
         new SqlParameter("@targetStatus", SqlDbType.Int){ Value = (int) targetStatus},
     });
 }
Beispiel #27
0
 public static bool IsInstock(ItemStatus status)
 {
     switch (status)
     {
         case ItemStatus.Imported:
         case ItemStatus.AdmitTemporarily:
         case ItemStatus.Redundant:
         case ItemStatus.Moved:
             return true;
         default:
             return false;
     }
 }
Beispiel #28
0
        private void AppenUserItem(ItemSynthesisInfo synthesisInfo, int ugeneralID, ItemStatus istatus, short itemLv)
        {
            //原因:合成黄色装备,物品存放为0
            if (istatus != ItemStatus.YongBing)
            {
                istatus = ItemStatus.BeiBao;
            }
            var package = UserItemPackage.Get(Uid);

            string uitemID = Guid.NewGuid().ToString();
            UserItemInfo userItem = new UserItemInfo()
            {
                UserItemID = uitemID,
                ItemID = synthesisInfo.ItemID,
                ItemLv = MathUtils.Subtraction(itemLv, (short)5, (short)1),
                ItemStatus = istatus,
                ItemType = ItemType.ZhuangBei,
                GeneralID = ugeneralID,
                Num = 1
            };
            package.SaveItem(userItem);
            //package.DelayChange();
            UserItemHelper.AddItemLog(ContextUser.UserID, synthesisInfo.ItemID, 1, MathUtils.Subtraction(itemLv, (short)5, (short)1), 5, uitemID);
        }
Beispiel #29
0
 // 19/11/2007
 public static string GetNativeItemStatusName(ItemStatus status)
 {
     switch (status)
     {
         case ItemStatus.Imported: return Constants.ItemStatus_Imported;
         case ItemStatus.AdmitTemporarily: return Constants.ItemStatus_AdmitTemporarily;
         case ItemStatus.Lacked: return Constants.ItemStatus_Lacked;
         case ItemStatus.Moved: return Constants.ItemStatus_Moved;
         case ItemStatus.Redundant: return Constants.ItemStatus_Redundant;
         case ItemStatus.Return: return Constants.ItemStatus_Return;
         case ItemStatus.Sold: return Constants.ItemStatus_Sold;
         default: return "";
     }
 }
Beispiel #30
0
 public static TransHis SaveTransHist(Iteminstance IInst, DateTime tranDate, ItemStatus status, long ActualCost, string dCode, string bCode)
 {
     IDao<TransHis, long> dao = DaoFactory.GetDao<TransHis, long>();
     TransHis transHis = new TransHis();
     transHis.Actualcost = ActualCost;
     transHis.Frombranch = "";
     transHis.Tobranch = string.Format("{0}-{1}", dCode, bCode);
     transHis.Modifieddate = DateTime.Now;
     transHis.Iteminstance = IInst;
     transHis.Transactiondate = tranDate;
     transHis.Transactiontype = (int)status;
     transHis.Modifiedby = UserHelper.Username;
     try
     {
         return dao.Save(transHis);
     }
     catch { return null; }
 }