Example #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Uuid.Length != 0)
            {
                hash ^= Uuid.GetHashCode();
            }
            if (SkuId.Length != 0)
            {
                hash ^= SkuId.GetHashCode();
            }
            if (Quantity != 0L)
            {
                hash ^= Quantity.GetHashCode();
            }
            if (timestamp_ != null)
            {
                hash ^= Timestamp.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Example #2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Returns HashCode</returns>
 public override int GetHashCode()
 {
     return(String.Format("{0}|{1}|",
                          SkuId.GetHashCode(),
                          DisabledPlans.Aggregate(0, (acc, next) => acc += (next != null ? next.GetHashCode() : 0))
                          ).GetHashCode());
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (PlayerId.Length != 0)
            {
                hash ^= PlayerId.GetHashCode();
            }
            if (SkuId.Length != 0)
            {
                hash ^= SkuId.GetHashCode();
            }
            if (Reason.Length != 0)
            {
                hash ^= Reason.GetHashCode();
            }
            if (Quantity != 0)
            {
                hash ^= Quantity.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Example #4
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (ShowInInlineBuy != false)
            {
                hash ^= ShowInInlineBuy.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            hash ^= storePackConfig_.GetHashCode();
            if (SkuId.Length != 0)
            {
                hash ^= SkuId.GetHashCode();
            }
            if (OverrideTitleLocKey.Length != 0)
            {
                hash ^= OverrideTitleLocKey.GetHashCode();
            }
            if (MaxRewardItemCount != 0)
            {
                hash ^= MaxRewardItemCount.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Example #5
0
        public void DeleteSku(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec       sfcdb     = null;
            T_C_SKU       Table     = null;
            string        SkuObject = string.Empty;
            SkuObject     Sku       = null;
            string        result    = string.Empty;
            StringBuilder SkuId;

            try
            {
                sfcdb     = this.DBPools["SFCDB"].Borrow();
                Table     = new T_C_SKU(sfcdb, DBTYPE);
                SkuObject = Data["SkuObject"].ToString();
                Sku       = (SkuObject)JsonConvert.Deserialize(SkuObject, typeof(SkuObject));
                result    = Table.UpdateSku(BU, Sku, "DELETE", GetDBDateTime(), out SkuId, sfcdb);

                if (Int32.Parse(result) > 0)
                {
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000035";
                    StationReturn.MessagePara.Add(result);
                    StationReturn.Data = SkuId.ToString();
                }
                else
                {
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000036";
                    StationReturn.Data        = result;
                }

                if (sfcdb != null)
                {
                    this.DBPools["SFCDB"].Return(sfcdb);
                }
            }
            catch (Exception e)
            {
                StationReturn.Status      = StationReturnStatusValue.Fail;
                StationReturn.MessageCode = "MES00000037";
                StationReturn.MessagePara.Add(e.Message);
                StationReturn.Data = e.Message;

                if (sfcdb != null)
                {
                    this.DBPools["SFCDB"].Return(sfcdb);
                }
            }
        }
Example #6
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (TimestampMs != 0L)
            {
                hash ^= TimestampMs.GetHashCode();
            }
            if (PlayerId.Length != 0)
            {
                hash ^= PlayerId.GetHashCode();
            }
            if (Type.Length != 0)
            {
                hash ^= Type.GetHashCode();
            }
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            if (SkuId.Length != 0)
            {
                hash ^= SkuId.GetHashCode();
            }
            if (CurrencyUsed.Length != 0)
            {
                hash ^= CurrencyUsed.GetHashCode();
            }
            if (PricePaidE6 != 0L)
            {
                hash ^= PricePaidE6.GetHashCode();
            }
            if (VendorCode.Length != 0)
            {
                hash ^= VendorCode.GetHashCode();
            }
            hash ^= initialBalance_.GetHashCode();
            hash ^= finalBalance_.GetHashCode();
            hash ^= itemId_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Example #7
0
        public virtual IInOutLineState GetInOutLine(string inOutDocumentNumber, SkuId skuId)
        {
            var entityId = new InOutLineId(inOutDocumentNumber, skuId);

            return(CurrentSession.Get <InOutLineState>(entityId));
        }
Example #8
0
        public void UpdateSku(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec       sfcdb     = null;
            T_C_SKU       Table     = null;
            string        SkuObject = string.Empty;
            SkuObject     Sku       = null;
            string        result    = string.Empty;
            StringBuilder SkuId;

            try
            {
                sfcdb            = this.DBPools["SFCDB"].Borrow();
                Table            = new T_C_SKU(sfcdb, DBTYPE);
                SkuObject        = Data["SkuObject"].ToString();
                Sku              = (SkuObject)JsonConvert.Deserialize(SkuObject, typeof(SkuObject));
                Sku.LastEditUser = LoginUser.EMP_NO;
                result           = Table.UpdateSku(BU, Sku, "UPDATE", GetDBDateTime(), out SkuId, sfcdb);

                if (Int32.Parse(result) > 0)
                {
                    //更新成功
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000035";
                    StationReturn.MessagePara.Add(result);
                    StationReturn.Data = SkuId.ToString();
                }
                else
                {
                    //更新失敗
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000036";
                    StationReturn.Data        = result;
                }

                if (sfcdb != null)
                {
                    this.DBPools["SFCDB"].Return(sfcdb);
                }
            }
            catch (Exception e)
            {
                //不是最新的數據,返回字符串無法被 Int32.Parse 方法轉換成 int,所以出現異常
                if (!string.IsNullOrEmpty(result))
                {
                    StationReturn.Status      = StationReturnStatusValue.Fail;
                    StationReturn.MessageCode = "MES00000032";
                    StationReturn.Data        = e.Message + ":" + result;
                }
                else
                {
                    //數據庫執行異常
                    StationReturn.Status      = StationReturnStatusValue.Fail;
                    StationReturn.MessageCode = "MES00000037";
                    StationReturn.MessagePara.Add(e.Message);
                    StationReturn.Data = e.Message;
                }

                if (sfcdb != null)
                {
                    this.DBPools["SFCDB"].Return(sfcdb);
                }
            }
        }
Example #9
0
        public void AddSku(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec       sfcdb     = null;
            T_C_SKU       Table     = null;
            string        SkuObject = string.Empty;
            C_SKU         Sku       = null;
            string        result    = string.Empty;
            StringBuilder SkuId;

            try
            {
                sfcdb        = this.DBPools["SFCDB"].Borrow();
                Table        = new T_C_SKU(sfcdb, DBTYPE);
                SkuObject    = Data["SkuObject"].ToString();
                Sku          = (C_SKU)JsonConvert.Deserialize(SkuObject, typeof(C_SKU));
                Sku.EDIT_EMP = LoginUser.EMP_NO;
                result       = Table.UpdateSku(BU, Sku, "ADD", GetDBDateTime(), out SkuId, sfcdb);

                if (Int32.Parse(result) > 0)
                {
                    //添加成功
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000035";
                    StationReturn.MessagePara.Add(result);
                    StationReturn.Data = SkuId.ToString();
                }
                else
                {
                    //沒有添加任何數據
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000036";
                    StationReturn.Data        = result;
                }

                if (sfcdb != null)
                {
                    this.DBPools["SFCDB"].Return(sfcdb);
                }
            }
            catch (Exception e)
            {
                if (!string.IsNullOrEmpty(result))
                {
                    StationReturn.Status      = StationReturnStatusValue.Fail;
                    StationReturn.MessageCode = "MES00000005";
                    StationReturn.Data        = e.Message + ":" + result;
                }
                else
                {
                    StationReturn.Status      = StationReturnStatusValue.Pass;
                    StationReturn.MessageCode = "MES00000037";
                    StationReturn.MessagePara.Add(e.Message);
                    StationReturn.Data = e.Message;
                }

                if (sfcdb != null)
                {
                    this.DBPools["SFCDB"].Return(sfcdb);
                }
            }
        }