Ejemplo n.º 1
0
 public ProductCategory(string name, ItemStatus status, string description, Guid parentId)
 {
     this.Name        = name;
     this.Status      = status;
     this.Description = description;
     this.ParentId    = parentId;
 }
        public void EqualsReturnsFalseForNonItemStatus()
        {
            var item1 = new ItemStatus();
            var item2 = "This is a test";

            Assert.IsFalse(item1.Equals(item2));
        }
Ejemplo n.º 3
0
        private bool AllowChange(ItemStatus oldStatus, ItemStatus newStatus)
        {
            if (oldStatus == ItemStatus.Available)
            {
                return(true);
            }
            if (oldStatus == ItemStatus.Borrowed && newStatus != ItemStatus.Available)
            {
                return(false);
            }
            if (oldStatus == ItemStatus.Broken && newStatus != ItemStatus.Available)
            {
                return(false);
            }
            if (oldStatus == ItemStatus.Reserved && (newStatus != ItemStatus.Borrowed && newStatus != ItemStatus.Available))
            {
                return(false);
            }
            if (oldStatus == ItemStatus.Disposed && newStatus != ItemStatus.Available)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 4
0
    public int GetEquipTypeAtkBuf(EquipItemInfo item)
    {
        int equipmentTypeIndex = MonoBehaviourSingleton <StatusManager> .I.GetEquipmentTypeIndex(item.tableData.type);

        int        elemAtkType = item.GetElemAtkType();
        int        num         = 0;
        ItemStatus itemStatus  = equipTypeBuff[equipmentTypeIndex];

        num += itemStatus.atk;
        switch (elemAtkType)
        {
        case -1:
        {
            int i = 0;
            for (int num2 = itemStatus.elemAtk.Length; i < num2; i++)
            {
                num += itemStatus.elemAtk[i];
            }
            break;
        }

        default:
            num += itemStatus.elemAtk[elemAtkType];
            break;

        case 6:
            break;
        }
        return(num);
    }
Ejemplo n.º 5
0
        /// <summary>
        /// Initialise an <see cref="ItemStatus"/>.
        /// </summary>
        /// <param name="newStatus">The new status.</param>
        public virtual void InitialiseStatus(ItemBuildStatus newStatus)
        {
            // Store the last elapsed time
            if (currentStatus != null)
            {
                var elapsedTime = currentStatus.TimeCompleted - currentStatus.TimeStarted;
                if (elapsedTime.HasValue)
                {
                    if (elapsedTimes.Count >= 8)
                    {
                        elapsedTimes.RemoveAt(7);
                    }
                    elapsedTimes.Insert(0, elapsedTime.Value);
                }
            }

            // Initialise the status with the default value - do not re-initialise if the status is already set
            if ((currentStatus == null) || (currentStatus.Status != newStatus))
            {
                currentStatus = new ItemStatus
                {
                    Name                      = Name,
                    Description               = Description,
                    Status                    = newStatus,
                    TimeCompleted             = null,
                    TimeOfEstimatedCompletion = null,
                    TimeStarted               = null
                };
            }
        }
Ejemplo n.º 6
0
    public ItemStatus[] GetEquipTypeSkillParam()
    {
        ItemStatus[] array = new ItemStatus[MonoBehaviourSingleton <StatusManager> .I.ENABLE_EQUIP_TYPE_MAX + 1];
        int          i     = 0;

        for (int num = array.Length; i < num; i++)
        {
            array[i] = new ItemStatus();
        }
        int j = 0;

        for (int maxSlot = GetMaxSlot(); j < maxSlot; j++)
        {
            SkillItemInfo skillItem = GetSkillItem(j);
            if (skillItem != null)
            {
                ENABLE_EQUIP_TYPE[] array2 = (ENABLE_EQUIP_TYPE[])Enum.GetValues(typeof(ENABLE_EQUIP_TYPE));
                int k = 0;
                for (int num2 = array2.Length; k < num2; k++)
                {
                    ItemStatus itemStatus = array[k];
                    ItemStatus param      = skillItem.GetEquipTypeSkillParam()[k];
                    itemStatus.Add(param);
                }
            }
        }
        return(array);
    }
        public void CloneGeneratesANewIdenticialInstance()
        {
            var item          = new ItemStatus();
            var theName       = "myItemName";
            var theDesc       = "A description";
            var theError      = "any error here";
            var theStatus     = ItemBuildStatus.CompletedFailed;
            var startTime     = new DateTime(2010, 1, 1, 12, 12, 12);
            var completedTime = new DateTime(2010, 1, 1, 13, 12, 12);
            var estimatedTime = new DateTime(2010, 1, 1, 14, 12, 12);
            var aChild        = new ItemStatus("aChild");

            item.Name                      = theName;
            item.Description               = theDesc;
            item.Error                     = theError;
            item.Status                    = theStatus;
            item.TimeStarted               = startTime;
            item.TimeCompleted             = completedTime;
            item.TimeOfEstimatedCompletion = estimatedTime;
            item.ChildItems.Add(aChild);
            var clone = item.Clone();

            Assert.AreEqual(theName, clone.Name);
            Assert.AreEqual(theDesc, clone.Description);
            Assert.AreEqual(theError, clone.Error);
            Assert.AreEqual(theStatus, clone.Status);
            Assert.AreEqual(startTime, clone.TimeStarted);
            Assert.AreEqual(completedTime, clone.TimeCompleted);
            Assert.AreEqual(estimatedTime, clone.TimeOfEstimatedCompletion);
            Assert.AreEqual(item.Identifier, clone.Identifier);
            Assert.AreEqual(1, clone.ChildItems.Count);
            Assert.AreEqual("aChild", clone.ChildItems[0].Name);
            Assert.AreEqual(aChild.Identifier, clone.ChildItems[0].Identifier);
        }
Ejemplo n.º 8
0
    private void OnTriggerStay2D(Collider2D other)
    {
        if (other.CompareTag("DestroyDetector"))
        {
            if (!_CanBeDetected || !StayDestroy)
            {
                return;
            }

            ItemStatus itemStatus = _myAncient.GetDetectedItemStatus();
            if (itemStatus.ItemState == GameItemState.StateFinished)
            {
                return;
            }

            m_StayTime -= Time.deltaTime;

            if (m_StayTime <= 0f)
            {
                if (itemStatus.ItemState - 1 < GameItemState.StateOne)
                {
                    _CanBeDetected = false;
                    m_StayTime     = 0;
                    return;
                }
                _myAncient.SetItemState(itemStatus.ItemState - 1);
                _myAncient.ChangeSprite();
                m_StayTime = StaticData.DestroyDuration;
            }
        }
    }
        public void GetHashCodeReturnsHashOfIdentifier()
        {
            var item = new ItemStatus();
            var hash = item.GetHashCode();

            Assert.AreEqual(item.Identifier.GetHashCode(), hash);
        }
Ejemplo n.º 10
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();
 }
Ejemplo n.º 11
0
        public static ItemStatus GetByID(int id)
        {
            DataTable  table  = new DataTable();
            ItemStatus status = null;

            OpenConn();
            try
            {
                NpgsqlCommand command = new NpgsqlCommand(null, dbConn);
                command.CommandText = "SELECT * FROM item_status WHERE id = " + id;
                NpgsqlDataAdapter Adpt = new NpgsqlDataAdapter(command);
                Adpt.Fill(table);

                if (table.Rows.Count > 0)
                {
                    foreach (DataRow dr in table.Rows)
                    {
                        status = new ItemStatus
                        {
                            Id        = Convert.ToInt32(dr["id"]),
                            Nome      = dr["nome"].ToString(),
                            Descricao = dr["descricao"].ToString()
                        };
                        dbConn.Close();
                        return(status);
                    }
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("INVENTARIO/ItemStatusDAO/GetAll:: " + e);
            }
            dbConn.Close();
            return(status);
        }
Ejemplo n.º 12
0
        public ActionResult UpdateStatus(UpdateStatusModel model)
        {
            _ilog.Info(string.Format("方法名:{0};参数:{1}", "UpdateStatus", Serializer.ToJson(model)));
            var result = new StandardJsonResult();

            result.Try(() =>
            {
                if (!ModelState.IsValid)
                {
                    throw new KnownException(ModelState.GetFirstError());
                }

                ItemStatus status = (ItemStatus)model.Status;
                var user          = GetSession();
                var examine       = new Examine()
                {
                    ExamineStatus = status,
                    UserID        = user.User.UserID,
                    UserName      = user.User.UserName,
                };
                service.SetSceneItemStatus(model.MessageID, examine);
            });

            _ilog.Info(string.Format("方法名:{0};执行结果:{1}", "UpdateStatus", Serializer.ToJson(result)));
            return(result);
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
0
    public void ItemWeaponDescSet(GameObject desc, GameObject ItemObject)
    {
        ItemStatus item_status = ItemObject.GetComponent <ItemStatus>();

        player_status.AttackSet(item_status.itemPower);

        if (desc.transform.childCount == 0)
        {
            //もしDescに何もセットされてなかったら?(通常運転)

            ItemObject.GetComponent <ItemClickEvent>().before_move_item_position = ItemObject.transform.position;
            ItemObject.transform.SetParent(desc.transform);
            ItemObject.transform.position = desc.transform.position;
        }
        else if (desc.transform.childCount > 0)
        {
            //もしDescに何かセットされていたら?
            GameObject desc_child = desc.transform.GetChild(0).gameObject;
            ItemWeaponDescRemove(desc_child);
            ItemObject.GetComponent <ItemClickEvent>().before_move_item_position = ItemObject.transform.position;
            ItemObject.transform.SetParent(desc.transform);
            ItemObject.transform.position = desc.transform.position;
        }
        weaponName                   = item_status.ItemName;
        weaponPower                  = item_status.itemPower;
        WeaponAttackSpeed            = item_status.itemAttackSpeed;
        weaponID                     = item_status.itemID;
        item_status.item_weapon_mode = true;
    }
Ejemplo n.º 15
0
        public ItemStatus GetNextStatus(ItemStatus status)
        {
            if (IsError(status))
            {
                return(status);
            }
            if (IsWarning(status))
            {
                status.MinAffixes  = Math.Max(0, status.MinAffixes - 1);
                status.MinPrefixes = Math.Max(0, status.MinPrefixes - 1);
                status.MinSuffixes = Math.Max(0, status.MinSuffixes - 1);
            }
            else
            {
                status.MaxAffixes = Math.Max(0, status.MaxAffixes - 1);
                status.MinAffixes = Math.Max(0, status.MinAffixes - 1);

                status.MinPrefixes = Math.Max(0, status.MinPrefixes - 1);
                status.MinSuffixes = Math.Max(0, status.MinSuffixes - 1);

                if (status.MaxPrefixes == 0)
                {
                    status.MaxSuffixes = Math.Max(0, status.MaxSuffixes - 1);
                }
                else if (status.MaxSuffixes == 0)
                {
                    status.MaxSuffixes = Math.Max(0, status.MaxPrefixes - 1);
                }
            }

            return(status);
        }
Ejemplo n.º 16
0
        public List <ItemRec> GetItems(
            long fromTimestamp,
            long toTimestamp,
            ItemStatus status,
            IReadOnlyCollection <string> itemTypes,
            int skip,
            int limit)
        {
            using (WriteLock.Read())
            {
                using (var connection = CreateConnection(true))
                {
                    var condition = ItemsCondition(itemTypes);
                    var sql       = $"select * from {ItemsTable} where {condition} limit @Limit OFFSET @Offset;";

                    using (var statement = connection.PrepareStatement(sql))
                    {
                        statement.TryBind("@FromTimestamp", fromTimestamp);
                        statement.TryBind("@ToTimestamp", toTimestamp);
                        statement.TryBind("@Status", (int)status);
                        statement.TryBind("@Limit", limit);
                        statement.TryBind("@Offset", skip);

                        return(GetItems(statement));
                    }
                }
            }
        }
Ejemplo n.º 17
0
    public void ItemGearDescSet(GameObject desc, GameObject ItemObject, bool load = false)
    {
        //ギアの装備のDescに当てはめる

        ItemStatus item_status = ItemObject.GetComponent <ItemStatus>();

        //装備したときにステータスを当てはめる
        player_status.DefenseSet(item_status.itemDefense);
        player_status.AttackSpeedSet(item_status.itemAttackSpeed);
        ItemGearImageStatus item_gear_image_status = ItemObject.GetComponent <ItemGearImageStatus>();

        if (desc.transform.childCount == 0)
        {
            //もしDescに何もセットされてなかったら?(通常運転)

            ItemObject.GetComponent <ItemClickEvent>().before_move_item_position = ItemObject.transform.position;
            ItemObject.transform.SetParent(desc.transform);
            ItemObject.transform.position = desc.transform.position;
            item_status.item_gear_mode    = true;
        }
        else if (desc.transform.childCount > 0)
        {
            //もしDescに何かセットされていたら?
            GameObject desc_child = desc.transform.GetChild(0).gameObject;
            ItemGearDescRemove(desc_child);
            ItemObject.GetComponent <ItemClickEvent>().before_move_item_position = ItemObject.transform.position;
            ItemObject.transform.SetParent(desc.transform);
            ItemObject.transform.position = desc.transform.position;
        }
        GearID            = item_status.itemID;
        GearName          = item_status.ItemName;
        GearDefense       = item_status.itemDefense;
        gears_toggle.isOn = true;
    }
Ejemplo n.º 18
0
 private void tryUseItem(ItemController item) {
     ItemStatus status = item.checkStatus();
     switch (status) {
         case ItemStatus.ACTIVE_READY:
             useItem(item);
             break;
         case ItemStatus.NEED_AIM:
             Debug.Log(item.item.name + " needs aiming");
             enableAimMode();
             primaryUp = delegate () {
                 disableAimMode();
                 useItem(item);
             };
             OnPrimaryUp += primaryUp;
             break;
         case ItemStatus.COOLDOWN:
             Debug.Log(item.item.name + " is cooling down");
             break;
         case ItemStatus.ONLY_PASSIVE:
             Debug.Log("Item doesn't have active ability");
             break;
         default:
             break;
     }
 }
Ejemplo n.º 19
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 void AllPropertiesCanBeSetAndRetrieved()
        {
            var item          = new ItemStatus();
            var theName       = "myItemName";
            var theDesc       = "A description";
            var theError      = "any error here";
            var theStatus     = ItemBuildStatus.CompletedFailed;
            var startTime     = new DateTime(2010, 1, 1, 12, 12, 12);
            var completedTime = new DateTime(2010, 1, 1, 13, 12, 12);
            var estimatedTime = new DateTime(2010, 1, 1, 14, 12, 12);
            var theParent     = new ItemStatus();

            item.Name                      = theName;
            item.Description               = theDesc;
            item.Error                     = theError;
            item.Status                    = theStatus;
            item.TimeStarted               = startTime;
            item.TimeCompleted             = completedTime;
            item.TimeOfEstimatedCompletion = estimatedTime;
            item.Parent                    = theParent;

            Assert.AreEqual(theName, item.Name);
            Assert.AreEqual(theDesc, item.Description);
            Assert.AreEqual(theError, item.Error);
            Assert.AreEqual(theStatus, item.Status);
            Assert.AreEqual(startTime, item.TimeStarted);
            Assert.AreEqual(completedTime, item.TimeCompleted);
            Assert.AreEqual(estimatedTime, item.TimeOfEstimatedCompletion);
            Assert.AreEqual(theParent, item.Parent);
            Assert.AreNotEqual(item.Identifier, item.Parent.Identifier);
        }
Ejemplo n.º 21
0
        public ItemStatus GetNextStatus(ItemStatus status)
        {
            if (IsError(status))
            {
                return(status);
            }
            if (status.Rarity != EquipmentRarity.Rare && IsWarning(status))
            {
                status.MaxPrefixes = Math.Max(Math.Min(status.MaxSuffixes + 1, 3), status.MaxPrefixes);
                status.MaxSuffixes = Math.Max(Math.Min(status.MaxPrefixes + 1, 3), status.MaxSuffixes);
                status.MaxAffixes  = Math.Max(Math.Min(status.MaxAffixes + 1, 6), status.MaxAffixes);
            }
            else
            {
                status.MinAffixes  = Math.Min(status.MinAffixes + 1, 6);
                status.MinPrefixes = Math.Max(status.MinPrefixes, status.MinAffixes - 3);
                status.MinSuffixes = Math.Max(status.MinSuffixes, status.MinAffixes - 3);

                status.MaxAffixes  = Math.Min(status.MaxAffixes + 1, 6);
                status.MaxSuffixes = Math.Min(status.MaxSuffixes + 1, 3);
                status.MaxPrefixes = Math.Min(status.MaxPrefixes + 1, 3);
            }

            return(status);
        }
Ejemplo n.º 22
0
        public ActionResult Create(ItemStatus cat)
        {
            // Início: Proteção de rota
            if (Session["usuario_nivel"] == null)
            {
                TempData["msg"]      = "Necessário estar logado!";
                TempData["msg_type"] = "warning";
                return(RedirectToAction("Index", "Home"));
            }

            if (Convert.ToInt32(Session["usuario_nivel"]) > 1)
            {
                TempData["msg"]      = "Você não tem autorização para acessar esta área!";
                TempData["msg_type"] = "danger";
                return(RedirectToAction("Index", "Home"));
            }
            // Fim: Proteção de Rota

            try
            {
                if (ItemStatusDAO.Create(cat) != null)
                {
                    TempData["msg"]      = "Criado com sucesso!";
                    TempData["msg_type"] = "success";
                    return(RedirectToAction("Index"));
                }
            }
            catch
            {
            }
            TempData["msg"]      = "Erro ao criar";
            TempData["msg_type"] = "danger";
            return(View());
        }
Ejemplo n.º 23
0
        public void ReadXml(System.Xml.XmlReader reader)
        {
            reader.ReadStartElement();

            _title = reader.ReadElementString("title");
            //Description = reader.ReadElementString("description"); // might cause problems if descriptn contains html
            _url = reader.ReadElementString("url");

            _status   = (ItemStatus)Enum.Parse(typeof(ItemStatus), reader.ReadElementString("status"));
            ForeColor = _status == ItemStatus.Skip ? System.Drawing.Color.Silver : System.Drawing.Color.Black;

            BytesDownloaded     = long.Parse(reader.ReadElementString("bytesDownloaded"));
            ContentLengthBytes  = long.Parse(reader.ReadElementString("contentLength"));
            _errorMessage       = reader.ReadElementString("errorMessage");
            DownloadDestination = reader.ReadElementString("downloadDestination");
            CompleteDestination = reader.ReadElementString("completeDestination");

            try
            {
                _publicationDate = DateTime.Parse(reader.ReadElementString("publishedDate"));
                string dt = reader.ReadElementString("downloadedDate");
                _downloadedDate = dt == "" ? null : (DateTime?)DateTime.Parse(dt);
                _description    = reader.ReadElementString("description");
            }
            catch (System.Xml.XmlException)
            {
                _publicationDate = DateTime.Now;
                _downloadedDate  = _status == ItemStatus.Complete ? (DateTime?)DateTime.Now : null;
                _description     = "";
            }

            reader.ReadEndElement();
        }
Ejemplo n.º 24
0
        public ActionResult Edit(int id)
        {
            // Início: Proteção de rota
            if (Session["usuario_nivel"] == null)
            {
                TempData["msg"]      = "Necessário estar logado!";
                TempData["msg_type"] = "warning";
                return(RedirectToAction("Index", "Home"));
            }

            if (Convert.ToInt32(Session["usuario_nivel"]) > 1)
            {
                TempData["msg"]      = "Você não tem autorização para acessar esta área!";
                TempData["msg_type"] = "danger";
                return(RedirectToAction("Index", "Home"));
            }
            // Fim: Proteção de Rota

            try
            {
                ItemStatus cat = ItemStatusDAO.GetByID(id);
                if (cat != null)
                {
                    return(View(cat));
                }
            }
            catch
            {
            }
            TempData["msg"]      = "Erro ao buscar dados";
            TempData["msg_type"] = "danger";
            return(View());
        }
Ejemplo n.º 25
0
        public ActionResult Comment(CommentDataModel model)
        {
            _ilog.Info(string.Format("方法名:{0};参数:{1}", "Comment", Serializer.ToJson(model)));

            var result = new StandardJsonResult();

            result.Try(() =>
            {
                if (!ModelState.IsValid)
                {
                    throw new KnownException(ModelState.GetFirstError());
                }
                ItemStatus status = (ItemStatus)model.Status;
                var user          = GetSession();
                var examine       = new Examine()
                {
                    UserID        = user.User.UserID,
                    UserName      = user.User.UserName,
                    ExamineStatus = status
                };
                var SN = GetSession();
                service.AddCommentItem(model.MessageID,
                                       new Comment()
                {
                    CommentGuid = model.Guid,
                    Content     = model.Content,
                    Time        = model.Time,
                    UserID      = SN.User.UserID,
                    UserName    = SN.User.UserName
                }, examine);
            });

            _ilog.Info(string.Format("方法名:{0};执行结果:{1}", "Comment", Serializer.ToJson(result)));
            return(result);
        }
Ejemplo n.º 26
0
 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();
 }
Ejemplo n.º 27
0
        public ActionResult GetSceneData(GetSceneDataModel model)
        {
            _ilog.Info(string.Format("方法名:{0};参数:{1}", "GetSceneData", Serializer.ToJson(model)));

            var result = new StandardJsonResult <dynamic>();

            result.Value = new List <SceneItemDto>();
            result.Try(() =>
            {
                if (!ModelState.IsValid)
                {
                    throw new KnownException(ModelState.GetFirstError());
                }
                int count = 0;
                ItemStatus sceneStatus = ItemStatus.All;
                bool f = Enum.TryParse <ItemStatus>(model.Status + "", out sceneStatus);
                if (!f)
                {
                    sceneStatus = ItemStatus.All;
                }
                List <SceneItemDto> list = service.GetAllByStatus(BCSession.User.UserID, BCSession.User.Device, model.SceneID, sceneStatus, model.PageSize, model.Time, out count);
                result.Value             = new { Count = count, Data = list };
            });

            _ilog.Info(string.Format("方法名:{0};执行结果:{1}", "GetSceneData", Serializer.ToJson(result)));
            return(result);
        }
Ejemplo n.º 28
0
        public ItemStatus GetNextStatus(ItemStatus status)
        {
            if (IsError(status))
            {
                return(status);
            }
            if (IsWarning(status))
            {
                status.MinPrefixes = Math.Min(1, status.MinPrefixes);
                status.MinSuffixes = Math.Min(1, status.MinSuffixes);
                status.MinAffixes  = Math.Min(4, status.MinAffixes);

                status.MaxPrefixes = Math.Max(3, status.MaxPrefixes);
                status.MaxSuffixes = Math.Max(3, status.MaxSuffixes);
                status.MaxAffixes  = Math.Max(6, status.MaxAffixes);
            }
            else
            {
                status.MinPrefixes = 1;
                status.MinSuffixes = 1;
                status.MinAffixes  = 4;

                status.MaxPrefixes = 3;
                status.MaxSuffixes = 3;
                status.MaxAffixes  = 6;
            }

            return(status);
        }
        public void EqualsReturnsTrueForSameIdentifier()
        {
            var item1 = new ItemStatus();
            var item2 = item1.Clone();

            Assert.IsTrue(item1.Equals(item2));
        }
        public void EqualsReturnsFalseForDifferentIdentifier()
        {
            var item1 = new ItemStatus();
            var item2 = new ItemStatus();

            Assert.IsFalse(item1.Equals(item2));
        }
Ejemplo n.º 31
0
 /// <summary>
 /// Create a default, empty Disk object
 /// </summary>
 public Disk()
 {
     _name       = "";
     _itemType   = ItemType.Disk;
     _dupeType   = 0x00;
     _itemStatus = ItemStatus.None;
 }
Ejemplo n.º 32
0
    public void AddItemsFromDataBaseToGameManager()
    {
        for (int i = 0; i < database.Count; i++)
        {
            GameObject itemToAdd = Instantiate(itemExample);
            ItemStatus status    = itemToAdd.GetComponent <ItemStatus>();
            ItemStats  stats     = itemToAdd.GetComponent <ItemStats>();
            status.id      = database[i].ID;
            itemToAdd.name = database[i].Title;
            for (int j = 0; j < GameManager.instance.heroes.Length; j++)
            {
                if (GameManager.instance.heroes[i].GetComponent <HeroStateMachine>().playerStats.theName == database[i].OwnedBy)
                {
                    status.ownedByHero = GameManager.instance.heroes[i];
                    break;
                }
            }
            status.Type                             = database[i].Type;
            status.IsEquipped                       = database[i].IsEquipped;
            itemToAdd.tag                           = database[i].Tag;
            stats.coins                             = database[i].Coins;
            stats.stamina                           = database[i].Stamina;
            stats.agility                           = database[i].Agility;
            stats.intellect                         = database[i].Intellect;
            stats.dexterity                         = database[i].Dexterity;
            stats.slug                              = database[i].Slug;
            stats.amountOfMpToGive                  = database[i].MpToGive;
            stats.amountOfHpToGive                  = database[i].HpToGive;
            stats.ConsumableDescription             = database[i].ConsumableDescription;
            itemToAdd.GetComponent <Image>().sprite = Resources.Load <Sprite>("Sprites/Items/" + database[i].Slug);

            GameManager.instance.boughtItems.Add(itemToAdd);
        }
    }
Ejemplo n.º 33
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;
 }
Ejemplo n.º 34
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;
        }
Ejemplo n.º 35
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;
        }
Ejemplo n.º 36
0
 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;
     }
 }
Ejemplo n.º 37
0
        //        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;
        }
Ejemplo n.º 38
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);
 }
Ejemplo n.º 39
0
        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);
        }
Ejemplo n.º 40
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();
 }
Ejemplo n.º 41
0
        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;
        }
Ejemplo n.º 42
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!");
 }
Ejemplo n.º 43
0
 public new void Initialize(String name, Vector2 position, int textureIndex)
 {
     currentDrawIndex = textureIndex;
     itemStatus = ItemStatus.OnFloor;
     base.Initialize(name, position);
 }
Ejemplo n.º 44
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);
                        }
                    }
                }
            }
        }
Ejemplo n.º 45
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);
                    }
                }
            }
        }
Ejemplo n.º 46
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;
 }
Ejemplo n.º 47
0
 public ItemNode(ItemCue itemInfo)
     : base(itemInfo, MemoryType.Item)
 {
     status = itemInfo.Status;
     owner = itemInfo.Owner;
     durability = itemInfo.Durability;
 }
Ejemplo n.º 48
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;
 }
Ejemplo n.º 49
0
 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},
     });
 }
        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;
        }
Ejemplo n.º 51
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;
        }
Ejemplo n.º 52
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;
 }
Ejemplo n.º 53
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;
 }
Ejemplo n.º 54
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);
 }
Ejemplo n.º 55
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; }
 }
Ejemplo n.º 56
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);
        }
Ejemplo n.º 57
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;
     }
 }
Ejemplo n.º 58
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;
        }
    }
Ejemplo n.º 59
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 "";
     }
 }
        /// <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;
        }