Exemplo n.º 1
0
        public int update_sp_donhang(DTO_SP_DonHang dto_sp_donhang)
        {
            int parameter = 6;

            string[] name   = new string[parameter];
            object[] values = new object[parameter];

            name[0] = "@iddonhang";
            name[1] = "@idsanpham";
            name[2] = "@idkhachhang";
            name[3] = "@soluong";
            name[4] = "@dongiaban";
            name[5] = "@tylegiamgia";


            values[0] = dto_sp_donhang.iddonhang;
            values[1] = dto_sp_donhang.idsanpham;
            values[2] = dto_sp_donhang.idkhachhang;
            values[3] = dto_sp_donhang.soluong;
            values[4] = dto_sp_donhang.dongiaban;
            values[5] = dto_sp_donhang.tylegiamgia;

            string sql = "update_sp_donhang";

            return(ketnoi.Execute(sql, name, values, parameter));
        }
Exemplo n.º 2
0
        public int delete_sp_donhang1(DTO_SP_DonHang dto_sp_donhang)
        {
            int parameter = 1;

            string[] name   = new string[parameter];
            object[] values = new object[parameter];
            name[0]   = "@iddonhang";
            values[0] = dto_sp_donhang.iddonhang;

            string sql = "delete_sp_donhang1";

            return(ketnoi.Execute(sql, name, values, parameter));
        }
Exemplo n.º 3
0
        private void bt_xoa_Click(object sender, EventArgs e)
        {
            DTO_SP_DonHang dto_sp_donhang = new DTO_SP_DonHang();

            dto_sp_donhang.iddonhang = cbb_iddonhang.Text;
            dto_sp_donhang.idsanpham = cbb_idsanpham.Text;
            //     dto_sp_donhang.idkhachhang = cbb_idkh.Text;

            BUS_SP_DonHang bus_sp_donhang = new BUS_SP_DonHang();

            bus_sp_donhang.delete_sp_donhang(dto_sp_donhang);

            QuanLyCuaNhanVien_Load(sender, e);
            reset_sp_donhang();
        }
Exemplo n.º 4
0
        public int delete_sp_donhang(DTO_SP_DonHang dto_sp_donhang)
        {
            int parameter = 3;

            string[] name   = new string[parameter];
            object[] values = new object[parameter];
            name[0] = "@iddonhang";
            name[1] = "@idsanpham";
            name[2] = "@idkhachhang";

            values[0] = dto_sp_donhang.iddonhang;
            values[1] = dto_sp_donhang.idsanpham;
            values[2] = dto_sp_donhang.idkhachhang;

            string sql = "delete_sp_donhang";

            return(ketnoi.Execute(sql, name, values, parameter));
        }
Exemplo n.º 5
0
        private void but_sua31_Click(object sender, EventArgs e)
        {
            DTO_SP_DonHang dto_sp_donhang = new DTO_SP_DonHang();

            dto_sp_donhang.iddonhang   = cbb_iddonhang.Text;
            dto_sp_donhang.idsanpham   = cbb_idsanpham.Text;
            dto_sp_donhang.idkhachhang = cbb_idkh.Text;
            dto_sp_donhang.soluong     = txt_soluong.Text;
            dto_sp_donhang.dongiaban   = txt_dongiaban.Text;
            dto_sp_donhang.tylegiamgia = txt_tylegiamgia.Text;

            BUS_SP_DonHang bus_sp_donhang = new BUS_SP_DonHang();

            bus_sp_donhang.update_sp_donhang(dto_sp_donhang);

            QuanLyCuaNhanVien_Load(sender, e);
            reset_sp_donhang();
        }
Exemplo n.º 6
0
        private void but_them31_Click(object sender, EventArgs e)
        {
            if (cbb_iddonhang.DropDownHeight == 0)
            {
                MessageBox.Show("Chưa chọn id đơn hàng");
            }
            else if (cbb_idsanpham.DropDownHeight == 0)
            {
                MessageBox.Show("Chưa chọn id sản phẩm");
            }
            else if (cbb_idkh.DropDownHeight == 0)
            {
                MessageBox.Show("Chưa chọn id khách hàng");
            }
            else if (txt_soluong.TextLength == 0)
            {
                MessageBox.Show("Chưa nhập số lượng");
            }
            else if (txt_dongiaban.TextLength == 0)
            {
                MessageBox.Show("Chưa nhập đơn giá bán");
            }
            else if (txt_tylegiamgia.TextLength == 0)
            {
                MessageBox.Show("Chưa nhập tỷ lệ giảm giá");
            }
            else
            {
                DTO_SP_DonHang dto_sp_donhang = new DTO_SP_DonHang();
                dto_sp_donhang.iddonhang   = cbb_iddonhang.Text;
                dto_sp_donhang.idsanpham   = cbb_idsanpham.Text;
                dto_sp_donhang.idkhachhang = cbb_idkh.Text;
                dto_sp_donhang.soluong     = txt_soluong.Text;
                dto_sp_donhang.dongiaban   = txt_dongiaban.Text;
                dto_sp_donhang.tylegiamgia = txt_tylegiamgia.Text;

                BUS_SP_DonHang bus_sp_donhang = new BUS_SP_DonHang();
                bus_sp_donhang.insert_sp_donhang(dto_sp_donhang);

                QuanLyCuaNhanVien_Load(sender, e);
                reset_sp_donhang();
            }
        }
Exemplo n.º 7
0
        private void but_xoa_Click(object sender, EventArgs e)
        {
            DTO_SP_DonHang dto_sp_donhang = new DTO_SP_DonHang();
            DTO_DonHang    dto_donhang    = new DTO_DonHang();

            dto_donhang.iddonhang    = txt_iddonhang.Text;
            dto_sp_donhang.iddonhang = txt_iddonhang.Text;

            BUS_DonHang    bus_donhang    = new BUS_DonHang();
            BUS_SP_DonHang bus_sp_donhang = new BUS_SP_DonHang();

            bus_sp_donhang.delete_sp_donhang1(dto_sp_donhang);
            bus_donhang.delete_donhang(dto_donhang);



            QuanLyCuaNhanVien_Load(sender, e);
            reset_donhang();
        }
Exemplo n.º 8
0
        private void but_xoa5_Click_1(object sender, EventArgs e)
        {
            DTO_SP_DonHang dto_sp_donhang = new DTO_SP_DonHang();
            DTO_DonHang    dto_donhang    = new DTO_DonHang();
            DTO_KhachHang  dto_khachhang  = new DTO_KhachHang();

            BUS_KhachHang  bus_khachhang  = new BUS_KhachHang();
            BUS_DonHang    bus_donhang    = new BUS_DonHang();
            BUS_SP_DonHang bus_sp_donhang = new BUS_SP_DonHang();

            dto_sp_donhang.idkhachhang = txt_id5.Text;
            dto_donhang.idkhachhang    = txt_id5.Text;
            dto_khachhang.idkhachhang  = txt_id5.Text;

            bus_sp_donhang.delete_sp_donhang_idkhachhang(dto_sp_donhang);
            bus_donhang.delete_donhang_idkhachhang(dto_donhang);
            bus_khachhang.delete_khachhang(dto_khachhang);

            QuanLyCuaNhanVien_Load(sender, e);
            reset_khachhang();
        }
Exemplo n.º 9
0
        public int Check_dangky(DTO_SP_DonHang dto_sp_donhang)
        {
            string sql = "select count(*) from sp_donhang where iddonhang='" + dto_sp_donhang.iddonhang + "'";

            return(ketnoi.ReturnInteger(sql));
        }
Exemplo n.º 10
0
 public int checkdky(DTO_SP_DonHang dto_sp_donhang)
 {
     return(dal_sp_donhang.Check_dangky(dto_sp_donhang));
 }
Exemplo n.º 11
0
 public int delete_sp_donhang_idkhachhang(DTO_SP_DonHang dto_sp_donhang)
 {
     return(dal_sp_donhang.delete_sp_donhang_idkhachhang(dto_sp_donhang));
 }
Exemplo n.º 12
0
 public int delete_sp_donhang1(DTO_SP_DonHang dto_sp_donhang)
 {
     return(dal_sp_donhang.delete_sp_donhang1(dto_sp_donhang));
 }
Exemplo n.º 13
0
 public int update_sp_donhang(DTO_SP_DonHang dto_sp_donhang)
 {
     return(dal_sp_donhang.update_sp_donhang(dto_sp_donhang));
 }
Exemplo n.º 14
0
 public int insert_sp_donhang(DTO_SP_DonHang dto_sp_donhang)
 {
     return(dal_sp_donhang.insert_sp_donhang(dto_sp_donhang));
 }