public bool Create(NguoiDung ND)
        {
            ND.Password = SecurityHelper.Encrypt(ND.Password);
            string sql = "INSERT INTO NguoiDung(MaNV, UserName, Password, IsAdmin) VALUES(@MaNV, @UserName, @Password, @IsAdmin)";

            SqlParameter[] pr =
            {
                new SqlParameter("@MaNV",     ND.MaNV),
                new SqlParameter("@UserName", ND.UserName),
                new SqlParameter("@Password", ND.Password),
                new SqlParameter("@IsAdmin",  ND.IsAdmin)
            };
            return(_helper.ExcuteNonQuery(sql, pr, CommandType.Text));//excutenonquery thực thi , trả về true or false( thêm xóa xửa)
        }
Beispiel #2
0
        public bool Create(ThuePhong TP)
        {
            string sql = "INSERT INTO ThuePhong(MaKH, MaPH, NgayNhanPH, SoLuongNguoi) VALUES(@MaKH, @MaPH, @NgayNhanPH, @SoLuongNguoi)";

            SqlParameter[] pr =
            {
                new SqlParameter("@MaKH",         TP.MaKH),
                new SqlParameter("@MaPH",         TP.MaPH),
                new SqlParameter("@NgayNhanPH",   TP.NgayNhanPH),
                new SqlParameter("@SoLuongNguoi", TP.SoLuongNguoi)
            };
            return(_helper.ExcuteNonQuery(sql, pr, CommandType.Text));//excutenonquery thực thi , trả về true or false( thêm xóa xửa)
        }