Esempio n. 1
0
        private void but_Thêm_Click(object sender, EventArgs e)
        {
            if (txt_idnhacungcap.TextLength == 0)
            {
                MessageBox.Show("Chưa nhập ID nhà cung cấp");
            }
            else if (txt_tencongty.TextLength == 0)
            {
                MessageBox.Show("Chưa nhập tên công ty");
            }
            else if (txt_diachiNCC.TextLength == 0)
            {
                MessageBox.Show("Chưa nhập địa chỉ");
            }
            else if (txt_sđt.TextLength == 0)
            {
                MessageBox.Show("Chưa nhập số điện thoại");
            }
            else if (txt_website.TextLength == 0)
            {
                MessageBox.Show("Chưa nhập website");
            }
            else if (txt_congiaodich.TextLength == 0)
            {
                MessageBox.Show("Chưa nhập còn giao dịch");
            }

            else
            {
                DTO_NhaCungCap dto_nhacungcap = new DTO_NhaCungCap();
                dto_nhacungcap.idnhacungcap = txt_idnhacungcap.Text;
                dto_nhacungcap.tencongty    = txt_tencongty.Text;
                dto_nhacungcap.diachi       = txt_diachiNCC.Text;
                dto_nhacungcap.sodienthoai  = txt_sđt.Text;
                dto_nhacungcap.website      = txt_website.Text;
                dto_nhacungcap.congiaodich  = txt_congiaodich.Text;

                BUS_NhaCungCap bus_nhacungcap = new BUS_NhaCungCap();
                bus_nhacungcap.insert_nhacungcap(dto_nhacungcap);

                Quan_Ly_Load(sender, e);
                reset_nhacungcap();
            }
        }