コード例 #1
0
ファイル: Inventory.cs プロジェクト: MrTK-Dev/saltyAdventure
    static public int ReturnIntFromCategory(Item_Category Category)
    {
        switch (Category)
        {
        case Item_Category.Medicine:
            return(0);

        case Item_Category.Items:
            return(1);

        case Item_Category.Pokeball:
            return(2);

        case Item_Category.TM:
            return(3);

        case Item_Category.Battle:
            return(4);

        case Item_Category.Berries:
            return(5);

        case Item_Category.Key:
            return(6);

        case Item_Category.none:
            return(7);

        default:
            return(0);
        }
    }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Item_Category item_Category = db.Item_Category.Find(id);

            db.Item_Category.Remove(item_Category);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
        public void Delete(int id)
        {
            Item_Category category = this.context.Item_Category.SingleOrDefault(x => x.Id == id);

            this.context.Item_Category.Remove(category);

            this.context.SaveChanges();
        }
コード例 #4
0
        public void Update(Item_Category ItemCategory)
        {
            Item_Category category = this.context.Item_Category.SingleOrDefault(x => x.Id == ItemCategory.Id);

            category.categoryName = ItemCategory.categoryName;

            this.context.SaveChanges();
        }
コード例 #5
0
ファイル: BagData.cs プロジェクト: MrTK-Dev/saltyAdventure
 new BagData()
 {
     Category    = Item_Category.Medicine,
     Name        = "Medicine",
     Description = "Diggi Medicine",
     List        = new List <ItemData>()
     {
     }
 },
コード例 #6
0
        public IActionResult Index()
        {
            Item_Category Item_Cat_id = database.Item_category_id_Generate();


            ViewBag.Item_Cate_id = Item_Cat_id;

            return(View());
        }
コード例 #7
0
 public ActionResult Edit([Bind(Include = "Category_ID,Cat_Name,Description,Aprroval_Needed")] Item_Category item_Category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(item_Category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(item_Category));
 }
コード例 #8
0
        public void Obs_Neg_23_Create_BadResultTimeKindB()
        {
            // Expecting an exception if result time is not in UTC

            var result = new Item_Category("hello");

            new Observation(result)
            {
                ResultTime = DateTime.SpecifyKind(ParseDateTimeInUtc("2020-02-17T14:39:00Z"), DateTimeKind.Unspecified)
            };
        }
コード例 #9
0
        public ActionResult Create([Bind(Include = "Category_ID,Cat_Name,Description,Aprroval_Needed")] Item_Category item_Category)
        {
            if (ModelState.IsValid)
            {
                db.Item_Category.Add(item_Category);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(item_Category));
        }
コード例 #10
0
        private void Save_btn_Click(object sender, EventArgs e)
        {
            Item_Category item_Category = new Item_Category();

            item_Category.Name = Name_txt.Text;

            dbContext.Item_Categories.Add(item_Category);
            dbContext.SaveChanges();
            Refresh();
            ClearTextBox();
        }
コード例 #11
0
        public void Obs_Neg_23_Create_BadResultTimeKindA()
        {
            // Expecting an exception if result time is not in UTC

            var result = new Item_Category("hello");

            new Observation(result)
            {
                ResultTime = ParseDateTimeInUtc("2020-02-17T14:39:00Z").ToLocalTime()
            };
        }
コード例 #12
0
        // GET: Category/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Item_Category item_Category = db.Item_Category.Find(id);

            if (item_Category == null)
            {
                return(HttpNotFound());
            }
            return(View(item_Category));
        }
コード例 #13
0
ファイル: DB.cs プロジェクト: SheikhSahal/SCM
        public void Insert_Item_Category(Item_Category ic, string Status)
        {
            using (SqlConnection conn = new SqlConnection(connectString))
            {
                using (SqlCommand cmd = new SqlCommand("insert into Item_Category values (@Icate,@Descrption,@Status)", conn))
                {
                    conn.Open();
                    cmd.Parameters.AddWithValue("@Icate", ic.Item_category_id);
                    cmd.Parameters.AddWithValue("@Descrption", ic.Descrption);
                    cmd.Parameters.AddWithValue("@Status", Status);


                    cmd.ExecuteNonQuery();
                }
            }
        }
コード例 #14
0
ファイル: DB.cs プロジェクト: SheikhSahal/SCM
        //Item_Category Start

        public Item_Category Item_category_id_Generate()
        {
            Item_Category ads = new Item_Category();
            SqlConnection con = new SqlConnection(connectString);
            SqlCommand    cmd = new SqlCommand();

            cmd.CommandText = "select isnull(max(c.Icate_id),0)+1 I_Cate from Item_Category c";
            cmd.Connection  = con;
            con.Open();

            SqlDataReader reader = cmd.ExecuteReader();

            reader.Read();

            ads.Item_category_id = Convert.ToInt16(reader["I_Cate"]);

            reader.Close();
            return(ads);
        }
コード例 #15
0
        public bool insertItemCategory(Guid idItem, Guid idCategory)
        {
            bool kt = false;

            try
            {
                Item_Category itemCategory = new Item_Category();
                itemCategory.IdItem     = idItem;
                itemCategory.IdCategory = idCategory;
                db.Item_Categories.InsertOnSubmit(itemCategory);
                db.SubmitChanges();
                kt = true;
            }
            catch (Exception ex)
            {
                kt = false;
            }
            return(kt);
        }
コード例 #16
0
    public List <Item_Category> GetAllProductsCategories()
    {
        DbService            db     = new DbService();
        DataSet              DS     = new DataSet();
        List <Item_Category> allCat = new List <Item_Category>();
        string StrSql = "SELECT * FROM product_category order by category_name ";

        DS = db.GetDataSetByQuery(StrSql);

        if (DS.Tables.Count > 0)
        {
            foreach (DataRow row in DS.Tables[0].Rows)
            {
                Item_Category Item = new Item_Category();
                Item.Cat_id   = int.Parse(row[0].ToString());
                Item.Cat_Name = row[1].ToString();
                allCat.Add(Item);
            }
        }
        return(allCat);
    }
コード例 #17
0
    public string AddingProductAuction(string itemName, string itemDesc, string city, string cat, string days, string assoc, string price, string user)
    {
        DbService            db       = new DbService();
        DataSet              DS       = new DataSet();
        JavaScriptSerializer j        = new JavaScriptSerializer();
        Item                  NewItem = new Item();
        Reg_Auction           Auction = new Reg_Auction();
        City                  c       = new City(int.Parse(city));
        Item_Category         IC      = new Item_Category(int.Parse(cat));
        Voluntary_association Vol     = new Voluntary_association(assoc);
        UserT                 Seller  = new UserT(user, true);
        int ProductCode = 0;

        NewItem.ItemName        = itemName;
        NewItem.ItemDesc        = itemDesc;
        NewItem.Location        = c;
        NewItem.Item_Categories = IC;
        NewItem.Price           = price;

        Auction.End_Date = DateTime.Now.AddDays(double.Parse(days)).ToString();
        Auction.Vol_asc  = Vol;
        Auction.Price    = int.Parse(price);
        Auction.Seller   = Seller;

        NewItem.AddItem(int.Parse(Auction.Seller.UserId));

        string StrSql = "select max(product_code) from product ";

        DS = db.GetDataSetByQuery(StrSql);

        if (DS.Tables.Count > 0)
        {
            ProductCode = int.Parse(DS.Tables[0].Rows[0][0].ToString());
        }

        Auction.AddNewAuction(ProductCode, int.Parse(assoc));

        return(j.Serialize(ProductCode));
    }
コード例 #18
0
ファイル: DB.cs プロジェクト: SheikhSahal/SCM
        public List <Item_Category> ItemCat_dropdown()
        {
            List <Item_Category> DBase = new List <Item_Category>();

            using (SqlConnection conn = new SqlConnection(connectString))
            {
                using (SqlCommand cmd = new SqlCommand("select c.Icate_id,c.Description from Item_Category c", conn))
                {
                    conn.Open();
                    SqlDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Item_Category emp = new Item_Category();
                        emp.Item_category_id = Convert.ToInt16(reader["Icate_id"]);
                        emp.Descrption       = reader["Description"].ToString();

                        DBase.Add(emp);
                    }
                }
            }
            return(DBase);
        }
コード例 #19
0
        public JsonResult Index(Item_Category ic)
        {
            string R_Status = null;

            bool status = false;

            if (ic.Status == true)
            {
                R_Status = "Y";
            }
            else
            {
                R_Status = "N";
            }

            Item_Category Item_Cat_id = database.Item_category_id_Generate();

            ic.Item_category_id = Item_Cat_id.Item_category_id;

            database.Insert_Item_Category(ic, R_Status);
            status = true;

            return(Json(new { success = status }));
        }
コード例 #20
0
 public void Insert(Item_Category Item_Category)
 {
     this.context.Item_Category.Add(Item_Category);
     this.context.SaveChanges();
 }
コード例 #21
0
 public void SetCategory(int i)
 {
     Category = (Item_Category)i;
     SpawnSlots();
 }
コード例 #22
0
 public void SetActiveBag(Item_Category Category)
 {
     SetActiveBag(BagData.GetBag(Category));
 }
コード例 #23
0
        public IActionResult GetData()
        {
            Item_Category Item_Cat_id = database.Item_category_id_Generate();

            return(Json(new { success = true, fetchdata = Item_Cat_id.Item_category_id }));
        }
コード例 #24
0
 public void Insert(Item_Category Item_Category)
 {
     this.data.Insert(Item_Category);
 }
コード例 #25
0
 public void Update(Item_Category Item_Category)
 {
     this.data.Update(Item_Category);
 }