Ejemplo n.º 1
0
 private void btn_Update_Click(object sender, EventArgs e)
 {
     if (edt_Ten.Text.Trim() != "" && edt_LoaiLop.Text.Trim() != "" && edt_DongCo.Text.Trim() != "" &&
         edt_DungTich.Text.Trim() != "" && edt_Gia.Text.Trim() != "" && edt_KichThuoc.Text.Trim() != "" &&
         edt_PhanhSau.Text.Trim() != "" && edt_PhanhTruoc.Text.Trim() != "" && edt_KhoiLuong.Text.Trim() != "" &&
         edt_Momen.Text.Trim() != "")
     {
         Data_Entity.DanhMuc_Data.Edit_DanhMuc(new DanhMuc()
         {
             id_DanhMuc        = edt_Ma.Text,
             name_DanhMuc      = edt_Ten.Text,
             breakend_DanhMuc  = edt_PhanhSau.Text,
             breakfont_DanhMuc = edt_PhanhTruoc.Text,
             engine_DanhMuc    = edt_DongCo.Text,
             size_DanhMuc      = edt_KichThuoc.Text,
             price_DanhMuc     = int.Parse(edt_Gia.Text),
             volume_DanhMuc    = edt_DungTich.Text,
             tire_DanhMuc      = edt_LoaiLop.Text,
             torque_DanhMuc    = edt_Momen.Text,
             weight_DanhMuc    = int.Parse(edt_KhoiLuong.Text),
             id_BaoHanh        = cbb_BaoHanh.SelectedValue.ToString(),
             id_HangSX         = cbb_Hang.SelectedValue.ToString(),
             id_LoaiSP         = cbb_Loai.SelectedValue.ToString(),
             image_DanhMuc     = ImageConvert.ConvertImageToBinary(this.ptb_HinhAnh.Image)
         });
         MessageBox.Show("The object is Updated!", "Note", MessageBoxButtons.OK);
         this.edt_Ma.Text = Create_ID.Gennaral_ID(Data_Entity.DanhMuc_Data.Get_IdDanhMuc());
     }
     else
     {
         MessageBox.Show("The fields is not Null!", "Note", MessageBoxButtons.OK);
     }
 }
Ejemplo n.º 2
0
        private void btn_Add_Click(object sender, EventArgs e)
        {
            string id = Create_ID.Gennaral_ID(Data_Entity.HangSX_Data.Get_IdHangSX());

            edt_Ma.Text             = id;
            edt_Ten.Text            = "";
            edt_ChuThich.Text       = "Trống";
            this.status             = true;
            this.btn_Update.Enabled = this.btn_Cancel.Enabled = true;
        }
Ejemplo n.º 3
0
        private void btn_Add_Click(object sender, EventArgs e)
        {
            string id = Create_ID.Gennaral_ID(Data_Entity.NhaCC_Data.Get_IdNhaCc());

            edt_Ma.Text             = id;
            edt_Ten.Text            = "";
            edt_Dienthoai.Text      = edt_DiaChi.Text = edt_Mail.Text = "Trống";
            this.status             = true;
            this.btn_Update.Enabled = this.btn_Cancel.Enabled = true;
        }
Ejemplo n.º 4
0
        private void Add_DanhMuc_Load(object sender, EventArgs e)
        {
            this.edt_Ma.Text = Create_ID.Gennaral_ID(Data_Entity.DanhMuc_Data.Get_IdDanhMuc());

            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";

            cbb_BaoHanh.SelectedIndex = cbb_Hang.SelectedIndex = cbb_Loai.SelectedIndex = 0;
        }