本文介绍了如何添加,更新,删除不使用数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是初学者C#。我可以创建表单添加,更新,删除搜索使用数据库,如SQL Server,但我不知道如果不使用数据库,你可以检查我的代码命名空间MODEL或给我一个具有添加删除更新功能的简单项目不使用数据库进行调试.Tks !!!

Sr ...我的英语不好:(



我的尝试:



I'm beginner study C#.I can create form Add,update,delete search use database like SQL Server but I don't know make it if don't use database.You can check my code namespace MODEL or give me a simple project that has the function of add remove update don't use Database to debug.Tks!!!
Sr...My English not good :(

What I have tried:

namespace OBJECT
{
    public class Product_Object
    {
        public string prodid { get; set; }
        public string prodname { get; set; }
        public string cateid { get; set; }
        public string units { get; set; }
        public decimal price { get; set; }
        public bool isAvailable { get; set; }
    }
}
namespace MODEL
{
    public class Product_Model
    {
        private List<Product_Object> LisPro = null;
        public List<Product_Object> Get_Element()
        {
            if (LisPro == null)
            {
                LisPro = new List<Product_Object>();
            }
            LisPro.Add(new Product_Object {
            prodid = "CF1",
            prodname = "Cà Phê Đen",
            cateid = "Drinks",
            units = "Tách",
            price = 20000,
            isAvailable = true
            });
            LisPro.Add(new Product_Object{
                prodid = "F1",
                prodname = "Cơm rang dưa bò",
                cateid = "Foods",
                units = "Bát",
                price = 30000,
                isAvailable = true
            });
            LisPro.Add(new Product_Object{
                prodid = "F2",
                prodname = "Bánh mỳ xúc xích",
                cateid = "Foods",
                units = "Chiếc",
                price = 15000,
                isAvailable = true
            });
            return LisPro;
        }
        public List<Product_Object> Insert_Element(Product_Object obj)
        {
            List<Product_Object> lispro1 = new List<Product_Object>();
            lispro1 = Get_Element();
            lispro1.Add(obj)
            return lispro1;
        }

推荐答案


这篇关于如何添加,更新,删除不使用数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 09:09