Exemple #1
0
        public Diablog_PB(string id)
        {
            InitializeComponent();
            border();
            PhanBonDB     db = new PhanBonDB();
            List <string> l  = new List <string>()
            {
                "Vô cơ", "Hữu cơ"
            };

            comboBoxLoai.DataSource = l;
            // load noi dung de sua thong tin
            #region gắn giá trị
            this.id            = Convert.ToInt32(id);
            o                  = db.getPhanBon(id);
            textTenPB.Text     = o.TenPB;
            comboBoxLoai.Text  = o.Loai;
            textDonGia.Text    = o.DonGia.ToString();
            textKhoiLuong.Text = o.KhoiLuong.ToString();
            textSoLuong.Text   = o.SoLuong.ToString();
            DatepickerSX.Value = o.NgaySX;
            DatepickerSX.Value.ToString("dd/MM/yyyy");
            DatepickerHSD.Value = o.HanSD;
            DatepickerHSD.Value.ToString("dd/MM/yyyy");
            #endregion
            // An button add
            button_add.Enabled = false;
            button_add.Visible = false;
            //Hien button luu
            button_luu.Visible = true;
            //button_luu.Enabled = false;
        }
Exemple #2
0
        public void setHuySL(List <HangHoa> list)
        {
            PhanBonDB db = new PhanBonDB();

            foreach (var i in list)
            {
                if (i.loai.Equals("Phân bón"))
                {
                    db.setHuySL(i.ma);
                }
            }
        }
Exemple #3
0
        public void Search(BunifuCustomDataGrid dataGrid, string s)
        {
            PhanBonDB db = new PhanBonDB();

            db.Search(dataGrid, s);
        }
Exemple #4
0
        public void View(BunifuCustomDataGrid dataGrid)
        {
            PhanBonDB db = new PhanBonDB();

            db.View(dataGrid);
        }
Exemple #5
0
        public void Edit(PhanBon o)
        {
            PhanBonDB db = new PhanBonDB();

            db.Edit(o);
        }
Exemple #6
0
        public void Delete(string id)
        {
            PhanBonDB db = new PhanBonDB();

            db.Delete(id);
        }
Exemple #7
0
        public void Add(PhanBon o)
        {
            PhanBonDB db = new PhanBonDB();

            db.Add(o);
        }
Exemple #8
0
        // huy so luong phan bon qua han
        public List <HangHoa> getListPhanBon()
        {
            PhanBonDB db = new PhanBonDB();

            return(db.getListPhanBon());
        }
Exemple #9
0
        public PhanBon getPhanBon(string id)
        {
            PhanBonDB db = new PhanBonDB();

            return(db.getPhanBon(id));
        }