예제 #1
0
        public void setHuySL(List <HangHoa> list)
        {
            ThuocBaoVeTVDB db = new ThuocBaoVeTVDB();

            foreach (var i in list)
            {
                if (i.loai.Equals("Thuốc BVTV"))
                {
                    db.setHuySL(i.ma);
                }
            }
        }
예제 #2
0
        public Diablog_TBV(string id)
        {
            InitializeComponent();
            border();
            ThuocBaoVeTVDB db = new ThuocBaoVeTVDB();
            List <string>  l  = new List <string>()
            {
                "Dung dịch", "Hạt", "Bột", "Viên", "Nhũ dầu", "Huyền phù", "Thuốc phun bột"
            };

            comboboxDang.DataSource = l;
            Dictionary <string, string> dic;

            using (QLNTEntities1 db1 = new QLNTEntities1())
            {
                dic = (
                    from c in db1.DoDoc
                    select new { c.MaDoc, c.MucDoDoc }

                    ).ToDictionary(c => c.MaDoc, c => c.MucDoDoc);
            }
            comboboxDoDoc.DataSource = dic.Values.ToList();
            #region gắn giá trị
            this.id                 = Convert.ToInt32(id);
            o                       = db.GetThuocBaoVeTV(id);
            textTenThuoc.Text       = o.TenThuoc;
            textThoiGianCachLy.Text = o.ThoiGianCachLy.ToString();
            textNoiSX.Text          = o.NoiSX;
            comboboxDang.Text       = o.Dang;
            textSoLuong.Text        = o.SoLuong.ToString();
            textCongDung.Text       = o.CongDung;
            DatepickerSX.Value      = o.NgaySX;
            DatepickerSX.Value.ToString("dd/MM/yyyy");
            DatepickerHSD.Value = o.HanSD;
            DatepickerHSD.Value.ToString("dd/MM/yyyy");
            var temp = o.MaDoc;
            Dictionary <string, string> d;
            using (QLNTEntities1 db1 = new QLNTEntities1())
            {
                d = (
                    from z in db1.DoDoc
                    select new { z.MaDoc, z.MucDoDoc }

                    ).ToDictionary(z => z.MaDoc, z => z.MucDoDoc);
            }
            var kq = d.Values.ToString();
            foreach (var k in d)
            {
                if (k.Key.ToString() == temp.ToString())
                {
                    kq = k.Value.ToString();
                    break;
                }
            }
            comboboxDoDoc.Text = kq;
            #endregion
            // An button add
            button_add.Enabled = false;
            button_add.Visible = false;
            //Hien button luu
            button_luu.Visible = true;
            //button_luu.Enabled = false;
        }
예제 #3
0
        // huy so luong phan bon qua han
        public List <HangHoa> getListTBV()
        {
            ThuocBaoVeTVDB db = new ThuocBaoVeTVDB();

            return(db.getListTBV());
        }
예제 #4
0
        public void Search(BunifuCustomDataGrid dataGrid, string s)
        {
            ThuocBaoVeTVDB db = new ThuocBaoVeTVDB();

            db.Search(dataGrid, s);
        }
예제 #5
0
        public void View(BunifuCustomDataGrid dataGrid)
        {
            ThuocBaoVeTVDB db = new ThuocBaoVeTVDB();

            db.View(dataGrid);
        }
예제 #6
0
        public void Edit(ThuocBaoVeTV o)
        {
            ThuocBaoVeTVDB db = new ThuocBaoVeTVDB();

            db.Edit(o);
        }
예제 #7
0
        public void Delete(string id)
        {
            ThuocBaoVeTVDB db = new ThuocBaoVeTVDB();

            db.Delete(id);
        }
예제 #8
0
        public void Add(ThuocBaoVeTV o)
        {
            ThuocBaoVeTVDB db = new ThuocBaoVeTVDB();

            db.Add(o);
        }