public bool update(loaidto loai)
        {
            string update = string.Format("update LOAI SET TENLOAI = @tenloai WHERE MALOAI = @maloai");

            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0]       = new SqlParameter("@tenloai", SqlDbType.NVarChar, 50);
            sqlParameters[0].Value = Convert.ToString(loai.Tenloai);
            sqlParameters[1]       = new SqlParameter("@maloai", SqlDbType.NVarChar, 15);
            sqlParameters[1].Value = Convert.ToString(loai.Maloai);
            return(conn.executeUpdateQuery(update, sqlParameters));
        }
Exemple #2
0
        public bool update(thanhphodto thanhpho)
        {
            string update = string.Format("update THANHPHO SET TENTP = @tentp WHERE MATP = @matp");

            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0]       = new SqlParameter("@tentp", SqlDbType.NVarChar, 100);
            sqlParameters[0].Value = Convert.ToString(thanhpho.Tenthanhpho);
            sqlParameters[1]       = new SqlParameter("@matp", SqlDbType.NVarChar, 15);
            sqlParameters[1].Value = Convert.ToString(thanhpho.Mathanhpho);
            return(conn.executeUpdateQuery(update, sqlParameters));
        }
        public bool update(nhaphangdto nhaphang)
        {
            string update = string.Format("update NHAPHANG SET NGAYNHAPHANG = @ngaynh, MACHINHANH = @machinhanh WHERE MANHAPHANG = @manh");

            SqlParameter[] sqlParameters = new SqlParameter[3];
            sqlParameters[0]       = new SqlParameter("@ngaynh", SqlDbType.Date);
            sqlParameters[0].Value = Convert.ToString(nhaphang.Ngaynhaphang);
            sqlParameters[1]       = new SqlParameter("@manh", SqlDbType.NVarChar, 15);
            sqlParameters[1].Value = Convert.ToString(nhaphang.Manhaphang);
            sqlParameters[2]       = new SqlParameter("@machinhanh", SqlDbType.Int);
            sqlParameters[2].Value = nhaphang.Machinhanh;
            return(conn.executeUpdateQuery(update, sqlParameters));
        }
        public bool update(cuahangdto cuahang)
        {
            string update = string.Format("update CUAHANG SET TENCHINHANH = @tencuahang, DIACHI = @diachi, MATP = @matp WHERE MACUAHANG = @machinhanh");

            SqlParameter[] sqlParameters = new SqlParameter[4];
            sqlParameters[0]       = new SqlParameter("@tenchinhanh", SqlDbType.NVarChar, 100);
            sqlParameters[0].Value = Convert.ToString(cuahang.Tenchinhanh);
            sqlParameters[1]       = new SqlParameter("@diachi", SqlDbType.NVarChar, 100);
            sqlParameters[1].Value = Convert.ToString(cuahang.Diachi);
            sqlParameters[2]       = new SqlParameter("@matp", SqlDbType.NVarChar, 15);
            sqlParameters[2].Value = Convert.ToString(cuahang.Matp);
            sqlParameters[3]       = new SqlParameter("@macuahang", SqlDbType.Int);
            sqlParameters[3].Value = cuahang.Machinhanh;
            return(conn.executeUpdateQuery(update, sqlParameters));
        }
Exemple #5
0
        public bool update(tonkhodto tonkho)
        {
            string update = string.Format("update TONKHO SET MAVP= @mavp, NGAYHETHAN= @ngayhethan, SOLUONGNHAP= @slnhap, SOLUONGTON= @slton WHERE MANHAPHANG = @manh");

            SqlParameter[] sqlParameters = new SqlParameter[5];
            sqlParameters[0]       = new SqlParameter("@mavp", SqlDbType.Int);
            sqlParameters[0].Value = Convert.ToString(tonkho.Mavp);
            sqlParameters[1]       = new SqlParameter("@ngayhethan", SqlDbType.Date);
            sqlParameters[1].Value = Convert.ToString(tonkho.Ngayhethan);
            sqlParameters[2]       = new SqlParameter("@slnhap", SqlDbType.Int);
            sqlParameters[2].Value = Convert.ToString(tonkho.Soluongnhap);
            sqlParameters[3]       = new SqlParameter("@slton", SqlDbType.Int);
            sqlParameters[3].Value = Convert.ToString(tonkho.Soluongton);
            sqlParameters[4]       = new SqlParameter("@manh", SqlDbType.NVarChar, 15);
            sqlParameters[4].Value = Convert.ToString(tonkho.Manhaphang);
            return(conn.executeUpdateQuery(update, sqlParameters));
        }
        public bool update(vatphamdto vp)
        {
            string update = string.Format("update VATPHAM SET HINHANH = @hinhanh, TENVP = @tenvp, LOAIVP = @loaivp, GIA = @gia, TUKHOA = @tukhoa WHERE MAVP = @mavp");

            SqlParameter[] sqlParameters = new SqlParameter[6];
            sqlParameters[0]       = new SqlParameter("@hinhanh", SqlDbType.NVarChar, 100);
            sqlParameters[0].Value = Convert.ToString(vp.Hinhanh);
            sqlParameters[1]       = new SqlParameter("@tenvp", SqlDbType.NVarChar, 100);
            sqlParameters[1].Value = Convert.ToString(vp.Tenvatpham);
            sqlParameters[2]       = new SqlParameter("@loaivp", SqlDbType.NVarChar, 15);
            sqlParameters[2].Value = Convert.ToString(vp.Loaivatpham);
            sqlParameters[3]       = new SqlParameter("@gia", SqlDbType.Decimal);
            sqlParameters[3].Value = Convert.ToString(vp.Gia);
            sqlParameters[4]       = new SqlParameter("@tukhoa", SqlDbType.NVarChar, 100);
            sqlParameters[4].Value = Convert.ToString(vp.Tukhoa);
            sqlParameters[5]       = new SqlParameter("@mavp", SqlDbType.Int);
            sqlParameters[5].Value = Convert.ToString(vp.Mavatpham);
            return(conn.executeUpdateQuery(update, sqlParameters));
        }