Пример #1
0
        private void Set_UI()
        {
            cbb_Loai.DataSource    = LoaiSP_Data.Get_LoaiSpList();
            cbb_Loai.ValueMember   = "id_LoaiSP";
            cbb_Loai.DisplayMember = "name_LoaiSP";

            cbb_BaoHanh.DataSource    = BaoHanh_Data.Get_BaoHanhList();
            cbb_BaoHanh.DisplayMember = "lim_BaoHanh";
            cbb_BaoHanh.ValueMember   = "id_BaoHanh";

            cbb_Hang.DataSource    = HangSX_Data.Get_HangSXList();
            cbb_Hang.ValueMember   = "id_HangSX";
            cbb_Hang.DisplayMember = "name_HangSX";

            DanhMuc danhMuc = DanhMuc_Data.Get_DanhMuc(this.id);

            edt_Ma.Text               = danhMuc.id_DanhMuc;
            edt_Ten.Text              = danhMuc.name_DanhMuc;
            edt_PhanhSau.Text         = danhMuc.breakend_DanhMuc;
            edt_PhanhTruoc.Text       = danhMuc.breakfont_DanhMuc;
            edt_DongCo.Text           = danhMuc.engine_DanhMuc;
            edt_KichThuoc.Text        = danhMuc.size_DanhMuc;
            edt_Gia.Text              = danhMuc.price_DanhMuc.ToString();
            edt_DungTich.Text         = danhMuc.volume_DanhMuc;
            edt_LoaiLop.Text          = danhMuc.tire_DanhMuc;
            edt_Momen.Text            = danhMuc.torque_DanhMuc;
            edt_KhoiLuong.Text        = danhMuc.weight_DanhMuc.ToString();
            ptb_HinhAnh.Image         = ImageConvert.ConvertBinaryToImage(danhMuc.image_DanhMuc);
            cbb_Loai.SelectedValue    = danhMuc.id_LoaiSP;
            cbb_Hang.SelectedValue    = danhMuc.id_HangSX;
            cbb_BaoHanh.SelectedValue = danhMuc.id_BaoHanh;
        }
Пример #2
0
        private void Show_Detail(string id)
        {
            this.btn_Update.Enabled = this.btn_Delete.Enabled = true;
            Get_DanhMucCustom_Result danhMuc = DanhMuc_Data.Get_DanhMucItem(id);

            this.id              = id;
            lbl_IdSP.Text        = "Ma: " + danhMuc.id_DanhMuc;
            lbl_TenSP.Text       = "Ten: " + danhMuc.name_DanhMuc;
            lbl_SizeSP.Text      = "Kich thuoc: " + danhMuc.size_DanhMuc;
            lbl_PriceSP.Text     = "Gia: " + danhMuc.price_DanhMuc + " VND";
            lbl_TorqueSP.Text    = "Momen xoan: " + danhMuc.torque_DanhMuc;
            lbl_TotalSP.Text     = "So luong: " + danhMuc.total_DanhMuc;
            lbl_WieghtSP.Text    = "Trong luong: " + danhMuc.weight_DanhMuc + " KG";
            lbl_VolumeSP.Text    = "Dung tich: " + danhMuc.volume_DanhMuc + "";
            lbl_FontBreakSP.Text = "Phanh truoc: " + danhMuc.breakfont_DanhMuc;
            lbl_EndBreakSP.Text  = "Phanh sau: " + danhMuc.breakend_DanhMuc;
            lbl_EngineSP.Text    = "Dong co: " + danhMuc.engine_DanhMuc;
            lbl_TireSP.Text      = "Lop" + danhMuc.tire_DanhMuc;
            lbl_HangSP.Text      = "Hang SX: " + danhMuc.name_HangSX;
            lbl_LoaiSP.Text      = "Loai xe: " + danhMuc.name_LoaiSP;
            lbl_BaoHanhSP.Text   = "Bao hanh: " + danhMuc.lim_BaoHanh;
            ptb_HinhAnh.Image    = ImageConvert.ConvertBinaryToImage(danhMuc.image_DanhMuc);
        }
Пример #3
0
 private void btn_Delete_Click(object sender, EventArgs e)
 {
     DanhMuc_Data.Delete_DanhMuc(this.id);
     MessageBox.Show("The object is Deleted!", "Note", MessageBoxButtons.OK, MessageBoxIcon.Information);
     Load_AllSanPham();
 }