Example #1
0
        public void SetColor(GameObject selectItemObj)
        {
            var itemImage = selectItemObj.GetComponent <Image>();
            var itemComp  = selectItemObj.GetComponent <VRDebugItem>();

            //初期化
            itemList = new List <ItemParam>();
            foreach (Transform child in transform)
            {
                var image = child.gameObject.GetComponent <Image>();
                var item  = child.gameObject.GetComponent <VRDebugItem>();
                if (image != null)
                {
                    var itemParam = new ItemParam();
                    itemParam.itemObj   = child.gameObject;
                    itemParam.image     = image;
                    itemParam.initColor = item.initColor;
                    itemList.Add(itemParam);
                }
            }
            //選択されたオブジェクトのみ青色に
            foreach (ItemParam item in itemList)
            {
                if (item.itemObj == selectItemObj)
                {
                    item.image.color = selectColor;
                }
                else
                {
                    item.image.color = item.initColor;
                }
            }
        }
        public string GetItemById(int id)
        {
            string CS = ConfigurationManager.ConnectionStrings["MyContext"].ConnectionString;

            using (SqlConnection con = new SqlConnection(CS))
            {
                SqlCommand cmd = new SqlCommand("spGetItemById", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Id", id);
                cmd.Parameters.Add("@Name", SqlDbType.NVarChar, 50).Direction   = ParameterDirection.Output;
                cmd.Parameters.Add("@Stock", SqlDbType.Int, 2).Direction        = ParameterDirection.Output;
                cmd.Parameters.Add("@Suppliers_Id", SqlDbType.Int, 2).Direction = ParameterDirection.Output;

                con.Open();
                cmd.ExecuteNonQuery();

                ItemParam item = new ItemParam();
                item.Id           = Convert.ToInt16(cmd.Parameters["@Id"].Value);
                item.Name         = Convert.ToString(cmd.Parameters["@Name"].Value);
                item.Stock        = Convert.ToInt16(cmd.Parameters["@Stock"].Value);
                item.Suppliers_Id = Convert.ToInt16(cmd.Parameters["@Suppliers_Id"].Value);
                var data = JsonConvert.SerializeObject(item);
                return(data);
            }
        }
Example #3
0
 public void Update(ItemParam itemparam)
 {
     this.Name       = itemparam.Name;
     this.Price      = itemparam.Price;
     this.Stock      = itemparam.Stock;
     this.UpdateDate = DateTimeOffset.Now.LocalDateTime;
 }
Example #4
0
 public Item(ItemParam itemParam)
 {
     this.Name       = itemParam.Name;
     this.Stock      = itemParam.Stock;
     this.Price      = itemParam.Price;
     this.CreateDate = DateTimeOffset.Now.LocalDateTime;
 }
 public void Put(ItemParam itemParam)
 {
     if (ModelState.IsValid)
     {
         _itemService.Update(itemParam);
     }
 }
 public void Post(ItemParam itemParam)
 {
     if (ModelState.IsValid)
     {
         _itemService.Insert(itemParam);
     }
 }
Example #7
0
        public ItemParam Get(int?id)
        {
            var       itparam = _context.Item.SingleOrDefault(x => x.Id == id && x.IsDelete == false);
            ItemParam itnew   = new ItemParam(itparam);

            return(itnew);
        }
Example #8
0
 public void Create(ItemParam item)
 {
     if (ModelState.IsValid)
     {
         itemRepo.Create(item);
     }
 }
Example #9
0
 public bool Update(int?Id, ItemParam itemParam)
 {
     if (Id != null && itemParam != null)
     {
         status = _itemRepository.Update(Id, itemParam);
     }
     return(status);
 }
Example #10
0
 public bool Insert(ItemParam itemParam)
 {
     if (itemParam != null)
     {
         status = _itemRepository.Insert(itemParam);
     }
     return(status);
 }
Example #11
0
 public Item(ItemParam _ItemParam)
 {
     this.Name       = _ItemParam.Name;
     this.Stock      = _ItemParam.Stock;
     this.Price      = _ItemParam.Price;
     this.Supplier   = _ItemParam.Supplier;
     this.CreateDate = DateTimeOffset.Now.LocalDateTime;
     this.IsDelete   = false;
 }
Example #12
0
 public virtual void Update(ItemParam _ItemParam)
 {
     this.Id    = _ItemParam.Id;
     this.Name  = _ItemParam.Name;
     this.Price = _ItemParam.Price;
     this.Stock = _ItemParam.Stock;
     //this.Supplier_Id = Convert.ToInt16(_ItemParam.Supplier);
     this.Supplier   = _ItemParam.Supplier;
     this.UpdateDate = DateTimeOffset.Now.LocalDateTime;
 }
Example #13
0
    public void OnGetButton()
    {
        if (myItemPV.isMine)
        {
            ItemParam param = itemObject.GetComponent <ItemParam>();
            var       id    = param.GetItemId();

            itemFlags[id]  = true;
            itemCount[id] += 1;
        }
        myItemPV.RPC("WasgetItem", PhotonTargets.AllViaServer);
    }
Example #14
0
    private static string GetItemName(string itemid)
    {
        string str = string.Empty;

        if (!string.IsNullOrEmpty(itemid))
        {
            ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(itemid);

            str = itemParam == null ? "?" + itemid : itemParam.name;
        }
        return(str);
    }
Example #15
0
        public bool Update(int?Id, ItemParam itemParam)
        {
            var get = Get(Id);

            get.Update(itemParam);
            var result = _context.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Example #16
0
        public bool Insert(ItemParam itemParam)
        {
            var get = new Item(itemParam);

            _context.Items.Add(get);
            var result = _context.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Example #17
0
        public bool Insert(ItemParam itemParam)
        {
            var push = new Item(itemParam);

            context.Items.Add(push);
            var result = context.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Example #18
0
    void OnItemRender(int index, GObject item)
    {
        ItemSlot slot = item.displayObject.gameObject.TryGetComponent <ItemSlot>();

        slot.owner = item.asButton;
        var itemparam = new ItemParam();

        itemparam.serverType = GameDefine.ObjectCellType.ObjectCellType_Bag;
        itemparam.clientType = ClientDefine.ObjectCellType.Bag;
        itemparam.position   = index;
        slot.Set(itemparam);
        //slot.icon = (100 + index).ToString();
    }
Example #19
0
        public bool Insert(ItemParam _itemparam)
        {
            _itemparam.Supplier = context.Suppliers.Find(_itemparam.Supplier_Id);
            var push = new Item(_itemparam);

            context.Items.Add(push);
            var result = context.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Example #20
0
 public bool Insert(ItemParam itemParam)
 {
     if (itemParam == null)
     {
         Console.WriteLine("Insert Name");
         Console.Read();
     }
     else
     {
         status = _itemRepository.Insert(itemParam);
         Console.WriteLine("Success");
     }
     return(status);
 }
Example #21
0
        public bool Update(ItemParam itemParam)
        {
            Item getitem = Get(itemParam.Id);

            getitem.Update(itemParam);
            context.Entry(getitem).State = EntityState.Modified;
            var result = context.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Example #22
0
        public bool Insert(ItemParam itemparam)
        {
            Item item = new Item(itemparam);

            item.Supplier = _context.Supplier.Find(Convert.ToInt16(itemparam.Supplier));
            //item.Supplier = _context.Supplier.SingleOrDefault(x => x.Id == itemparam.Supplier);
            _context.Item.Add(item);
            var result = _context.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Example #23
0
        public bool Update(int?id, ItemParam itemparam)
        {
            Item item = _context.Item.SingleOrDefault(x => x.Id == id && x.IsDelete == false);

            item.Supplier = _context.Supplier.Find(Convert.ToInt16(itemparam.Supplier));
            item.Update(itemparam);
            _context.Entry(item).State = EntityState.Modified;
            var result = _context.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Example #24
0
        public bool Update(ItemParam _itemparam)
        {
            //_itemparam.Supplier = context.Suppliers.Find(_itemparam.Supplier_Id);
            var getItem = Get(_itemparam.Id);

            getItem.Update(_itemparam);
            context.Entry(getItem).State = System.Data.Entity.EntityState.Modified;
            var result = context.SaveChanges();

            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
        public IEnumerable<ItemParam> GetName(int typesearchitem, string name)
        {
            ItemParam cari = new ItemParam();
            cari.typesearchitem = typesearchitem;
            cari.Name = name;

            IEnumerable<ItemParam> listparam = _iitemservice.GetName(cari).Select(x => new ItemParam
            {
                Id = x.Id,
                Name = x.Name.ToString(),
                Price=Convert.ToInt32(x.Price),
                Stock = Convert.ToInt32(x.Stock),
                Supplier_Name=x.Supplier.Name,
                CreateDate = Convert.ToDateTime(x.CreateDate)
            });
            return listparam;
        }
        public void Edit(ItemParam item)
        {
            string CS = ConfigurationManager.ConnectionStrings["MyContext"].ConnectionString;

            using (SqlConnection con = new SqlConnection(CS))
            {
                SqlCommand cmd = new SqlCommand("spUpdateItem", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Id", item.Id);
                cmd.Parameters.AddWithValue("@Name", item.Name);
                cmd.Parameters.AddWithValue("@Stock", item.Stock);
                cmd.Parameters.AddWithValue("@Suppliers_Id", item.Suppliers_Id);

                con.Open();
                cmd.ExecuteNonQuery();
            }
        }
Example #27
0
        public bool Update(int?Id, ItemParam itemParam)
        {
            var result = 0;
            var get    = Get(Id);

            get.Name       = itemParam.Name;
            get.Price      = itemParam.Price;
            get.Stock      = itemParam.Stock;
            get.Suppliers  = myContext.Suppliers.Find(itemParam.Suppliers);
            get.UpdateDate = DateTimeOffset.UtcNow.LocalDateTime;
            result         = myContext.SaveChanges();
            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Example #28
0
        public bool Insert(ItemParam itemParam)
        {
            var result = 0;

            item.Name       = itemParam.Name;
            item.Price      = itemParam.Price;
            item.Stock      = itemParam.Stock;
            item.Suppliers  = myContext.Suppliers.Find(itemParam.Suppliers);
            item.CreateDate = DateTimeOffset.UtcNow.LocalDateTime;
            myContext.Items.Add(item);
            result = myContext.SaveChanges();
            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Example #29
0
 public bool Update(int?Id, ItemParam itemParam)
 {
     if (Id == null)
     {
         Console.WriteLine("Insert Id");
         Console.Read();
     }
     else if (Id == ' ')
     {
         Console.WriteLine("Dont Insert Blank Caracter");
         Console.Read();
     }
     else
     {
         status = _itemRepository.Update(Id, itemParam);
         Console.WriteLine("update Success");
     }
     return(status);
 }
Example #30
0
 public List <Item> Search(ItemParam itemparam)
 {
     if (itemparam.searchBy == 1)
     {
         return(_context.Item.Include("Supplier").Where(x => x.Name.Contains(itemparam.Name) && x.IsDelete == false).ToList());
     }
     else if (itemparam.searchBy == 2)
     {
         return(_context.Item.Include("Supplier").Where(x => x.Supplier.Name.Contains(itemparam.Name) && x.IsDelete == false).ToList());
     }
     else if (itemparam.searchBy == 3)
     {
         int bln = Convert.ToInt16(itemparam.Name);
         return(_context.Item.Include("Supplier").Where(x => x.CreateDate.Value.Month == bln && x.IsDelete == false).ToList());
     }
     else
     {
         return(_context.Item.Include("Supplier").Where(x => x.IsDelete == false).ToList());
     }
 }